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

Unified Diff: Source/core/dom/Text.cpp

Issue 1166653005: Don't create layout objects for pre-wrap text nodes in SVG (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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/white-space-pre-wrap-whitespace-only-crash-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Text.cpp
diff --git a/Source/core/dom/Text.cpp b/Source/core/dom/Text.cpp
index 461d5f14f5d2fdd1439006746cc260a008878547..6bc251bdba83751f6db12822a8af885c86e4b0ab 100644
--- a/Source/core/dom/Text.cpp
+++ b/Source/core/dom/Text.cpp
@@ -274,7 +274,12 @@ bool Text::textLayoutObjectIsNeeded(const ComputedStyle& style, const LayoutObje
if (!canHaveWhitespaceChildren(parent))
return false;
- if (style.preserveNewline()) // pre/pre-wrap/pre-line always make layoutObjects.
+ // pre-wrap in SVG never makes layoutObject.
+ if (style.whiteSpace() == PRE_WRAP && parent.isSVG())
+ return false;
+
+ // pre/pre-wrap/pre-line always make layoutObjects.
+ if (style.preserveNewline())
return true;
// childNeedsDistributionRecalc() here is rare, only happens JS calling surroundContents() etc. from DOMNodeInsertedIntoDocument etc.
« no previous file with comments | « LayoutTests/svg/text/white-space-pre-wrap-whitespace-only-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698