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 87b4b97906a2c5031739e43b21a519270a0f2433..c28238baf16af6dde07041522ad99b91389678e6 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(element) |
| - || style.isFloating() || style.hasOutOfFlowPosition() || isOutermostSVGElement(element); |
| + || style.isFloating() || style.hasOutOfFlowPosition() || isOutermostSVGElement(element) |
| + || isHTMLRTElement(element); |
| +} |
| + |
| +// Certain elements (<a>, <font>) bind strongly to text decoration colors. |
|
Timothy Loh
2015/10/12 00:11:16
This sentence doesn't make sense to me.
sashab
2015/10/12 23:11:01
I was trying to explain the weird behavior in a cl
|
| +// "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* element) |
| +{ |
| + return element && (isHTMLFontElement(element) || isHTMLAnchorElement(element)); |
| } |
| // 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, element)) |
| style.clearAppliedTextDecorations(); |
| - |
| - style.applyTextDecorations(); |
| + style.applyTextDecorations(parentStyle.visitedDependentColor(CSSPropertyTextDecorationColor), overridesTextDecorationColors(element)); |
| if (style.overflowX() != OVISIBLE || style.overflowY() != OVISIBLE) |
| adjustOverflow(style); |