Changeset 152524 in webkit
- Timestamp:
- Jul 9, 2013 10:31:50 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r152523 r152524 1 2013-07-09 Gyuyoung Kim <gyuyoung.kim@samsung.com> 2 3 Introduce isSVGFontElement() and isSVGImageElement(), use them 4 https://bugs.webkit.org/show_bug.cgi?id=118504 5 6 Reviewed by Benjamin Poulain. 7 8 Let's use isFoo() to enhance readibility in svg element classes along with html's. 9 10 No new tests, there is no behavior changes. 11 12 * loader/cache/CachedFont.cpp: 13 (WebCore::CachedFont::getSVGFontById): 14 * rendering/HitTestResult.cpp: 15 (WebCore::HitTestResult::absoluteImageURL): 16 * svg/SVGAnimateMotionElement.cpp: 17 (WebCore::SVGAnimateMotionElement::hasValidAttributeType): 18 * svg/SVGElement.cpp: 19 (WebCore::SVGElement::viewportElement): 20 * svg/SVGFontElement.cpp: 21 (WebCore::SVGFontElement::SVGFontElement): 22 * svg/SVGFontElement.h: 23 (WebCore::toSVGFontElement): 24 (WebCore::isSVGFontElement): 25 * svg/SVGFontFaceElement.cpp: 26 (WebCore::SVGFontFaceElement::associatedFontElement): 27 (WebCore::SVGFontFaceElement::rebuildFontFace): 28 * svg/SVGGlyphElement.cpp: 29 (WebCore::SVGGlyphElement::invalidateGlyphCache): 30 * svg/SVGHKernElement.cpp: 31 (WebCore::SVGHKernElement::insertedInto): 32 (WebCore::SVGHKernElement::removedFrom): 33 * svg/SVGImageElement.cpp: 34 (WebCore::SVGImageElement::SVGImageElement): 35 * svg/SVGImageElement.h: 36 (WebCore::toSVGImageElement): 37 (WebCore::isSVGImageElement): 38 * svg/SVGLocatable.cpp: 39 (WebCore::isViewportElement): 40 * svg/SVGVKernElement.cpp: 41 (WebCore::SVGVKernElement::insertedInto): 42 (WebCore::SVGVKernElement::removedFrom): 43 1 44 2013-07-09 Ryuan Choi <ryuan.choi@samsung.com> 2 45 -
trunk/Source/WebCore/loader/cache/CachedFont.cpp
r151586 r152524 146 146 for (unsigned i = 0; i < listLength; ++i) { 147 147 ASSERT(list->item(i)); 148 ASSERT( list->item(i)->hasTagName(SVGNames::fontTag));148 ASSERT(isSVGFontElement(list->item(i))); 149 149 } 150 150 #endif -
trunk/Source/WebCore/rendering/HitTestResult.cpp
r152238 r152524 48 48 49 49 #if ENABLE(SVG) 50 #include "SVGImageElement.h" 50 51 #include "SVGNames.h" 51 52 #include "XLinkNames.h" … … 322 323 || m_innerNonSharedNode->hasTagName(objectTag) 323 324 #if ENABLE(SVG) 324 || m_innerNonSharedNode->hasTagName(SVGNames::imageTag)325 || isSVGImageElement(m_innerNonSharedNode.get()) 325 326 #endif 326 327 ) { -
trunk/Source/WebCore/svg/SVGAnimateMotionElement.cpp
r152404 r152524 29 29 #include "RenderSVGResource.h" 30 30 #include "SVGElementInstance.h" 31 #include "SVGImageElement.h" 31 32 #include "SVGMPathElement.h" 32 33 #include "SVGNames.h" … … 70 71 || targetElement->hasTagName(defsTag) 71 72 || targetElement->hasTagName(useTag) 72 || targetElement->hasTagName(SVGNames::imageTag)73 || isSVGImageElement(targetElement) 73 74 || targetElement->hasTagName(switchTag) 74 75 || targetElement->hasTagName(pathTag) -
trunk/Source/WebCore/svg/SVGElement.cpp
r152404 r152524 39 39 #include "SVGElementRareData.h" 40 40 #include "SVGGraphicsElement.h" 41 #include "SVGImageElement.h" 41 42 #include "SVGNames.h" 42 43 #include "SVGSVGElement.h" … … 207 208 ContainerNode* n = parentOrShadowHostNode(); 208 209 while (n) { 209 if (n->hasTagName(SVGNames::svgTag) || n->hasTagName(SVGNames::imageTag) || n->hasTagName(SVGNames::symbolTag))210 if (n->hasTagName(SVGNames::svgTag) || isSVGImageElement(n) || n->hasTagName(SVGNames::symbolTag)) 210 211 return toSVGElement(n); 211 212 -
trunk/Source/WebCore/svg/SVGFontElement.h
r152491 r152524 91 91 }; 92 92 93 inline bool isSVGFontElement(const Node* node) 94 { 95 return node->hasTagName(SVGNames::fontTag); 96 } 97 93 98 inline SVGFontElement* toSVGFontElement(Node* node) 94 99 { 95 ASSERT_WITH_SECURITY_IMPLICATION(!node || node->hasTagName(SVGNames::fontTag));100 ASSERT_WITH_SECURITY_IMPLICATION(!node || isSVGFontElement(node)); 96 101 return static_cast<SVGFontElement*>(node); 97 102 } -
trunk/Source/WebCore/svg/SVGFontFaceElement.cpp
r152491 r152524 266 266 { 267 267 ASSERT(parentNode() == m_fontElement); 268 ASSERT(!parentNode() || parentNode()->hasTagName(SVGNames::fontTag));268 ASSERT(!parentNode() || isSVGFontElement(parentNode())); 269 269 return m_fontElement; 270 270 } … … 285 285 } 286 286 287 bool describesParentFont = parentNode()->hasTagName(SVGNames::fontTag);287 bool describesParentFont = isSVGFontElement(parentNode()); 288 288 RefPtr<CSSValueList> list; 289 289 -
trunk/Source/WebCore/svg/SVGGlyphElement.cpp
r152491 r152524 48 48 { 49 49 ContainerNode* fontNode = parentNode(); 50 if (fontNode && fontNode->hasTagName(SVGNames::fontTag))50 if (fontNode && isSVGFontElement(fontNode)) 51 51 toSVGFontElement(fontNode)->invalidateGlyphCache(); 52 52 } -
trunk/Source/WebCore/svg/SVGHKernElement.cpp
r152491 r152524 45 45 { 46 46 ContainerNode* fontNode = parentNode(); 47 if (fontNode && fontNode->hasTagName(SVGNames::fontTag))47 if (fontNode && isSVGFontElement(fontNode)) 48 48 toSVGFontElement(fontNode)->invalidateGlyphCache(); 49 49 … … 54 54 { 55 55 ContainerNode* fontNode = parentNode(); 56 if (fontNode && fontNode->hasTagName(SVGNames::fontTag))56 if (fontNode && isSVGFontElement(fontNode)) 57 57 toSVGFontElement(fontNode)->invalidateGlyphCache(); 58 58 -
trunk/Source/WebCore/svg/SVGImageElement.cpp
r152343 r152524 65 65 , m_imageLoader(this) 66 66 { 67 ASSERT( hasTagName(SVGNames::imageTag));67 ASSERT(isSVGImageElement(SVGNames::imageTag)); 68 68 registerAnimatedPropertiesForSVGImageElement(); 69 69 } -
trunk/Source/WebCore/svg/SVGImageElement.h
r152400 r152524 78 78 }; 79 79 80 inline bool isSVGImageElement(const Node* node) 81 { 82 return node->hasTagName(SVGNames::imageTag); 83 } 84 80 85 inline SVGImageElement* toSVGImageElement(Node* node) 81 86 { 82 ASSERT_WITH_SECURITY_IMPLICATION(!node || node->hasTagName(SVGNames::imageTag));87 ASSERT_WITH_SECURITY_IMPLICATION(!node || isSVGImageElement(node)); 83 88 return static_cast<SVGImageElement*>(node); 84 89 } -
trunk/Source/WebCore/svg/SVGLocatable.cpp
r152299 r152524 29 29 #include "SVGException.h" 30 30 #include "SVGGraphicsElement.h" 31 #include "SVGImageElement.h" 31 32 #include "SVGNames.h" 32 33 … … 38 39 || node->hasTagName(SVGNames::symbolTag) 39 40 || node->hasTagName(SVGNames::foreignObjectTag) 40 || node->hasTagName(SVGNames::imageTag));41 || isSVGImageElement(node)); 41 42 } 42 43 -
trunk/Source/WebCore/svg/SVGVKernElement.cpp
r152491 r152524 44 44 if (rootParent->inDocument()) { 45 45 ContainerNode* fontNode = parentNode(); 46 if (fontNode && fontNode->hasTagName(SVGNames::fontTag))46 if (fontNode && isSVGFontElement(fontNode)) 47 47 toSVGFontElement(fontNode)->invalidateGlyphCache(); 48 48 } … … 54 54 { 55 55 ContainerNode* fontNode = parentNode(); 56 if (fontNode && fontNode->hasTagName(SVGNames::fontTag))56 if (fontNode && isSVGFontElement(fontNode)) 57 57 toSVGFontElement(fontNode)->invalidateGlyphCache(); 58 58
Note: See TracChangeset
for help on using the changeset viewer.