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

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

Issue 1328283005: Add support for multiple text decorations with same line positioning (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 5 years 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 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);

Powered by Google App Engine
This is Rietveld 408576698