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

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

Issue 1241463003: Stop propagating text decorations on outermost SVG roots (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 5 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
« no previous file with comments | « LayoutTests/svg/text/text-decoration-propagation-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/StyleAdjuster.cpp
diff --git a/Source/core/css/resolver/StyleAdjuster.cpp b/Source/core/css/resolver/StyleAdjuster.cpp
index ddc486e2911935341e95b48dedfddcfd04cb115a..ea0adfd5adacb3065e46e9a919226b7510e37cc5 100644
--- a/Source/core/css/resolver/StyleAdjuster.cpp
+++ b/Source/core/css/resolver/StyleAdjuster.cpp
@@ -98,14 +98,20 @@ static EDisplay equivalentBlockDisplay(EDisplay display, bool isFloating, bool s
return BLOCK;
}
+static bool isOutermostSVGElement(const Element* e)
+{
+ return e && e->isSVGElement() && toSVGElement(*e).isOutermostSVGSVGElement();
+}
+
// CSS requires text-decoration to be reset at each DOM element for tables,
// inline blocks, inline tables, shadow DOM crossings, floating elements,
-// and absolute or relatively positioned elements.
+// and absolute or relatively positioned elements. Outermost <svg> roots are
+// considered to be atomic inline-level.
static bool doesNotInheritTextDecoration(const ComputedStyle& style, const Element* e)
{
return style.display() == TABLE || style.display() == INLINE_TABLE
|| style.display() == INLINE_BLOCK || style.display() == INLINE_BOX || isAtShadowBoundary(e)
- || style.isFloating() || style.hasOutOfFlowPosition();
+ || style.isFloating() || style.hasOutOfFlowPosition() || isOutermostSVGElement(e);
}
// FIXME: This helper is only needed because pseudoStyleForElement passes a null
« no previous file with comments | « LayoutTests/svg/text/text-decoration-propagation-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698