Chromium Code Reviews| 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..c33525315da92a83425183f96a8e9d7ed01cc752 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) : false); |
|
fs
2014/10/30 12:31:38
Nit: "style() && style()->whiteSpace() == PRE" fee
|
| +} |
| + |
| } |