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

Unified Diff: Source/core/rendering/svg/RenderSVGInlineText.cpp

Issue 688023002: text-transform causes incorrect text placement in svg (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch for landing Created 6 years, 2 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 | « Source/core/rendering/svg/RenderSVGInlineText.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/svg/RenderSVGInlineText.cpp
diff --git a/Source/core/rendering/svg/RenderSVGInlineText.cpp b/Source/core/rendering/svg/RenderSVGInlineText.cpp
index 1aeb6d9eb244bf53b1f5b645a269e332abd72c7f..a21c09919c366e0e0704d136e9e774f9a8a0fee1 100644
--- a/Source/core/rendering/svg/RenderSVGInlineText.cpp
+++ b/Source/core/rendering/svg/RenderSVGInlineText.cpp
@@ -80,13 +80,8 @@ void RenderSVGInlineText::styleDidChange(StyleDifference diff, const RenderStyle
bool newPreserves = style() ? style()->whiteSpace() == PRE : false;
bool oldPreserves = oldStyle ? oldStyle->whiteSpace() == PRE : false;
- if (oldPreserves && !newPreserves) {
- setText(applySVGWhitespaceRules(originalText(), false), true);
- return;
- }
-
- if (!oldPreserves && newPreserves) {
- setText(applySVGWhitespaceRules(originalText(), true), true);
+ if (oldPreserves != newPreserves) {
+ setText(originalText(), true);
return;
}
@@ -247,4 +242,12 @@ LayoutRect RenderSVGInlineText::clippedOverflowRectForPaintInvalidation(const Re
return parent()->clippedOverflowRectForPaintInvalidation(paintInvalidationContainer, paintInvalidationState);
}
+PassRefPtr<StringImpl> RenderSVGInlineText::originalText() const
+{
+ RefPtr<StringImpl> result = RenderText::originalText();
+ if (!result)
+ return nullptr;
+ return applySVGWhitespaceRules(result, style() && style()->whiteSpace() == PRE);
+}
+
}
« no previous file with comments | « Source/core/rendering/svg/RenderSVGInlineText.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698