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

Unified Diff: 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: Review feedback Created 5 years, 3 months 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: Source/core/css/resolver/StyleAdjuster.cpp
diff --git a/Source/core/css/resolver/StyleAdjuster.cpp b/Source/core/css/resolver/StyleAdjuster.cpp
index cffe90e1a6a699f5bde5aa09d48f237edde15443..1cc1662e59089f0237f0da0d4024797a258a5d1d 100644
--- a/Source/core/css/resolver/StyleAdjuster.cpp
+++ b/Source/core/css/resolver/StyleAdjuster.cpp
@@ -111,7 +111,14 @@ static bool doesNotInheritTextDecoration(const ComputedStyle& style, const Eleme
{
return style.display() == INLINE_TABLE
|| style.display() == INLINE_BLOCK || style.display() == INLINE_BOX || isAtShadowBoundary(e)
- || style.isFloating() || style.hasOutOfFlowPosition() || isOutermostSVGElement(e);
+ || style.isFloating() || style.hasOutOfFlowPosition() || isOutermostSVGElement(e)
+ || isHTMLRTElement(e);
+}
+
+// Certain elements (<a>, <font>) bind strongly to text decoration colors, for legacy reasons.
+static bool overridesTextDecorationColors(const Element* e)
+{
+ return e && (isHTMLFontElement(e) || isHTMLAnchorElement(e));
}
// FIXME: This helper is only needed because pseudoStyleForElement passes a null
@@ -204,8 +211,7 @@ void StyleAdjuster::adjustComputedStyle(ComputedStyle& style, const ComputedStyl
if (doesNotInheritTextDecoration(style, e))
style.clearAppliedTextDecorations();
-
- style.applyTextDecorations();
+ style.applyTextDecorations(overridesTextDecorationColors(e));
if (style.overflowX() != OVISIBLE || style.overflowY() != OVISIBLE)
adjustOverflow(style);

Powered by Google App Engine
This is Rietveld 408576698