Changeset 80362 in webkit


Ignore:
Timestamp:
Mar 4, 2011 9:38:24 AM (13 years ago)
Author:
Patrick Gansterer
Message:

2011-03-04 Patrick Gansterer <Patrick Gansterer>

Reviewed by Nikolas Zimmermann.

Move shared code into SVGStyledTransformableElement::svgAttributeChanged
https://bugs.webkit.org/show_bug.cgi?id=55771

All sub classes of SVGStyledTransformableElement request a relayout
the same way. So move that code into the common base class.

  • svg/SVGCircleElement.cpp: (WebCore::SVGCircleElement::svgAttributeChanged):
  • svg/SVGEllipseElement.cpp: (WebCore::SVGEllipseElement::svgAttributeChanged):
  • svg/SVGForeignObjectElement.cpp: (WebCore::SVGForeignObjectElement::svgAttributeChanged):
  • svg/SVGGElement.cpp: (WebCore::SVGGElement::svgAttributeChanged):
  • svg/SVGImageElement.cpp: (WebCore::SVGImageElement::svgAttributeChanged):
  • svg/SVGLineElement.cpp: (WebCore::SVGLineElement::svgAttributeChanged):
  • svg/SVGPathElement.cpp: (WebCore::SVGPathElement::svgAttributeChanged):
  • svg/SVGPolyElement.cpp: (WebCore::SVGPolyElement::svgAttributeChanged):
  • svg/SVGRectElement.cpp: (WebCore::SVGRectElement::svgAttributeChanged):
  • svg/SVGStyledTransformableElement.cpp: (WebCore::SVGStyledTransformableElement::svgAttributeChanged):
  • svg/SVGStyledTransformableElement.h:
  • svg/SVGUseElement.cpp: (WebCore::SVGUseElement::svgAttributeChanged):
Location:
trunk/Source/WebCore
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r80361 r80362  
     12011-03-04  Patrick Gansterer  <paroga@webkit.org>
     2
     3        Reviewed by Nikolas Zimmermann.
     4
     5        Move shared code into SVGStyledTransformableElement::svgAttributeChanged
     6        https://bugs.webkit.org/show_bug.cgi?id=55771
     7
     8        All sub classes of SVGStyledTransformableElement request a relayout
     9        the same way. So move that code into the common base class.
     10
     11        * svg/SVGCircleElement.cpp:
     12        (WebCore::SVGCircleElement::svgAttributeChanged):
     13        * svg/SVGEllipseElement.cpp:
     14        (WebCore::SVGEllipseElement::svgAttributeChanged):
     15        * svg/SVGForeignObjectElement.cpp:
     16        (WebCore::SVGForeignObjectElement::svgAttributeChanged):
     17        * svg/SVGGElement.cpp:
     18        (WebCore::SVGGElement::svgAttributeChanged):
     19        * svg/SVGImageElement.cpp:
     20        (WebCore::SVGImageElement::svgAttributeChanged):
     21        * svg/SVGLineElement.cpp:
     22        (WebCore::SVGLineElement::svgAttributeChanged):
     23        * svg/SVGPathElement.cpp:
     24        (WebCore::SVGPathElement::svgAttributeChanged):
     25        * svg/SVGPolyElement.cpp:
     26        (WebCore::SVGPolyElement::svgAttributeChanged):
     27        * svg/SVGRectElement.cpp:
     28        (WebCore::SVGRectElement::svgAttributeChanged):
     29        * svg/SVGStyledTransformableElement.cpp:
     30        (WebCore::SVGStyledTransformableElement::svgAttributeChanged):
     31        * svg/SVGStyledTransformableElement.h:
     32        * svg/SVGUseElement.cpp:
     33        (WebCore::SVGUseElement::svgAttributeChanged):
     34
    1352011-03-03  John Abd-El-Malek  <jam@chromium.org>
    236
  • trunk/Source/WebCore/svg/SVGCircleElement.cpp

    r78345 r80362  
    9191        return;
    9292
    93     if (SVGStyledTransformableElement::isKnownAttribute(attrName)) {
    94         renderer->setNeedsTransformUpdate();
    95         RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
    96         return;
    97     }
    98 
    9993    if (isLengthAttribute) {
    10094        renderer->setNeedsPathUpdate();
  • trunk/Source/WebCore/svg/SVGEllipseElement.cpp

    r78345 r80362  
    9898        return;
    9999
    100     if (SVGStyledTransformableElement::isKnownAttribute(attrName)) {
    101         renderer->setNeedsTransformUpdate();
    102         RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
    103         return;
    104     }
    105 
    106100    if (isLengthAttribute) {
    107101        renderer->setNeedsPathUpdate();
  • trunk/Source/WebCore/svg/SVGForeignObjectElement.cpp

    r78345 r80362  
    9797        return;
    9898
    99     if (SVGStyledTransformableElement::isKnownAttribute(attrName)) {
    100         renderer->setNeedsTransformUpdate();
    101         RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
    102         return;
    103     }
    104 
    10599    if (isLengthAttribute
    106100        || SVGLangSpace::isKnownAttribute(attrName)
  • trunk/Source/WebCore/svg/SVGGElement.cpp

    r79155 r80362  
    6767        return;
    6868
    69     if (SVGStyledTransformableElement::isKnownAttribute(attrName)) {
    70         renderer->setNeedsTransformUpdate();
    71         RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
    72         return;
    73     }
    74 
    7569    if (SVGLangSpace::isKnownAttribute(attrName)
    7670        || SVGExternalResourcesRequired::isKnownAttribute(attrName))
  • trunk/Source/WebCore/svg/SVGImageElement.cpp

    r78345 r80362  
    113113        return;
    114114
    115     if (SVGStyledTransformableElement::isKnownAttribute(attrName)) {
    116         renderer->setNeedsTransformUpdate();
    117         RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
    118         return;
    119     }
    120 
    121115    if (isLengthAttribute) {
    122116        renderer->updateFromElement();
  • trunk/Source/WebCore/svg/SVGLineElement.cpp

    r78345 r80362  
    9494        return;
    9595
    96     if (SVGStyledTransformableElement::isKnownAttribute(attrName)) {
    97         renderer->setNeedsTransformUpdate();
    98         RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
    99         return;
    100     }
    101 
    10296    if (isLengthAttribute) {
    10397        renderer->setNeedsPathUpdate();
  • trunk/Source/WebCore/svg/SVGPathElement.cpp

    r78345 r80362  
    231231        return;
    232232
    233     if (SVGStyledTransformableElement::isKnownAttribute(attrName)) {
    234         renderer->setNeedsTransformUpdate();
    235         RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
    236         return;
    237     }
    238 
    239233    if (attrName == SVGNames::pathLengthAttr
    240234        || SVGLangSpace::isKnownAttribute(attrName)
  • trunk/Source/WebCore/svg/SVGPolyElement.cpp

    r78345 r80362  
    7777        return;
    7878
    79     if (SVGStyledTransformableElement::isKnownAttribute(attrName)) {
    80         renderer->setNeedsTransformUpdate();
    81         RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
    82         return;
    83     }
    84 
    8579    if (attrName == SVGNames::pointsAttr) {
    8680        renderer->setNeedsPathUpdate();
  • trunk/Source/WebCore/svg/SVGRectElement.cpp

    r78345 r80362  
    111111        return;
    112112
    113     if (SVGStyledTransformableElement::isKnownAttribute(attrName)) {
    114         renderer->setNeedsTransformUpdate();
    115         RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
    116         return;
    117     }
    118 
    119113    if (isLengthAttribute) {
    120114        renderer->setNeedsPathUpdate();
  • trunk/Source/WebCore/svg/SVGStyledTransformableElement.cpp

    r78345 r80362  
    2727#include "Attribute.h"
    2828#include "RenderSVGPath.h"
     29#include "RenderSVGResource.h"
    2930#include "SVGNames.h"
    3031
     
    8182}
    8283
     84void SVGStyledTransformableElement::svgAttributeChanged(const QualifiedName& attrName)
     85{
     86    SVGStyledLocatableElement::svgAttributeChanged(attrName);
     87
     88    if (!SVGStyledTransformableElement::isKnownAttribute(attrName))
     89        return;
     90
     91    RenderObject* object = renderer();
     92    if (!object)
     93        return;
     94
     95    object->setNeedsTransformUpdate();
     96    RenderSVGResource::markForLayoutAndParentResourceInvalidation(object);
     97}
     98
    8399void SVGStyledTransformableElement::synchronizeProperty(const QualifiedName& attrName)
    84100{
  • trunk/Source/WebCore/svg/SVGStyledTransformableElement.h

    r78345 r80362  
    5959
    6060    virtual void parseMappedAttribute(Attribute*);
     61    virtual void svgAttributeChanged(const QualifiedName&);
    6162    virtual void synchronizeProperty(const QualifiedName&);
    6263    void fillPassedAttributeToPropertyTypeMap(AttributeToPropertyTypeMap&);
  • trunk/Source/WebCore/svg/SVGUseElement.cpp

    r79155 r80362  
    186186    }
    187187
    188     if (SVGStyledTransformableElement::isKnownAttribute(attrName)) {
    189         object->setNeedsTransformUpdate();
    190         RenderSVGResource::markForLayoutAndParentResourceInvalidation(object);
    191         return;
    192     }
    193 
    194188    if (SVGLangSpace::isKnownAttribute(attrName)
    195189        || SVGExternalResourcesRequired::isKnownAttribute(attrName))
Note: See TracChangeset for help on using the changeset viewer.