Changeset 70317 in webkit
- Timestamp:
- Oct 22, 2010 10:43:31 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r70316 r70317 1 2010-10-22 Cosmin Truta <ctruta@chromium.org> 2 3 Reviewed by Nikolas Zimmermann. 4 5 getBoundingClientRect does not work with SVG <text> 6 https://bugs.webkit.org/show_bug.cgi?id=46775 7 8 Added coordinate checks on various zoomed-in and zoomed-out 9 XHTML and SVG elements, using getBoundingClientRect. 10 11 * css3/zoom-coords.xhtml: Added. 12 * css3/zoom-coords-expected.txt: Added. 13 1 14 2010-10-22 Adam Roben <aroben@apple.com> 2 15 -
trunk/WebCore/ChangeLog
r70314 r70317 1 2010-10-22 Cosmin Truta <ctruta@chromium.org> 2 3 Reviewed by Nikolas Zimmermann. 4 5 getBoundingClientRect does not work with SVG <text> 6 https://bugs.webkit.org/show_bug.cgi?id=46775 7 8 Dispatched the calls from Element::getBoundingClientRect to getBBox 9 through SVGElement::boundingBox. 10 Recognized SVGTextElement in addition to SVGStyledLocatableElement 11 as a class that provides getBBox. 12 Fixed the result of zooming: adjusted the getBoundingClientRect rectangle 13 for absolute zoom, even for SVG elements. 14 15 Additional cleanup task: 16 Removed redundant overloads of SVGStyledTransformableElement 17 methods: nearestViewportElement, farthestViewportElement, getBBox. 18 These methods are already inherited from SVGStyledLocatableElement. 19 20 Test: css3/zoom-coords.xhtml 21 22 * WebCore.xcodeproj/project.pbxproj: Set role of SVGLocatable.h to private. 23 * dom/Element.cpp: 24 (Element::getBoundingClientRect): Used SVGElement::boundingBox. 25 Adjusted coordinates for absolute zoom, for all kinds of elements. 26 * svg/SVGElement.cpp: 27 * svg/SVGElement.h: 28 (SVGElement::boundingBox): Added. 29 * svg/SVGStyledTransformableElement.cpp: 30 * svg/SVGStyledTransformableElement.h: 31 (SVGStyledTransformableElement::nearestViewportElement): Removed. 32 (SVGStyledTransformableElement::farthestViewportElement): Removed. 33 (SVGStyledTransformableElement::getBBox): Removed. 34 1 35 2010-10-22 Patrick Gansterer <paroga@webkit.org> 2 36 -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r70300 r70317 4049 4049 B2227A3F0D00BF220071B782 /* SVGListTraits.h in Headers */ = {isa = PBXBuildFile; fileRef = B22278A90D00BF200071B782 /* SVGListTraits.h */; settings = {ATTRIBUTES = (Private, ); }; }; 4050 4050 B2227A400D00BF220071B782 /* SVGLocatable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B22278AA0D00BF200071B782 /* SVGLocatable.cpp */; }; 4051 B2227A410D00BF220071B782 /* SVGLocatable.h in Headers */ = {isa = PBXBuildFile; fileRef = B22278AB0D00BF200071B782 /* SVGLocatable.h */; };4051 B2227A410D00BF220071B782 /* SVGLocatable.h in Headers */ = {isa = PBXBuildFile; fileRef = B22278AB0D00BF200071B782 /* SVGLocatable.h */; settings = {ATTRIBUTES = (Private, ); }; }; 4052 4052 B2227A430D00BF220071B782 /* SVGMarkerElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B22278AD0D00BF200071B782 /* SVGMarkerElement.cpp */; }; 4053 4053 B2227A440D00BF220071B782 /* SVGMarkerElement.h in Headers */ = {isa = PBXBuildFile; fileRef = B22278AE0D00BF200071B782 /* SVGMarkerElement.h */; }; -
trunk/WebCore/dom/Element.cpp
r70302 r70317 53 53 #include "RenderView.h" 54 54 #include "RenderWidget.h" 55 #include "SVGStyledLocatableElement.h"56 55 #include "Settings.h" 57 56 #include "TextIterator.h" … … 60 59 61 60 #if ENABLE(SVG) 61 #include "SVGElement.h" 62 62 #include "SVGNames.h" 63 63 #endif … … 489 489 Vector<FloatQuad> quads; 490 490 #if ENABLE(SVG) 491 if (isSVGElement() ) {491 if (isSVGElement() && renderer()) { 492 492 // Get the bounding rectangle from the SVG model. 493 493 const SVGElement* svgElement = static_cast<const SVGElement*>(this); 494 if (svgElement->isStyledLocatable()) { 495 if (renderer()) { 496 const FloatRect& localRect = static_cast<const SVGStyledLocatableElement*>(svgElement)->getBBox(); 497 quads.append(renderer()->localToAbsoluteQuad(localRect)); 498 } 499 } 494 FloatRect localRect; 495 if (svgElement->boundingBox(localRect)) 496 quads.append(renderer()->localToAbsoluteQuad(localRect)); 500 497 } else 501 498 #endif … … 518 515 } 519 516 520 if (renderBoxModelObject()) 521 adjustIntRectForAbsoluteZoom(result, renderBoxModelObject()); 522 517 adjustIntRectForAbsoluteZoom(result, renderer()); 523 518 return ClientRect::create(result); 524 519 } -
trunk/WebCore/svg/SVGElement.cpp
r69868 r70317 43 43 #include "SVGNames.h" 44 44 #include "SVGSVGElement.h" 45 #include "SVGStyledLocatableElement.h" 46 #include "SVGTextElement.h" 45 47 #include "SVGURIReference.h" 46 48 #include "SVGUseElement.h" … … 178 180 } 179 181 return rareSVGData()->elementInstances(); 182 } 183 184 bool SVGElement::boundingBox(FloatRect& rect, SVGLocatable::StyleUpdateStrategy styleUpdateStrategy) const 185 { 186 if (isStyledLocatable()) { 187 rect = static_cast<const SVGStyledLocatableElement*>(this)->getBBox(styleUpdateStrategy); 188 return true; 189 } 190 if (hasTagName(SVGNames::textTag)) { 191 rect = static_cast<const SVGTextElement*>(this)->getBBox(styleUpdateStrategy); 192 return true; 193 } 194 return false; 180 195 } 181 196 -
trunk/WebCore/svg/SVGElement.h
r70135 r70317 25 25 #if ENABLE(SVG) 26 26 #include "SVGDocumentExtensions.h" 27 #include "SVGLocatable.h" 27 28 #include "StyledElement.h" 28 29 … … 72 73 const HashSet<SVGElementInstance*>& instancesForElement() const; 73 74 75 bool boundingBox(FloatRect&, SVGLocatable::StyleUpdateStrategy = SVGLocatable::AllowStyleUpdate) const; 76 74 77 void setCursorElement(SVGCursorElement*); 75 78 void setCursorImageValue(CSSCursorImageValue*); -
trunk/WebCore/svg/SVGStyledTransformableElement.cpp
r69517 r70317 91 91 } 92 92 93 SVGElement* SVGStyledTransformableElement::nearestViewportElement() const94 {95 return SVGTransformable::nearestViewportElement(this);96 }97 98 SVGElement* SVGStyledTransformableElement::farthestViewportElement() const99 {100 return SVGTransformable::farthestViewportElement(this);101 }102 103 FloatRect SVGStyledTransformableElement::getBBox(StyleUpdateStrategy styleUpdateStrategy) const104 {105 return SVGTransformable::getBBox(this, styleUpdateStrategy);106 }107 108 93 RenderObject* SVGStyledTransformableElement::createRenderer(RenderArena* arena, RenderStyle*) 109 94 { -
trunk/WebCore/svg/SVGStyledTransformableElement.h
r69517 r70317 38 38 virtual AffineTransform getCTM(StyleUpdateStrategy = AllowStyleUpdate) const; 39 39 virtual AffineTransform getScreenCTM(StyleUpdateStrategy = AllowStyleUpdate) const; 40 virtual SVGElement* nearestViewportElement() const;41 virtual SVGElement* farthestViewportElement() const;42 40 43 41 virtual AffineTransform localCoordinateSpaceTransform(SVGLocatable::CTMScope mode) const { return SVGTransformable::localCoordinateSpaceTransform(mode); } 44 42 virtual AffineTransform animatedLocalTransform() const; 45 43 virtual AffineTransform* supplementalTransform(); 46 47 virtual FloatRect getBBox(StyleUpdateStrategy = AllowStyleUpdate) const;48 44 49 45 bool isKnownAttribute(const QualifiedName&);
Note: See TracChangeset
for help on using the changeset viewer.