Changeset 17991 in webkit
- Timestamp:
- Dec 3, 2006 4:02:26 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r17988 r17991 1 2006-12-03 Rob Buis <buis@kde.org> 2 3 Reviewed by Oliver. 4 5 Testcase for: 6 http://bugs.webkit.org/show_bug.cgi?id=11667 7 SVG: method .getTransformToElement(elt) in SVGLocatable not implemented 8 9 * svg/custom/getTransformToElement-expected.checksum: Added. 10 * svg/custom/getTransformToElement-expected.png: Added. 11 * svg/custom/getTransformToElement-expected.txt: Added. 12 * svg/custom/getTransformToElement.svg: Added. 13 1 14 2006-12-03 Alexey Proskuryakov <ap@webkit.org> 2 15 -
trunk/WebCore/ChangeLog
r17990 r17991 1 2006-12-03 Rob Buis <buis@kde.org> 2 3 Reviewed by Oliver. 4 5 http://bugs.webkit.org/show_bug.cgi?id=11667 6 SVG: method .getTransformToElement(elt) in SVGLocatable not implemented 7 8 Implement getTransformToElement functionality. Introduce virtual 9 baseclass SVGLocatable to allow one implementation of the functionality. 10 Finally cleanup some code. 11 12 * ksvg2/svg/SVGLocatable.cpp: 13 (WebCore::SVGLocatable::getTransformToElement): 14 * ksvg2/svg/SVGLocatable.h: 15 * ksvg2/svg/SVGStyledLocatableElement.cpp: 16 (WebCore::SVGStyledLocatableElement::SVGStyledLocatableElement): 17 (WebCore::SVGStyledLocatableElement::nearestViewportElement): 18 (WebCore::SVGStyledLocatableElement::farthestViewportElement): 19 (WebCore::SVGStyledLocatableElement::getCTM): 20 (WebCore::SVGStyledLocatableElement::getScreenCTM): 21 * ksvg2/svg/SVGStyledLocatableElement.h: 22 * ksvg2/svg/SVGStyledTransformableElement.cpp: 23 (WebCore::SVGStyledTransformableElement::SVGStyledTransformableElement): 24 (WebCore::SVGStyledTransformableElement::localMatrix): 25 (WebCore::SVGStyledTransformableElement::getCTM): 26 (WebCore::SVGStyledTransformableElement::getScreenCTM): 27 (WebCore::SVGStyledTransformableElement::updateLocalTransform): 28 (WebCore::SVGStyledTransformableElement::parseMappedAttribute): 29 (WebCore::SVGStyledTransformableElement::nearestViewportElement): 30 (WebCore::SVGStyledTransformableElement::farthestViewportElement): 31 * ksvg2/svg/SVGStyledTransformableElement.h: 32 * ksvg2/svg/SVGTextElement.h: 33 * ksvg2/svg/SVGTransformable.h: 34 1 35 2006-12-03 Nikolas Zimmermann <zimmermann@kde.org> 2 36 -
trunk/WebCore/ksvg2/svg/SVGLocatable.cpp
r17062 r17991 124 124 } 125 125 126 SVGMatrix* SVGLocatable::getTransformToElement(SVGElement* target, ExceptionCode& ec) const 127 { 128 RefPtr<SVGMatrix> startctm(getCTM()); 129 SVGMatrix* ctm = SVGSVGElement::createSVGMatrix(); 130 ctm->multiply(startctm.get()); 131 132 SVGElement* targetElement = svg_dynamic_cast(target); 133 if (targetElement && targetElement->isStyledLocatable()) { 134 RefPtr<SVGMatrix> targetCTM = static_cast<SVGStyledLocatableElement*>(targetElement)->getCTM(); 135 targetCTM.get()->inverse(ec); 136 if (ec) 137 return ctm; 138 ctm->postMultiply(targetCTM.get()); 139 } 140 141 return ctm; 142 } 143 126 144 } 127 145 -
trunk/WebCore/ksvg2/svg/SVGLocatable.h
r16330 r17991 47 47 virtual SVGMatrix* getCTM() const = 0; 48 48 virtual SVGMatrix* getScreenCTM() const = 0; 49 virtual SVGMatrix* getTransformToElement(SVGElement*, ExceptionCode&) const = 0;49 SVGMatrix* getTransformToElement(SVGElement*, ExceptionCode&) const; 50 50 51 51 protected: -
trunk/WebCore/ksvg2/svg/SVGStyledLocatableElement.cpp
r17265 r17991 1 1 /* 2 2 Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org> 3 2004, 2005 Rob Buis <buis@kde.org>3 2004, 2005, 2006 Rob Buis <buis@kde.org> 4 4 5 5 This file is part of the KDE project … … 32 32 #include "SVGSVGElement.h" 33 33 34 using namespace WebCore; 34 namespace WebCore { 35 35 36 SVGStyledLocatableElement::SVGStyledLocatableElement(const QualifiedName& tagName, Document *doc) 37 : SVGStyledElement(tagName, doc), SVGLocatable() 36 SVGStyledLocatableElement::SVGStyledLocatableElement(const QualifiedName& tagName, Document* doc) 37 : SVGLocatable() 38 , SVGStyledElement(tagName, doc) 38 39 { 39 40 } … … 43 44 } 44 45 45 SVGElement *SVGStyledLocatableElement::nearestViewportElement() const46 SVGElement* SVGStyledLocatableElement::nearestViewportElement() const 46 47 { 47 48 return SVGLocatable::nearestViewportElement(this); 48 49 } 49 50 50 SVGElement *SVGStyledLocatableElement::farthestViewportElement() const51 SVGElement* SVGStyledLocatableElement::farthestViewportElement() const 51 52 { 52 53 return SVGLocatable::farthestViewportElement(this); … … 58 59 } 59 60 60 SVGMatrix *SVGStyledLocatableElement::getCTM() const61 SVGMatrix* SVGStyledLocatableElement::getCTM() const 61 62 { 62 63 return SVGLocatable::getCTM(this); 63 64 } 64 65 65 SVGMatrix *SVGStyledLocatableElement::getScreenCTM() const66 SVGMatrix* SVGStyledLocatableElement::getScreenCTM() const 66 67 { 67 68 return SVGLocatable::getScreenCTM(this); 68 69 } 69 70 70 SVGMatrix *SVGStyledLocatableElement::getTransformToElement(SVGElement *, ExceptionCode&) const71 {72 // TODO!73 return 0;74 71 } 75 72 -
trunk/WebCore/ksvg2/svg/SVGStyledLocatableElement.h
r16330 r17991 1 1 /* 2 2 Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org> 3 2004, 2005 Rob Buis <buis@kde.org>3 2004, 2005, 2006 Rob Buis <buis@kde.org> 4 4 5 5 This file is part of the KDE project … … 33 33 class SVGElement; 34 34 35 class SVGStyledLocatableElement : public SVGStyledElement, public SVGLocatable {35 class SVGStyledLocatableElement : public SVGStyledElement, virtual public SVGLocatable { 36 36 public: 37 37 SVGStyledLocatableElement(const QualifiedName&, Document*); … … 47 47 virtual SVGMatrix* getCTM() const; 48 48 virtual SVGMatrix* getScreenCTM() const; 49 virtual SVGMatrix* getTransformToElement(SVGElement*, ExceptionCode&) const;50 49 }; 51 50 -
trunk/WebCore/ksvg2/svg/SVGStyledTransformableElement.cpp
r17879 r17991 1 1 /* 2 2 Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org> 3 2004, 2005 Rob Buis <buis@kde.org>3 2004, 2005, 2006 Rob Buis <buis@kde.org> 4 4 5 5 This file is part of the KDE project … … 36 36 #include "SVGTransformList.h" 37 37 38 using namespace WebCore; 38 namespace WebCore { 39 39 40 SVGStyledTransformableElement::SVGStyledTransformableElement(const QualifiedName& tagName, Document *doc)40 SVGStyledTransformableElement::SVGStyledTransformableElement(const QualifiedName& tagName, Document* doc) 41 41 : SVGStyledLocatableElement(tagName, doc) 42 42 , SVGTransformable() … … 51 51 ANIMATED_PROPERTY_DEFINITIONS(SVGStyledTransformableElement, SVGTransformList*, TransformList, transformList, Transform, transform, SVGNames::transformAttr.localName(), m_transform.get()) 52 52 53 SVGMatrix *SVGStyledTransformableElement::localMatrix() const53 SVGMatrix* SVGStyledTransformableElement::localMatrix() const 54 54 { 55 55 return lazy_create<SVGMatrix>(m_localMatrix); 56 56 } 57 57 58 SVGMatrix *SVGStyledTransformableElement::getCTM() const58 SVGMatrix* SVGStyledTransformableElement::getCTM() const 59 59 { 60 60 return SVGTransformable::getCTM(this); 61 61 } 62 62 63 SVGMatrix *SVGStyledTransformableElement::getScreenCTM() const63 SVGMatrix* SVGStyledTransformableElement::getScreenCTM() const 64 64 { 65 65 return SVGTransformable::getScreenCTM(this); 66 66 } 67 67 68 void SVGStyledTransformableElement::updateLocalTransform(SVGTransformList *localTransforms)68 void SVGStyledTransformableElement::updateLocalTransform(SVGTransformList* localTransforms) 69 69 { 70 70 // Update cached local matrix … … 79 79 } 80 80 81 void SVGStyledTransformableElement::parseMappedAttribute(MappedAttribute *attr)81 void SVGStyledTransformableElement::parseMappedAttribute(MappedAttribute* attr) 82 82 { 83 83 if (attr->name() == SVGNames::transformAttr) { 84 SVGTransformList *localTransforms = transformBaseValue();84 SVGTransformList* localTransforms = transformBaseValue(); 85 85 86 86 ExceptionCode ec = 0; … … 93 93 } 94 94 95 SVGElement *SVGStyledTransformableElement::nearestViewportElement() const95 SVGElement* SVGStyledTransformableElement::nearestViewportElement() const 96 96 { 97 97 return SVGTransformable::nearestViewportElement(this); 98 98 } 99 99 100 SVGElement *SVGStyledTransformableElement::farthestViewportElement() const100 SVGElement* SVGStyledTransformableElement::farthestViewportElement() const 101 101 { 102 102 return SVGTransformable::farthestViewportElement(this); … … 106 106 { 107 107 return SVGTransformable::getBBox(this); 108 }109 110 SVGMatrix *SVGStyledTransformableElement::getTransformToElement(SVGElement*, ExceptionCode&) const111 {112 return 0;113 108 } 114 109 … … 121 116 } 122 117 118 } 123 119 124 120 // vim:ts=4:noet -
trunk/WebCore/ksvg2/svg/SVGStyledTransformableElement.h
r16330 r17991 1 1 /* 2 2 Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org> 3 2004, 2005 Rob Buis <buis@kde.org>3 2004, 2005, 2006 Rob Buis <buis@kde.org> 4 4 5 5 This file is part of the KDE project … … 46 46 47 47 // 'SVGTransformable' functions 48 virtual SVGMatrix *localMatrix() const;48 virtual SVGMatrix* localMatrix() const; 49 49 50 50 // Derived from: 'SVGLocatable' 51 virtual SVGMatrix *getCTM() const;52 virtual SVGMatrix *getScreenCTM() const;53 virtual SVGElement *nearestViewportElement() const;54 virtual SVGElement *farthestViewportElement() const;51 virtual SVGMatrix* getCTM() const; 52 virtual SVGMatrix* getScreenCTM() const; 53 virtual SVGElement* nearestViewportElement() const; 54 virtual SVGElement* farthestViewportElement() const; 55 55 56 56 virtual FloatRect getBBox() const; 57 virtual SVGMatrix *getTransformToElement(SVGElement*, ExceptionCode&) const;58 57 59 virtual void parseMappedAttribute(MappedAttribute *attr);58 virtual void parseMappedAttribute(MappedAttribute* attr); 60 59 61 void updateLocalTransform(SVGTransformList *localTransforms);60 void updateLocalTransform(SVGTransformList* localTransforms); 62 61 63 62 virtual void attach(); -
trunk/WebCore/ksvg2/svg/SVGTextElement.h
r17008 r17991 46 46 virtual SVGMatrix* getCTM() const; 47 47 virtual SVGMatrix* getScreenCTM() const; 48 virtual SVGMatrix* getTransformToElement(SVGElement*, ExceptionCode&) const { return 0; }49 48 50 49 virtual bool rendererIsNeeded(RenderStyle* style) { return StyledElement::rendererIsNeeded(style); } -
trunk/WebCore/ksvg2/svg/SVGTransformable.h
r17879 r17991 33 33 class SVGTransformList; 34 34 35 class SVGTransformable : public SVGLocatable {35 class SVGTransformable : virtual public SVGLocatable { 36 36 public: 37 37 SVGTransformable();
Note: See TracChangeset
for help on using the changeset viewer.