Chromium Code Reviews| Index: third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp |
| diff --git a/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp b/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp |
| index cffe90e1a6a699f5bde5aa09d48f237edde15443..b9b14158ffd0a2ebc6b6111873021de572e07b84 100644 |
| --- a/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp |
| +++ b/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp |
| @@ -111,7 +111,18 @@ static bool doesNotInheritTextDecoration(const ComputedStyle& style, const Eleme |
| { |
| return style.display() == INLINE_TABLE |
| || style.display() == INLINE_BLOCK || style.display() == INLINE_BOX || isAtShadowBoundary(e) |
| - || style.isFloating() || style.hasOutOfFlowPosition() || isOutermostSVGElement(e); |
| + || style.isFloating() || style.hasOutOfFlowPosition() || isOutermostSVGElement(e) |
| + || isHTMLRTElement(e); |
|
Timothy Loh
2015/10/01 01:51:43
Is this a separate bug fix? If so, put it in a sep
sashab
2015/10/02 02:45:41
No? Both code paths now use this function, so it n
|
| +} |
| + |
| +// Certain elements (<a>, <font>) bind strongly to text decoration colors. |
| +// "The font element is expected to override the color of any text decoration that |
| +// spans the text of the element to the used value of the element's 'color' property." |
| +// (from https://html.spec.whatwg.org/multipage/rendering.html#phrasing-content-3) |
| +// The <a> behavior is non-standard. |
| +static bool overridesTextDecorationColors(const Element* e) |
| +{ |
| + return e && (isHTMLFontElement(e) || isHTMLAnchorElement(e)); |
| } |
| // FIXME: This helper is only needed because pseudoStyleForElement passes a null |
| @@ -204,8 +215,7 @@ void StyleAdjuster::adjustComputedStyle(ComputedStyle& style, const ComputedStyl |
| if (doesNotInheritTextDecoration(style, e)) |
| style.clearAppliedTextDecorations(); |
| - |
| - style.applyTextDecorations(); |
| + style.applyTextDecorations(parentStyle, overridesTextDecorationColors(e)); |
| if (style.overflowX() != OVISIBLE || style.overflowY() != OVISIBLE) |
| adjustOverflow(style); |