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

Unified Diff: third_party/WebKit/Source/core/dom/ResizeObservation.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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/svg/SVGGraphicsElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/ResizeObservation.cpp
diff --git a/third_party/WebKit/Source/core/dom/ResizeObservation.cpp b/third_party/WebKit/Source/core/dom/ResizeObservation.cpp
index d1d201479c5f77e45fb80d4ce6f80e8849bfbcce..916aa3297d4cb518781bf904d9942aa4e2262dff 100644
--- a/third_party/WebKit/Source/core/dom/ResizeObservation.cpp
+++ b/third_party/WebKit/Source/core/dom/ResizeObservation.cpp
@@ -38,14 +38,15 @@ size_t ResizeObservation::TargetDepth() {
LayoutSize ResizeObservation::ComputeTargetSize() const {
if (target_) {
- if (target_->IsSVGElement() &&
- ToSVGElement(target_)->IsSVGGraphicsElement()) {
- SVGGraphicsElement& svg = ToSVGGraphicsElement(*target_);
- return LayoutSize(svg.GetBBox().Size());
+ if (LayoutObject* layout_object = target_->GetLayoutObject()) {
+ if (target_->IsSVGElement() &&
+ ToSVGElement(target_)->IsSVGGraphicsElement()) {
+ SVGGraphicsElement& svg = ToSVGGraphicsElement(*target_);
+ return LayoutSize(svg.GetBBox().Size());
+ }
+ if (layout_object->IsBox())
+ return ToLayoutBox(layout_object)->ContentSize();
}
- LayoutBox* layout = target_->GetLayoutBox();
- if (layout)
- return layout->ContentSize();
}
return LayoutSize();
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/svg/SVGGraphicsElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698