Changeset 152343 in webkit


Ignore:
Timestamp:
Jul 3, 2013 1:03:53 AM (11 years ago)
Author:
Christophe Dumez
Message:

Move SVGTests attributes parsing to SVGGraphicsElement
https://bugs.webkit.org/show_bug.cgi?id=118292

Reviewed by Darin Adler.

Move SVGTests attributes parsing to SVGGraphicsElement instead of doing
this in each of its subclasses. SVGGraphicsElement is now the one
subclassing SVGTests after r152167.

No new tests, no behavior change.

  • svg/SVGAElement.cpp:

(WebCore::SVGAElement::isSupportedAttribute):
(WebCore::SVGAElement::parseAttribute):

  • svg/SVGCircleElement.cpp:

(WebCore::SVGCircleElement::isSupportedAttribute):
(WebCore::SVGCircleElement::parseAttribute):
(WebCore::SVGCircleElement::svgAttributeChanged):

  • svg/SVGClipPathElement.cpp:

(WebCore::SVGClipPathElement::isSupportedAttribute):
(WebCore::SVGClipPathElement::parseAttribute):

  • svg/SVGEllipseElement.cpp:

(WebCore::SVGEllipseElement::isSupportedAttribute):
(WebCore::SVGEllipseElement::parseAttribute):
(WebCore::SVGEllipseElement::svgAttributeChanged):

  • svg/SVGForeignObjectElement.cpp:

(WebCore::SVGForeignObjectElement::isSupportedAttribute):
(WebCore::SVGForeignObjectElement::parseAttribute):
(WebCore::SVGForeignObjectElement::svgAttributeChanged):

  • svg/SVGGElement.cpp:

(WebCore::SVGGElement::isSupportedAttribute):
(WebCore::SVGGElement::parseAttribute):
(WebCore::SVGGElement::svgAttributeChanged):

  • svg/SVGGraphicsElement.cpp:

(WebCore::SVGGraphicsElement::isSupportedAttribute):
(WebCore::SVGGraphicsElement::parseAttribute):
(WebCore::SVGGraphicsElement::svgAttributeChanged):

  • svg/SVGImageElement.cpp:

(WebCore::SVGImageElement::isSupportedAttribute):
(WebCore::SVGImageElement::parseAttribute):
(WebCore::SVGImageElement::svgAttributeChanged):

  • svg/SVGLineElement.cpp:

(WebCore::SVGLineElement::isSupportedAttribute):
(WebCore::SVGLineElement::parseAttribute):
(WebCore::SVGLineElement::svgAttributeChanged):

  • svg/SVGPathElement.cpp:

(WebCore::SVGPathElement::isSupportedAttribute):
(WebCore::SVGPathElement::parseAttribute):
(WebCore::SVGPathElement::svgAttributeChanged):

  • svg/SVGPolyElement.cpp:

(WebCore::SVGPolyElement::isSupportedAttribute):
(WebCore::SVGPolyElement::parseAttribute):
(WebCore::SVGPolyElement::svgAttributeChanged):

  • svg/SVGRectElement.cpp:

(WebCore::SVGRectElement::isSupportedAttribute):
(WebCore::SVGRectElement::parseAttribute):
(WebCore::SVGRectElement::svgAttributeChanged):

  • svg/SVGSVGElement.cpp:

(WebCore::SVGSVGElement::parseAttribute):
(WebCore::SVGSVGElement::svgAttributeChanged): Fall back to calling
SVGGraphicsElement::svgAttributeChanged() instead of
SVGStyledElement::svgAttributeChanged() as SVGGraphicsElement is the
parent class and it takes care of parsing SVGTests attributes now.

  • svg/SVGUseElement.cpp:

(WebCore::SVGUseElement::isSupportedAttribute):
(WebCore::SVGUseElement::parseAttribute):
(WebCore::SVGUseElement::svgAttributeChanged):

Location:
trunk/Source/WebCore
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r152337 r152343  
     12013-07-03  Christophe Dumez  <ch.dumez@sisa.samsung.com>
     2
     3        Move SVGTests attributes parsing to SVGGraphicsElement
     4        https://bugs.webkit.org/show_bug.cgi?id=118292
     5
     6        Reviewed by Darin Adler.
     7
     8        Move SVGTests attributes parsing to SVGGraphicsElement instead of doing
     9        this in each of its subclasses. SVGGraphicsElement is now the one
     10        subclassing SVGTests after r152167.
     11
     12        No new tests, no behavior change.
     13
     14        * svg/SVGAElement.cpp:
     15        (WebCore::SVGAElement::isSupportedAttribute):
     16        (WebCore::SVGAElement::parseAttribute):
     17        * svg/SVGCircleElement.cpp:
     18        (WebCore::SVGCircleElement::isSupportedAttribute):
     19        (WebCore::SVGCircleElement::parseAttribute):
     20        (WebCore::SVGCircleElement::svgAttributeChanged):
     21        * svg/SVGClipPathElement.cpp:
     22        (WebCore::SVGClipPathElement::isSupportedAttribute):
     23        (WebCore::SVGClipPathElement::parseAttribute):
     24        * svg/SVGEllipseElement.cpp:
     25        (WebCore::SVGEllipseElement::isSupportedAttribute):
     26        (WebCore::SVGEllipseElement::parseAttribute):
     27        (WebCore::SVGEllipseElement::svgAttributeChanged):
     28        * svg/SVGForeignObjectElement.cpp:
     29        (WebCore::SVGForeignObjectElement::isSupportedAttribute):
     30        (WebCore::SVGForeignObjectElement::parseAttribute):
     31        (WebCore::SVGForeignObjectElement::svgAttributeChanged):
     32        * svg/SVGGElement.cpp:
     33        (WebCore::SVGGElement::isSupportedAttribute):
     34        (WebCore::SVGGElement::parseAttribute):
     35        (WebCore::SVGGElement::svgAttributeChanged):
     36        * svg/SVGGraphicsElement.cpp:
     37        (WebCore::SVGGraphicsElement::isSupportedAttribute):
     38        (WebCore::SVGGraphicsElement::parseAttribute):
     39        (WebCore::SVGGraphicsElement::svgAttributeChanged):
     40        * svg/SVGImageElement.cpp:
     41        (WebCore::SVGImageElement::isSupportedAttribute):
     42        (WebCore::SVGImageElement::parseAttribute):
     43        (WebCore::SVGImageElement::svgAttributeChanged):
     44        * svg/SVGLineElement.cpp:
     45        (WebCore::SVGLineElement::isSupportedAttribute):
     46        (WebCore::SVGLineElement::parseAttribute):
     47        (WebCore::SVGLineElement::svgAttributeChanged):
     48        * svg/SVGPathElement.cpp:
     49        (WebCore::SVGPathElement::isSupportedAttribute):
     50        (WebCore::SVGPathElement::parseAttribute):
     51        (WebCore::SVGPathElement::svgAttributeChanged):
     52        * svg/SVGPolyElement.cpp:
     53        (WebCore::SVGPolyElement::isSupportedAttribute):
     54        (WebCore::SVGPolyElement::parseAttribute):
     55        (WebCore::SVGPolyElement::svgAttributeChanged):
     56        * svg/SVGRectElement.cpp:
     57        (WebCore::SVGRectElement::isSupportedAttribute):
     58        (WebCore::SVGRectElement::parseAttribute):
     59        (WebCore::SVGRectElement::svgAttributeChanged):
     60        * svg/SVGSVGElement.cpp:
     61        (WebCore::SVGSVGElement::parseAttribute):
     62        (WebCore::SVGSVGElement::svgAttributeChanged): Fall back to calling
     63        SVGGraphicsElement::svgAttributeChanged() instead of
     64        SVGStyledElement::svgAttributeChanged() as SVGGraphicsElement is the
     65        parent class and it takes care of parsing SVGTests attributes now.
     66        * svg/SVGUseElement.cpp:
     67        (WebCore::SVGUseElement::isSupportedAttribute):
     68        (WebCore::SVGUseElement::parseAttribute):
     69        (WebCore::SVGUseElement::svgAttributeChanged):
     70
    1712013-07-02  Ryosuke Niwa  <rniwa@webkit.org>
    272
  • trunk/Source/WebCore/svg/SVGAElement.cpp

    r152167 r152343  
    9393    if (supportedAttributes.isEmpty()) {
    9494        SVGURIReference::addSupportedAttributes(supportedAttributes);
    95         SVGTests::addSupportedAttributes(supportedAttributes);
    9695        SVGLangSpace::addSupportedAttributes(supportedAttributes);
    9796        SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes);
     
    114113
    115114    if (SVGURIReference::parseAttribute(name, value))
    116         return;
    117     if (SVGTests::parseAttribute(name, value))
    118115        return;
    119116    if (SVGLangSpace::parseAttribute(name, value))
  • trunk/Source/WebCore/svg/SVGCircleElement.cpp

    r152167 r152343  
    7070    DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
    7171    if (supportedAttributes.isEmpty()) {
    72         SVGTests::addSupportedAttributes(supportedAttributes);
    7372        SVGLangSpace::addSupportedAttributes(supportedAttributes);
    7473        SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes);
     
    9291    else if (name == SVGNames::rAttr)
    9392        setRBaseValue(SVGLength::construct(LengthModeOther, value, parseError, ForbidNegativeLengths));
    94     else if (SVGTests::parseAttribute(name, value)
    95              || SVGLangSpace::parseAttribute(name, value)
     93    else if (SVGLangSpace::parseAttribute(name, value)
    9694             || SVGExternalResourcesRequired::parseAttribute(name, value)) {
    9795    } else
     
    116114    if (isLengthAttribute)
    117115        updateRelativeLengthsInformation();
    118 
    119     if (SVGTests::handleAttributeChange(this, attrName))
    120         return;
    121116
    122117    RenderSVGShape* renderer = toRenderSVGShape(this->renderer());
  • trunk/Source/WebCore/svg/SVGClipPathElement.cpp

    r152167 r152343  
    6262    DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
    6363    if (supportedAttributes.isEmpty()) {
    64         SVGTests::addSupportedAttributes(supportedAttributes);
    6564        SVGLangSpace::addSupportedAttributes(supportedAttributes);
    6665        SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes);
     
    8483    }
    8584
    86     if (SVGTests::parseAttribute(name, value))
    87         return;
    8885    if (SVGLangSpace::parseAttribute(name, value))
    8986        return;
  • trunk/Source/WebCore/svg/SVGEllipseElement.cpp

    r152167 r152343  
    7171    DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
    7272    if (supportedAttributes.isEmpty()) {
    73         SVGTests::addSupportedAttributes(supportedAttributes);
    7473        SVGLangSpace::addSupportedAttributes(supportedAttributes);
    7574        SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes);
     
    9695    else if (name == SVGNames::ryAttr)
    9796        setRyBaseValue(SVGLength::construct(LengthModeHeight, value, parseError, ForbidNegativeLengths));
    98     else if (SVGTests::parseAttribute(name, value)
    99              || SVGLangSpace::parseAttribute(name, value)
     97    else if (SVGLangSpace::parseAttribute(name, value)
    10098             || SVGExternalResourcesRequired::parseAttribute(name, value)) {
    10199    } else
     
    121119    if (isLengthAttribute)
    122120        updateRelativeLengthsInformation();
    123  
    124     if (SVGTests::handleAttributeChange(this, attrName))
    125         return;
    126121
    127122    RenderSVGShape* renderer = toRenderSVGShape(this->renderer());
  • trunk/Source/WebCore/svg/SVGForeignObjectElement.cpp

    r152167 r152343  
    7474    DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
    7575    if (supportedAttributes.isEmpty()) {
    76         SVGTests::addSupportedAttributes(supportedAttributes);
    7776        SVGLangSpace::addSupportedAttributes(supportedAttributes);
    7877        SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes);
     
    9998    else if (name == SVGNames::heightAttr)
    10099        setHeightBaseValue(SVGLength::construct(LengthModeHeight, value, parseError));
    101     else if (SVGTests::parseAttribute(name, value)
    102                || SVGLangSpace::parseAttribute(name, value)
     100    else if (SVGLangSpace::parseAttribute(name, value)
    103101               || SVGExternalResourcesRequired::parseAttribute(name, value)) {
    104102    } else
     
    124122    if (isLengthAttribute)
    125123        updateRelativeLengthsInformation();
    126 
    127     if (SVGTests::handleAttributeChange(this, attrName))
    128         return;
    129124
    130125    if (RenderObject* renderer = this->renderer())
  • trunk/Source/WebCore/svg/SVGGElement.cpp

    r152167 r152343  
    5656    DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
    5757    if (supportedAttributes.isEmpty()) {
    58         SVGTests::addSupportedAttributes(supportedAttributes);
    5958        SVGLangSpace::addSupportedAttributes(supportedAttributes);
    6059        SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes);
     
    7069    }
    7170
    72     if (SVGTests::parseAttribute(name, value))
    73         return;
    7471    if (SVGLangSpace::parseAttribute(name, value))
    7572        return;
     
    8885
    8986    SVGElementInstance::InvalidationGuard invalidationGuard(this);
    90    
    91     if (SVGTests::handleAttributeChange(this, attrName))
    92         return;
    9387
    9488    if (RenderObject* renderer = this->renderer())
  • trunk/Source/WebCore/svg/SVGGraphicsElement.cpp

    r152299 r152343  
    9595{
    9696    DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
    97     if (supportedAttributes.isEmpty())
     97    if (supportedAttributes.isEmpty()) {
     98        SVGTests::addSupportedAttributes(supportedAttributes);
    9899        supportedAttributes.add(SVGNames::transformAttr);
     100    }
    99101    return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName);
    100102}
     
    115117    }
    116118
     119    if (SVGTests::parseAttribute(name, value))
     120        return;
     121
    117122    ASSERT_NOT_REACHED();
    118123}
     
    126131
    127132    SVGElementInstance::InvalidationGuard invalidationGuard(this);
     133
     134    if (SVGTests::handleAttributeChange(this, attrName))
     135        return;
    128136
    129137    RenderObject* object = renderer();
  • trunk/Source/WebCore/svg/SVGImageElement.cpp

    r152167 r152343  
    7878    DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
    7979    if (supportedAttributes.isEmpty()) {
    80         SVGTests::addSupportedAttributes(supportedAttributes);
    8180        SVGLangSpace::addSupportedAttributes(supportedAttributes);
    8281        SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes);
     
    126125    else if (name == SVGNames::heightAttr)
    127126        setHeightBaseValue(SVGLength::construct(LengthModeHeight, value, parseError, ForbidNegativeLengths));
    128     else if (SVGTests::parseAttribute(name, value)
    129              || SVGLangSpace::parseAttribute(name, value)
     127    else if (SVGLangSpace::parseAttribute(name, value)
    130128             || SVGExternalResourcesRequired::parseAttribute(name, value)
    131129             || SVGURIReference::parseAttribute(name, value)) {
     
    152150    if (isLengthAttribute)
    153151        updateRelativeLengthsInformation();
    154 
    155     if (SVGTests::handleAttributeChange(this, attrName))
    156         return;
    157152
    158153    if (SVGURIReference::isKnownAttribute(attrName)) {
  • trunk/Source/WebCore/svg/SVGLineElement.cpp

    r152167 r152343  
    7070    DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
    7171    if (supportedAttributes.isEmpty()) {
    72         SVGTests::addSupportedAttributes(supportedAttributes);
    7372        SVGLangSpace::addSupportedAttributes(supportedAttributes);
    7473        SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes);
     
    9594    else if (name == SVGNames::y2Attr)
    9695        setY2BaseValue(SVGLength::construct(LengthModeHeight, value, parseError));
    97     else if (SVGTests::parseAttribute(name, value)
    98              || SVGLangSpace::parseAttribute(name, value)
     96    else if (SVGLangSpace::parseAttribute(name, value)
    9997             || SVGExternalResourcesRequired::parseAttribute(name, value)) {
    10098    } else
     
    120118    if (isLengthAttribute)
    121119        updateRelativeLengthsInformation();
    122 
    123     if (SVGTests::handleAttributeChange(this, attrName))
    124         return;
    125120
    126121    RenderSVGShape* renderer = toRenderSVGShape(this->renderer());
  • trunk/Source/WebCore/svg/SVGPathElement.cpp

    r152167 r152343  
    209209    DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
    210210    if (supportedAttributes.isEmpty()) {
    211         SVGTests::addSupportedAttributes(supportedAttributes);
    212211        SVGLangSpace::addSupportedAttributes(supportedAttributes);
    213212        SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes);
     
    238237    }
    239238
    240     if (SVGTests::parseAttribute(name, value))
    241         return;
    242239    if (SVGLangSpace::parseAttribute(name, value))
    243240        return;
     
    256253
    257254    SVGElementInstance::InvalidationGuard invalidationGuard(this);
    258    
    259     if (SVGTests::handleAttributeChange(this, attrName))
    260         return;
    261255
    262256    RenderSVGPath* renderer = toRenderSVGPath(this->renderer());
  • trunk/Source/WebCore/svg/SVGPolyElement.cpp

    r152167 r152343  
    7070    DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
    7171    if (supportedAttributes.isEmpty()) {
    72         SVGTests::addSupportedAttributes(supportedAttributes);
    7372        SVGLangSpace::addSupportedAttributes(supportedAttributes);
    7473        SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes);
     
    9796    }
    9897
    99     if (SVGTests::parseAttribute(name, value))
    100         return;
    10198    if (SVGLangSpace::parseAttribute(name, value))
    10299        return;
     
    115112
    116113    SVGElementInstance::InvalidationGuard invalidationGuard(this);
    117    
    118     if (SVGTests::handleAttributeChange(this, attrName))
    119         return;
    120114
    121115    RenderSVGShape* renderer = toRenderSVGShape(this->renderer());
  • trunk/Source/WebCore/svg/SVGRectElement.cpp

    r152167 r152343  
    7676    DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
    7777    if (supportedAttributes.isEmpty()) {
    78         SVGTests::addSupportedAttributes(supportedAttributes);
    7978        SVGLangSpace::addSupportedAttributes(supportedAttributes);
    8079        SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes);
     
    107106    else if (name == SVGNames::heightAttr)
    108107        setHeightBaseValue(SVGLength::construct(LengthModeHeight, value, parseError, ForbidNegativeLengths));
    109     else if (SVGTests::parseAttribute(name, value)
    110              || SVGLangSpace::parseAttribute(name, value)
     108    else if (SVGLangSpace::parseAttribute(name, value)
    111109             || SVGExternalResourcesRequired::parseAttribute(name, value)) {
    112110    } else
     
    134132    if (isLengthAttribute)
    135133        updateRelativeLengthsInformation();
    136 
    137     if (SVGTests::handleAttributeChange(this, attrName))
    138         return;
    139134
    140135    RenderSVGShape* renderer = toRenderSVGShape(this->renderer());
  • trunk/Source/WebCore/svg/SVGSVGElement.cpp

    r152167 r152343  
    269269    else if (name == SVGNames::heightAttr)
    270270        setHeightBaseValue(SVGLength::construct(LengthModeHeight, value, parseError, ForbidNegativeLengths));
    271     else if (SVGTests::parseAttribute(name, value)
    272                || SVGLangSpace::parseAttribute(name, value)
     271    else if (SVGLangSpace::parseAttribute(name, value)
    273272               || SVGExternalResourcesRequired::parseAttribute(name, value)
    274273               || SVGFitToViewBox::parseAttribute(this, name, value)
     
    281280
    282281void SVGSVGElement::svgAttributeChanged(const QualifiedName& attrName)
    283 { 
     282{
    284283    bool updateRelativeLengthsOrViewBox = false;
    285284    bool widthChanged = attrName == SVGNames::widthAttr;
     
    307306
    308307    SVGElementInstance::InvalidationGuard invalidationGuard(this);
    309     if (SVGTests::handleAttributeChange(this, attrName))
    310         return;
    311308
    312309    if (updateRelativeLengthsOrViewBox
     
    319316    }
    320317
    321     SVGStyledElement::svgAttributeChanged(attrName);
     318    SVGGraphicsElement::svgAttributeChanged(attrName);
    322319}
    323320
  • trunk/Source/WebCore/svg/SVGUseElement.cpp

    r152167 r152343  
    136136    DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
    137137    if (supportedAttributes.isEmpty()) {
    138         SVGTests::addSupportedAttributes(supportedAttributes);
    139138        SVGLangSpace::addSupportedAttributes(supportedAttributes);
    140139        SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes);
     
    162161    else if (name == SVGNames::heightAttr)
    163162        setHeightBaseValue(SVGLength::construct(LengthModeHeight, value, parseError, ForbidNegativeLengths));
    164     else if (SVGTests::parseAttribute(name, value)
    165              || SVGLangSpace::parseAttribute(name, value)
     163    else if (SVGLangSpace::parseAttribute(name, value)
    166164             || SVGExternalResourcesRequired::parseAttribute(name, value)
    167165             || SVGURIReference::parseAttribute(name, value)) {
     
    238236        return;
    239237    }
    240 
    241     if (SVGTests::handleAttributeChange(this, attrName))
    242         return;
    243238
    244239    if (SVGExternalResourcesRequired::handleAttributeChange(this, attrName))
Note: See TracChangeset for help on using the changeset viewer.