Changeset 67252 in webkit
- Timestamp:
- Sep 10, 2010 5:47:30 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r67249 r67252 1 2010-09-10 Cosmin Truta <ctruta@chromium.org> 2 3 Reviewed by Nikolas Zimmermann. 4 5 getBoundingClientRect Broken for SVG Elements 6 https://bugs.webkit.org/show_bug.cgi?id=42815 7 8 Added tests for getBoundingClientRect applied to SVG elements. 9 10 * svg/custom/getBoundingClientRect.xhtml: Added 11 * svg/custom/getBoundingClientRect-expected.txt: Added 12 1 13 2010-09-10 Jian Li <jianli@chromium.org> 2 14 -
trunk/WebCore/ChangeLog
r67251 r67252 1 2010-09-10 Cosmin Truta <ctruta@chromium.org> 2 3 Reviewed by Nikolas Zimmermann. 4 5 getBoundingClientRect Broken for SVG Elements 6 https://bugs.webkit.org/show_bug.cgi?id=42815 7 8 Use getBBox to retrieve the bounding rectangle for SVG elements. 9 10 Test: svg/dom/getBoundingClientRect.xhtml 11 12 * dom/Element.cpp: 13 (Element::getBoundingClientRect): 14 1 15 2010-09-09 Jer Noble <jer.noble@apple.com> 2 16 -
trunk/WebCore/dom/Element.cpp
r67238 r67252 51 51 #include "RenderView.h" 52 52 #include "RenderWidget.h" 53 #include "SVGStyledLocatableElement.h" 53 54 #include "Settings.h" 54 55 #include "TextIterator.h" … … 477 478 { 478 479 document()->updateLayoutIgnorePendingStylesheets(); 479 RenderBoxModelObject* renderBoxModelObject = this->renderBoxModelObject();480 if (!renderBoxModelObject)481 return ClientRect::create();482 480 483 481 Vector<FloatQuad> quads; 484 renderBoxModelObject->absoluteQuads(quads); 482 if (isSVGElement()) { 483 // Get the bounding rectangle from the SVG model. 484 const SVGElement* svgElement = static_cast<const SVGElement*>(this); 485 if (svgElement->isStyledLocatable()) { 486 if (renderer()) { 487 const FloatRect& localRect = static_cast<const SVGStyledLocatableElement*>(svgElement)->getBBox(); 488 quads.append(renderer()->localToAbsoluteQuad(localRect)); 489 } 490 } 491 } else { 492 // Get the bounding rectangle from the box model. 493 if (renderBoxModelObject()) 494 renderBoxModelObject()->absoluteQuads(quads); 495 } 485 496 486 497 if (quads.isEmpty()) … … 496 507 } 497 508 498 adjustIntRectForAbsoluteZoom(result, renderBoxModelObject); 509 if (renderBoxModelObject()) 510 adjustIntRectForAbsoluteZoom(result, renderBoxModelObject()); 499 511 500 512 return ClientRect::create(result);
Note: See TracChangeset
for help on using the changeset viewer.