Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Unified Diff: third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp

Issue 2497963002: Add support for multiple text decorations with same line positioning (Closed)
Patch Set: Update slimming paint expectations Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 c69c1d970a2f74a88a09900fcfb19205fcc5394f..9fec720ec9fdd59bda1fe7e9ed856e7c11251666 100644
--- a/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp
@@ -108,7 +108,18 @@ static bool doesNotInheritTextDecoration(const ComputedStyle& style,
style.display() == EDisplay::InlineBlock ||
style.display() == EDisplay::InlineBox ||
isAtShadowBoundary(element) || style.isFloating() ||
- style.hasOutOfFlowPosition() || isOutermostSVGElement(element);
+ 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."
+// (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
@@ -430,7 +441,9 @@ void StyleAdjuster::adjustComputedStyle(ComputedStyle& style,
style.clearAppliedTextDecorations();
else
style.restoreParentTextDecorations(parentStyle);
- style.applyTextDecorations();
+ style.applyTextDecorations(
+ parentStyle.visitedDependentColor(CSSPropertyTextDecorationColor),
+ overridesTextDecorationColors(element));
// Cull out any useless layers and also repeat patterns into additional
// layers.

Powered by Google App Engine
This is Rietveld 408576698