Changeset 68867 in webkit
- Timestamp:
- Oct 1, 2010 12:16:23 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r68865 r68867 1 2010-10-01 Nikolas Zimmermann <nzimmermann@rim.com> 2 3 Reviewed by Dirk Schulze. 4 5 Add helper methods to cast between renderers & SVGTextContent/PositioningElement 6 https://bugs.webkit.org/show_bug.cgi?id=46963 7 8 Doesn't affect any tests. 9 10 * svg/SVGTextContentElement.cpp: 11 (WebCore::SVGTextContentElement::elementFromRenderer): 12 * svg/SVGTextContentElement.h: 13 * svg/SVGTextPositioningElement.cpp: 14 (WebCore::SVGTextPositioningElement::elementFromRenderer): 15 * svg/SVGTextPositioningElement.h: 16 1 17 2010-09-30 MORITA Hajime <morrita@google.com> 2 18 -
trunk/WebCore/svg/SVGTextContentElement.cpp
r66397 r68867 27 27 #include "CSSValueKeywords.h" 28 28 #include "Frame.h" 29 #include "RenderObject.h" 29 30 #include "SVGTextQuery.h" 30 31 #include "SelectionController.h" … … 216 217 } 217 218 219 SVGTextContentElement* SVGTextContentElement::elementFromRenderer(RenderObject* renderer) 220 { 221 if (!renderer) 222 return 0; 223 224 if (!renderer->isSVGText() && !renderer->isSVGInline()) 225 return 0; 226 227 Node* node = renderer->node(); 228 ASSERT(node); 229 ASSERT(node->isSVGElement()); 230 231 if (!node->hasTagName(SVGNames::textTag) 232 && !node->hasTagName(SVGNames::tspanTag) 233 #if ENABLE(SVG_FONTS) 234 && !node->hasTagName(SVGNames::altGlyphTag) 235 #endif 236 && !node->hasTagName(SVGNames::trefTag) 237 && !node->hasTagName(SVGNames::textPathTag)) 238 return 0; 239 240 return static_cast<SVGTextContentElement*>(node); 241 } 242 218 243 } 219 244 -
trunk/WebCore/svg/SVGTextContentElement.h
r66397 r68867 55 55 bool isKnownAttribute(const QualifiedName&); 56 56 57 static SVGTextContentElement* elementFromRenderer(RenderObject*); 58 57 59 protected: 58 60 SVGTextContentElement(const QualifiedName&, Document*); -
trunk/WebCore/svg/SVGTextPositioningElement.cpp
r66397 r68867 144 144 } 145 145 146 SVGTextPositioningElement* SVGTextPositioningElement::elementFromRenderer(RenderObject* renderer) 147 { 148 if (!renderer) 149 return 0; 150 151 if (!renderer->isSVGText() && !renderer->isSVGInline()) 152 return 0; 153 154 Node* node = renderer->node(); 155 ASSERT(node); 156 ASSERT(node->isSVGElement()); 157 158 if (!node->hasTagName(SVGNames::textTag) 159 && !node->hasTagName(SVGNames::tspanTag) 160 #if ENABLE(SVG_FONTS) 161 && !node->hasTagName(SVGNames::altGlyphTag) 162 #endif 163 && !node->hasTagName(SVGNames::trefTag)) 164 return 0; 165 166 return static_cast<SVGTextPositioningElement*>(node); 167 } 168 169 146 170 } 147 171 -
trunk/WebCore/svg/SVGTextPositioningElement.h
r66397 r68867 30 30 31 31 class SVGTextPositioningElement : public SVGTextContentElement { 32 public: 33 static SVGTextPositioningElement* elementFromRenderer(RenderObject*); 34 32 35 protected: 33 36 SVGTextPositioningElement(const QualifiedName&, Document*);
Note: See TracChangeset
for help on using the changeset viewer.