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

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: Rebased 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 afa1f2d411b8e988076e4f72f28dc65ed8b35ec3..a96cdf9548c651f13a848cbd463760f93d9099d1 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
@@ -429,7 +440,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