summaryrefslogtreecommitdiffstats
path: root/WebCore/rendering/RenderSVGRoot.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/rendering/RenderSVGRoot.cpp')
-rw-r--r--WebCore/rendering/RenderSVGRoot.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/WebCore/rendering/RenderSVGRoot.cpp b/WebCore/rendering/RenderSVGRoot.cpp
index ad3303f..396df19 100644
--- a/WebCore/rendering/RenderSVGRoot.cpp
+++ b/WebCore/rendering/RenderSVGRoot.cpp
@@ -48,6 +48,7 @@ namespace WebCore {
RenderSVGRoot::RenderSVGRoot(SVGStyledElement* node)
: RenderBox(node)
+ , m_isLayoutSizeChanged(false)
{
setReplaced(true);
}
@@ -116,13 +117,14 @@ void RenderSVGRoot::layout()
IntSize oldSize(width(), height());
calcWidth();
calcHeight();
-
calcViewport();
- // RenderSVGRoot needs to take special care to propagate window size changes to the children,
- // if the outermost <svg> is using relative x/y/width/height values. Hence the additonal parameters.
SVGSVGElement* svg = static_cast<SVGSVGElement*>(node());
- SVGRenderSupport::layoutChildren(this, needsLayout || (svg->hasRelativeLengths() && oldSize != size()));
+ m_isLayoutSizeChanged = svg->hasRelativeLengths() && oldSize != size();
+
+ SVGRenderSupport::layoutChildren(this, needsLayout);
+ m_isLayoutSizeChanged = false;
+
repainter.repaintAfterLayout();
view()->enableLayoutState();
@@ -200,9 +202,6 @@ void RenderSVGRoot::calcViewport()
{
SVGSVGElement* svg = static_cast<SVGSVGElement*>(node());
- if (!selfNeedsLayout() && !svg->hasRelativeLengths())
- return;
-
if (!svg->hasSetContainerSize()) {
// In the normal case of <svg> being stand-alone or in a CSSBoxModel object we use
// RenderBox::width()/height() (which pulls data from RenderStyle)
@@ -270,12 +269,17 @@ FloatRect RenderSVGRoot::strokeBoundingBox() const
FloatRect RenderSVGRoot::repaintRectInLocalCoordinates() const
{
- // FIXME: This does not include the border but it should!
FloatRect repaintRect = SVGRenderSupport::computeContainerBoundingBox(this, SVGRenderSupport::RepaintBoundingBox);
style()->svgStyle()->inflateForShadow(repaintRect);
+ repaintRect.inflate(borderAndPaddingWidth());
return repaintRect;
}
+IntRect RenderSVGRoot::clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer)
+{
+ return SVGRenderSupport::clippedOverflowRectForRepaint(this, repaintContainer);
+}
+
void RenderSVGRoot::computeRectForRepaint(RenderBoxModelObject* repaintContainer, IntRect& repaintRect, bool fixed)
{
// Apply our local transforms (except for x/y translation), then our shadow,