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;
}
textRenderer->setNeedsLayoutAndFullPaintInvalidation();
}
-InlineTextBox* RenderSVGInlineText::createTextBox()
+InlineTextBox* RenderSVGInlineText::createTextBox(int start, unsigned short length)
{
- InlineTextBox* box = new SVGInlineTextBox(*this);
+ InlineTextBox* box = new SVGInlineTextBox(*this, start, length);
box->setHasVirtualLogicalHeight();
return box;
}
scaledFont.update(document.styleEngine()->fontSelector());
}
+LayoutRect RenderSVGInlineText::clippedOverflowRectForPaintInvalidation(const RenderLayerModelObject* paintInvalidationContainer, const PaintInvalidationState* paintInvalidationState) const
+{
+ // FIXME: The following works because RenderSVGBlock has forced slow rect mapping of the paintInvalidationState.
+ // Should let this really work with paintInvalidationState's fast mapping and remove the assert.
+ ASSERT(!paintInvalidationState || !paintInvalidationState->canMapToContainer(paintInvalidationContainer));
+ 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);
+}
+
}