Chromium Code Reviews| 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); |
| } |