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

Unified Diff: third_party/WebKit/Source/core/svg/SVGGraphicsElement.cpp

Issue 2854123004: Hoist layout update out of SVGGraphicsElement::GetBBox and overrides (Closed)
Patch Set: Created 3 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/svg/SVGGraphicsElement.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGGraphicsElement.cpp b/third_party/WebKit/Source/core/svg/SVGGraphicsElement.cpp
index b6e36cdc2feffc6060d2ca9d30c7bd0867b4be70..8510323af580f663f8e78fc1ebe8495c9e5e5532 100644
--- a/third_party/WebKit/Source/core/svg/SVGGraphicsElement.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGGraphicsElement.cpp
@@ -173,17 +173,18 @@ SVGElement* SVGGraphicsElement::farthestViewportElement() const {
}
FloatRect SVGGraphicsElement::GetBBox() {
- GetDocument().UpdateStyleAndLayoutIgnorePendingStylesheets();
-
- // FIXME: Eventually we should support getBBox for detached elements.
- if (!GetLayoutObject())
- return FloatRect();
-
+ DCHECK(GetLayoutObject());
return GetLayoutObject()->ObjectBoundingBox();
}
SVGRectTearOff* SVGGraphicsElement::getBBoxFromJavascript() {
- return SVGRectTearOff::Create(SVGRect::Create(GetBBox()), 0,
+ GetDocument().UpdateStyleAndLayoutIgnorePendingStylesheets();
+
+ // FIXME: Eventually we should support getBBox for detached elements.
+ FloatRect boundingBox;
+ if (GetLayoutObject())
+ boundingBox = GetBBox();
+ return SVGRectTearOff::Create(SVGRect::Create(boundingBox), 0,
kPropertyIsNotAnimVal);
}
« no previous file with comments | « third_party/WebKit/Source/core/dom/ResizeObservation.cpp ('k') | third_party/WebKit/Source/core/svg/SVGPathElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698