Commit 5ee08c3d authored by fs@opera.com's avatar fs@opera.com

Drop SVGElement::getBoundingBox

The two users can be trivially replaced with queries on the layout tree
instead.

Review URL: https://codereview.chromium.org/1317563010

git-svn-id: svn://svn.chromium.org/blink/trunk@201973 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent a1cdff5e
...@@ -999,10 +999,8 @@ IntRect Element::boundsInViewportSpace() ...@@ -999,10 +999,8 @@ IntRect Element::boundsInViewportSpace()
Vector<FloatQuad> quads; Vector<FloatQuad> quads;
if (isSVGElement() && layoutObject()) { if (isSVGElement() && layoutObject()) {
// Get the bounding rectangle from the SVG model. // Get the bounding rectangle from the SVG model.
SVGElement* svgElement = toSVGElement(this); if (toSVGElement(this)->isSVGGraphicsElement())
FloatRect localRect; quads.append(layoutObject()->localToAbsoluteQuad(layoutObject()->objectBoundingBox()));
if (svgElement->getBoundingBox(localRect))
quads.append(layoutObject()->localToAbsoluteQuad(localRect));
} else { } else {
// Get the bounding rectangle from the box model. // Get the bounding rectangle from the box model.
if (layoutBoxModelObject()) if (layoutBoxModelObject())
...@@ -1045,10 +1043,8 @@ ClientRect* Element::getBoundingClientRect() ...@@ -1045,10 +1043,8 @@ ClientRect* Element::getBoundingClientRect()
if (elementLayoutObject) { if (elementLayoutObject) {
if (isSVGElement() && !elementLayoutObject->isSVGRoot()) { if (isSVGElement() && !elementLayoutObject->isSVGRoot()) {
// Get the bounding rectangle from the SVG model. // Get the bounding rectangle from the SVG model.
SVGElement* svgElement = toSVGElement(this); if (toSVGElement(this)->isSVGGraphicsElement())
FloatRect localRect; quads.append(elementLayoutObject->localToAbsoluteQuad(elementLayoutObject->objectBoundingBox()));
if (svgElement->getBoundingBox(localRect))
quads.append(elementLayoutObject->localToAbsoluteQuad(localRect));
} else if (elementLayoutObject->isBoxModelObject() || elementLayoutObject->isBR()) { } else if (elementLayoutObject->isBoxModelObject() || elementLayoutObject->isBR()) {
elementLayoutObject->absoluteQuads(quads); elementLayoutObject->absoluteQuads(quads);
} }
......
...@@ -501,15 +501,6 @@ const WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement>>& SVGElement::instanc ...@@ -501,15 +501,6 @@ const WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement>>& SVGElement::instanc
return svgRareData()->elementInstances(); return svgRareData()->elementInstances();
} }
bool SVGElement::getBoundingBox(FloatRect& rect)
{
if (!isSVGGraphicsElement())
return false;
rect = toSVGGraphicsElement(this)->getBBox();
return true;
}
void SVGElement::setCursorElement(SVGCursorElement* cursorElement) void SVGElement::setCursorElement(SVGCursorElement* cursorElement)
{ {
SVGElementRareData* rareData = ensureSVGRareData(); SVGElementRareData* rareData = ensureSVGRareData();
......
...@@ -113,8 +113,6 @@ public: ...@@ -113,8 +113,6 @@ public:
void mapInstanceToElement(SVGElement*); void mapInstanceToElement(SVGElement*);
void removeInstanceMapping(SVGElement*); void removeInstanceMapping(SVGElement*);
bool getBoundingBox(FloatRect&);
void setCursorElement(SVGCursorElement*); void setCursorElement(SVGCursorElement*);
void setCursorImageValue(CSSCursorImageValue*); void setCursorImageValue(CSSCursorImageValue*);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment