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..a049d04325e2849b8ecedb9dc70ba5a42e46425b 100644 |
--- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGShape.cpp |
+++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGShape.cpp |
@@ -156,31 +156,40 @@ void LayoutSVGShape::updateLocalTransform() |
void LayoutSVGShape::layout() |
{ |
- bool updateCachedBoundariesInParents = false; |
LayoutAnalyzer::Scope analyzer(*this); |
+ // Invalidate all resources of this client if our layout changed. |
+ if (everHadLayout() && selfNeedsLayout()) |
+ SVGResourcesCache::clientLayoutChanged(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_paintInvalidationBoundingBox = strokeBoundingBox(); |
+ SVGLayoutSupport::intersectPaintInvalidationRectWithResources(this, m_paintInvalidationBoundingBox); |
m_needsBoundariesUpdate = false; |
- updateCachedBoundariesInParents = 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 our bounds changed, notify the parents. |
- if (updateCachedBoundariesInParents) |
+ if (updateParentBoundaries) |
LayoutSVGModelObject::setNeedsBoundariesUpdate(); |
+ ASSERT(!m_needsShapeUpdate); |
+ ASSERT(!m_needsBoundariesUpdate); |
+ ASSERT(!m_needsTransformUpdate); |
clearNeedsLayout(); |
} |
@@ -283,12 +292,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()); |