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

Unified Diff: Source/core/dom/Element.cpp

Issue 1317563010: Drop SVGElement::getBoundingBox (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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 | Source/core/svg/SVGElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Element.cpp
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
index 3e566abf16ce2457f0f45f2980a0d8e2cbe0a6b2..bf606f4052f9a268229cd22f45743e662a3666bc 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -999,10 +999,8 @@ IntRect Element::boundsInViewportSpace()
Vector<FloatQuad> quads;
if (isSVGElement() && layoutObject()) {
fs 2015/09/08 15:33:53 This looks like a potential bug for outermost <svg
// Get the bounding rectangle from the SVG model.
- SVGElement* svgElement = toSVGElement(this);
- FloatRect localRect;
- if (svgElement->getBoundingBox(localRect))
- quads.append(layoutObject()->localToAbsoluteQuad(localRect));
+ if (toSVGElement(this)->isSVGGraphicsElement())
+ quads.append(layoutObject()->localToAbsoluteQuad(layoutObject()->objectBoundingBox()));
} else {
// Get the bounding rectangle from the box model.
if (layoutBoxModelObject())
@@ -1045,10 +1043,8 @@ ClientRect* Element::getBoundingClientRect()
if (elementLayoutObject) {
if (isSVGElement() && !elementLayoutObject->isSVGRoot()) {
// Get the bounding rectangle from the SVG model.
- SVGElement* svgElement = toSVGElement(this);
- FloatRect localRect;
- if (svgElement->getBoundingBox(localRect))
- quads.append(elementLayoutObject->localToAbsoluteQuad(localRect));
+ if (toSVGElement(this)->isSVGGraphicsElement())
+ quads.append(elementLayoutObject->localToAbsoluteQuad(elementLayoutObject->objectBoundingBox()));
fs 2015/09/08 15:33:53 I pondered for a while why this couldn't just use
pdr. 2015/09/09 06:45:52 Please do update us when you find out.
} else if (elementLayoutObject->isBoxModelObject() || elementLayoutObject->isBR()) {
elementLayoutObject->absoluteQuads(quads);
}
« no previous file with comments | « no previous file | Source/core/svg/SVGElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698