| 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 9d584a4a6caa665d2a41eeffbbe769a7faa1e1e8..a32034e8bf24ffd92495d7c966aef57a46523b4c 100644
|
| --- a/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp
|
| +++ b/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp
|
| @@ -112,7 +112,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>) override 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* element)
|
| +{
|
| + return element && (isHTMLFontElement(element) || isHTMLAnchorElement(element));
|
| }
|
|
|
| // FIXME: This helper is only needed because pseudoStyleForElement passes a null
|
| @@ -209,7 +220,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);
|
|
|