Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(415)

Unified Diff: third_party/WebKit/Source/core/layout/svg/LayoutSVGShape.cpp

Issue 1907333002: Order bounds update correctly for LayoutSVGShape and LayoutSVGImage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Shuffle clientLayoutChanged instead. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/layout/svg/LayoutSVGShape.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « third_party/WebKit/Source/core/layout/svg/LayoutSVGShape.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698