Changeset 152524 in webkit


Ignore:
Timestamp:
Jul 9, 2013 10:31:50 PM (11 years ago)
Author:
gyuyoung.kim@samsung.com
Message:

Introduce isSVGFontElement() and isSVGImageElement(), use them
https://bugs.webkit.org/show_bug.cgi?id=118504

Reviewed by Benjamin Poulain.

Let's use isFoo() to enhance readibility in svg element classes along with html's.

No new tests, there is no behavior changes.

  • loader/cache/CachedFont.cpp:

(WebCore::CachedFont::getSVGFontById):

  • rendering/HitTestResult.cpp:

(WebCore::HitTestResult::absoluteImageURL):

  • svg/SVGAnimateMotionElement.cpp:

(WebCore::SVGAnimateMotionElement::hasValidAttributeType):

  • svg/SVGElement.cpp:

(WebCore::SVGElement::viewportElement):

  • svg/SVGFontElement.cpp:

(WebCore::SVGFontElement::SVGFontElement):

  • svg/SVGFontElement.h:

(WebCore::toSVGFontElement):
(WebCore::isSVGFontElement):

  • svg/SVGFontFaceElement.cpp:

(WebCore::SVGFontFaceElement::associatedFontElement):
(WebCore::SVGFontFaceElement::rebuildFontFace):

  • svg/SVGGlyphElement.cpp:

(WebCore::SVGGlyphElement::invalidateGlyphCache):

  • svg/SVGHKernElement.cpp:

(WebCore::SVGHKernElement::insertedInto):
(WebCore::SVGHKernElement::removedFrom):

  • svg/SVGImageElement.cpp:

(WebCore::SVGImageElement::SVGImageElement):

  • svg/SVGImageElement.h:

(WebCore::toSVGImageElement):
(WebCore::isSVGImageElement):

  • svg/SVGLocatable.cpp:

(WebCore::isViewportElement):

  • svg/SVGVKernElement.cpp:

(WebCore::SVGVKernElement::insertedInto):
(WebCore::SVGVKernElement::removedFrom):

Location:
trunk/Source/WebCore
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r152523 r152524  
     12013-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
    1442013-07-09  Ryuan Choi  <ryuan.choi@samsung.com>
    245
  • trunk/Source/WebCore/loader/cache/CachedFont.cpp

    r151586 r152524  
    146146    for (unsigned i = 0; i < listLength; ++i) {
    147147        ASSERT(list->item(i));
    148         ASSERT(list->item(i)->hasTagName(SVGNames::fontTag));
     148        ASSERT(isSVGFontElement(list->item(i)));
    149149    }
    150150#endif
  • trunk/Source/WebCore/rendering/HitTestResult.cpp

    r152238 r152524  
    4848
    4949#if ENABLE(SVG)
     50#include "SVGImageElement.h"
    5051#include "SVGNames.h"
    5152#include "XLinkNames.h"
     
    322323        || m_innerNonSharedNode->hasTagName(objectTag)
    323324#if ENABLE(SVG)
    324         || m_innerNonSharedNode->hasTagName(SVGNames::imageTag)
     325        || isSVGImageElement(m_innerNonSharedNode.get())
    325326#endif
    326327       ) {
  • trunk/Source/WebCore/svg/SVGAnimateMotionElement.cpp

    r152404 r152524  
    2929#include "RenderSVGResource.h"
    3030#include "SVGElementInstance.h"
     31#include "SVGImageElement.h"
    3132#include "SVGMPathElement.h"
    3233#include "SVGNames.h"
     
    7071        || targetElement->hasTagName(defsTag)
    7172        || targetElement->hasTagName(useTag)
    72         || targetElement->hasTagName(SVGNames::imageTag)
     73        || isSVGImageElement(targetElement)
    7374        || targetElement->hasTagName(switchTag)
    7475        || targetElement->hasTagName(pathTag)
  • trunk/Source/WebCore/svg/SVGElement.cpp

    r152404 r152524  
    3939#include "SVGElementRareData.h"
    4040#include "SVGGraphicsElement.h"
     41#include "SVGImageElement.h"
    4142#include "SVGNames.h"
    4243#include "SVGSVGElement.h"
     
    207208    ContainerNode* n = parentOrShadowHostNode();
    208209    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))
    210211            return toSVGElement(n);
    211212
  • trunk/Source/WebCore/svg/SVGFontElement.h

    r152491 r152524  
    9191};
    9292
     93inline bool isSVGFontElement(const Node* node)
     94{
     95    return node->hasTagName(SVGNames::fontTag);
     96}
     97
    9398inline SVGFontElement* toSVGFontElement(Node* node)
    9499{
    95     ASSERT_WITH_SECURITY_IMPLICATION(!node || node->hasTagName(SVGNames::fontTag));
     100    ASSERT_WITH_SECURITY_IMPLICATION(!node || isSVGFontElement(node));
    96101    return static_cast<SVGFontElement*>(node);
    97102}
  • trunk/Source/WebCore/svg/SVGFontFaceElement.cpp

    r152491 r152524  
    266266{
    267267    ASSERT(parentNode() == m_fontElement);
    268     ASSERT(!parentNode() || parentNode()->hasTagName(SVGNames::fontTag));
     268    ASSERT(!parentNode() || isSVGFontElement(parentNode()));
    269269    return m_fontElement;
    270270}
     
    285285    }
    286286
    287     bool describesParentFont = parentNode()->hasTagName(SVGNames::fontTag);
     287    bool describesParentFont = isSVGFontElement(parentNode());
    288288    RefPtr<CSSValueList> list;
    289289
  • trunk/Source/WebCore/svg/SVGGlyphElement.cpp

    r152491 r152524  
    4848{
    4949    ContainerNode* fontNode = parentNode();
    50     if (fontNode && fontNode->hasTagName(SVGNames::fontTag))
     50    if (fontNode && isSVGFontElement(fontNode))
    5151        toSVGFontElement(fontNode)->invalidateGlyphCache();
    5252}
  • trunk/Source/WebCore/svg/SVGHKernElement.cpp

    r152491 r152524  
    4545{
    4646    ContainerNode* fontNode = parentNode();
    47     if (fontNode && fontNode->hasTagName(SVGNames::fontTag))
     47    if (fontNode && isSVGFontElement(fontNode))
    4848        toSVGFontElement(fontNode)->invalidateGlyphCache();
    4949
     
    5454{
    5555    ContainerNode* fontNode = parentNode();
    56     if (fontNode && fontNode->hasTagName(SVGNames::fontTag))
     56    if (fontNode && isSVGFontElement(fontNode))
    5757        toSVGFontElement(fontNode)->invalidateGlyphCache();
    5858
  • trunk/Source/WebCore/svg/SVGImageElement.cpp

    r152343 r152524  
    6565    , m_imageLoader(this)
    6666{
    67     ASSERT(hasTagName(SVGNames::imageTag));
     67    ASSERT(isSVGImageElement(SVGNames::imageTag));
    6868    registerAnimatedPropertiesForSVGImageElement();
    6969}
  • trunk/Source/WebCore/svg/SVGImageElement.h

    r152400 r152524  
    7878};
    7979
     80inline bool isSVGImageElement(const Node* node)
     81{
     82    return node->hasTagName(SVGNames::imageTag);
     83}
     84
    8085inline SVGImageElement* toSVGImageElement(Node* node)
    8186{
    82     ASSERT_WITH_SECURITY_IMPLICATION(!node || node->hasTagName(SVGNames::imageTag));
     87    ASSERT_WITH_SECURITY_IMPLICATION(!node || isSVGImageElement(node));
    8388    return static_cast<SVGImageElement*>(node);
    8489}
  • trunk/Source/WebCore/svg/SVGLocatable.cpp

    r152299 r152524  
    2929#include "SVGException.h"
    3030#include "SVGGraphicsElement.h"
     31#include "SVGImageElement.h"
    3132#include "SVGNames.h"
    3233
     
    3839        || node->hasTagName(SVGNames::symbolTag)
    3940        || node->hasTagName(SVGNames::foreignObjectTag)
    40         || node->hasTagName(SVGNames::imageTag));
     41        || isSVGImageElement(node));
    4142}
    4243
  • trunk/Source/WebCore/svg/SVGVKernElement.cpp

    r152491 r152524  
    4444    if (rootParent->inDocument()) {
    4545        ContainerNode* fontNode = parentNode();
    46         if (fontNode && fontNode->hasTagName(SVGNames::fontTag))
     46        if (fontNode && isSVGFontElement(fontNode))
    4747            toSVGFontElement(fontNode)->invalidateGlyphCache();
    4848    }
     
    5454{
    5555    ContainerNode* fontNode = parentNode();
    56     if (fontNode && fontNode->hasTagName(SVGNames::fontTag))
     56    if (fontNode && isSVGFontElement(fontNode))
    5757        toSVGFontElement(fontNode)->invalidateGlyphCache();
    5858
Note: See TracChangeset for help on using the changeset viewer.