Index: third_party/WebKit/Source/core/layout/svg/LayoutSVGShape.cpp |
diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGShape.cpp b/third_party/WebKit/Source/core/layout/svg/LayoutSVGShape.cpp |
index b7671c4696908d97dcb7e9ab9ca4fa87a98a1779..93a965ea2bbf22c3cad4769ce0d4b7f44963ca8d 100644 |
--- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGShape.cpp |
+++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGShape.cpp |
@@ -156,29 +156,39 @@ void LayoutSVGShape::updateLocalTransform() |
void LayoutSVGShape::layout() |
{ |
- bool updateCachedBoundariesInParents = false; |
LayoutAnalyzer::Scope analyzer(*this); |
+ bool updateParentBoundaries = false; |
+ // updateShapeFromElement() also updates the object & stroke bounds - which |
+ // feeds into the paint invalidation rect - so we need to call it for both |
+ // the shape-update and the bounds-update flag, since . |
if (m_needsShapeUpdate || m_needsBoundariesUpdate) { |
updateShapeFromElement(); |
m_needsShapeUpdate = false; |
- updatePaintInvalidationBoundingBox(); |
- m_needsBoundariesUpdate = false; |
- updateCachedBoundariesInParents = true; |
+ |
+ m_needsBoundariesUpdate = true; |
+ updateParentBoundaries = true; |
} |
if (m_needsTransformUpdate) { |
updateLocalTransform(); |
m_needsTransformUpdate = false; |
- updateCachedBoundariesInParents = true; |
+ updateParentBoundaries = true; |
} |
// Invalidate all resources of this client if our layout changed. |
if (everHadLayout() && selfNeedsLayout()) |
SVGResourcesCache::clientLayoutChanged(this); |
+ if (m_needsBoundariesUpdate) { |
+ m_paintInvalidationBoundingBox = strokeBoundingBox(); |
+ SVGLayoutSupport::intersectPaintInvalidationRectWithResources(this, m_paintInvalidationBoundingBox); |
+ m_needsBoundariesUpdate = false; |
+ updateParentBoundaries = true; |
+ } |
+ |
// If our bounds changed, notify the parents. |
- if (updateCachedBoundariesInParents) |
+ if (updateParentBoundaries) |
LayoutSVGModelObject::setNeedsBoundariesUpdate(); |
clearNeedsLayout(); |
@@ -283,12 +293,6 @@ FloatRect LayoutSVGShape::calculateStrokeBoundingBox() const |
return strokeBoundingBox; |
} |
-void LayoutSVGShape::updatePaintInvalidationBoundingBox() |
-{ |
- m_paintInvalidationBoundingBox = strokeBoundingBox(); |
- SVGLayoutSupport::intersectPaintInvalidationRectWithResources(this, m_paintInvalidationBoundingBox); |
-} |
- |
float LayoutSVGShape::strokeWidth() const |
{ |
SVGLengthContext lengthContext(element()); |