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

Unified Diff: third_party/WebKit/Source/core/layout/svg/LayoutSVGImage.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
Index: third_party/WebKit/Source/core/layout/svg/LayoutSVGImage.cpp
diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGImage.cpp b/third_party/WebKit/Source/core/layout/svg/LayoutSVGImage.cpp
index ccb9c174c603764b7fa3599a0641e7c4a915b022..91867b267e3846e7871142f9b3e0af1f11131e9a 100644
--- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGImage.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGImage.cpp
@@ -79,29 +79,32 @@ void LayoutSVGImage::layout()
ASSERT(needsLayout());
LayoutAnalyzer::Scope analyzer(*this);
+ // Invalidate all resources of this client if our layout changed.
+ if (everHadLayout() && selfNeedsLayout())
+ SVGResourcesCache::clientLayoutChanged(this);
+
updateBoundingBox();
- bool transformOrBoundariesUpdate = m_needsTransformUpdate || m_needsBoundariesUpdate;
+ bool updateParentBoundaries = false;
if (m_needsTransformUpdate) {
m_localTransform = toSVGImageElement(element())->calculateAnimatedLocalTransform();
m_needsTransformUpdate = false;
+ updateParentBoundaries = true;
}
if (m_needsBoundariesUpdate) {
m_paintInvalidationBoundingBox = m_objectBoundingBox;
SVGLayoutSupport::intersectPaintInvalidationRectWithResources(this, m_paintInvalidationBoundingBox);
-
m_needsBoundariesUpdate = false;
+ 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 (transformOrBoundariesUpdate)
+ if (updateParentBoundaries)
LayoutSVGModelObject::setNeedsBoundariesUpdate();
+ ASSERT(!m_needsBoundariesUpdate);
+ ASSERT(!m_needsTransformUpdate);
clearNeedsLayout();
}

Powered by Google App Engine
This is Rietveld 408576698