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. |