Changeset 70979 in webkit


Ignore:
Timestamp:
Oct 30, 2010 6:23:55 AM (13 years ago)
Author:
Nikolas Zimmermann
Message:

2010-10-30 Nikolas Zimmermann <nzimmermann@rim.com>

Reviewed by Rob Buis.

Convert SVGAnimatedNumber/SVGAnimatedNumberList to the new SVGAnimatedPropertyTearOff concept
https://bugs.webkit.org/show_bug.cgi?id=48686

Convert the next set of primitives to use the new SVG(Animated)PropertyTearOff concept.

Tests: svg/dom/SVGAnimatedNumber.html

svg/dom/SVGAnimatedNumberList.html
svg/dom/SVGNumber.html

  • GNUmakefile.am: Add SVGAnimatedNumber.h / SVGAnimatedNumberList.h to build.
  • WebCore.gypi: Ditto.
  • WebCore.pro: Ditto.
  • WebCore.vcproj/WebCore.vcproj: Ditto.
  • WebCore.xcodeproj/project.pbxproj: Ditto.
  • bindings/scripts/CodeGenerator.pm: Recognize SVGAnimatedNumber/SVGAnimatedNumberList as new style SVG animated properties. Remove SVGNumber from PODType hash.
  • bindings/scripts/CodeGeneratorJS.pm: Remove special SVGNumber handing, it's obsolete now.
  • bindings/scripts/CodeGeneratorObjC.pm: Add special SVGNumber handling, as it's the first of the converted dynamic SVGAnimatedProperty types that's not in WebCore namespace.
  • bindings/scripts/CodeGeneratorV8.pm: Use AvoidInclusionOfType method from CodeGenerator.pm, remove special SVGNumber handling, that's obsolete now.
  • rendering/svg/SVGTextLayoutAttributesBuilder.cpp: (WebCore::extractFloatValuesFromSVGNumberList): Adapt to SVGNumberList change, which is a plain Vector<float> now.
  • svg/DeprecatedSVGAnimatedPropertyTraits.h: Remove SVGAnimatedNumber/SVGAnimatedNumberList handling.
  • svg/DeprecatedSVGAnimatedTemplate.h: Ditto.
  • svg/SVGAnimatedNumber.h: Added.
  • svg/SVGAnimatedNumber.idl: Enable StrictTypeChecking.
  • svg/SVGAnimatedNumberList.h: Added.
  • svg/SVGAnimatedNumberList.idl: Ditto.
  • svg/SVGComponentTransferFunctionElement.cpp: Switch animated float properties to the new SVGAnimatedNumber(List). (WebCore::SVGComponentTransferFunctionElement::SVGComponentTransferFunctionElement): (WebCore::SVGComponentTransferFunctionElement::parseMappedAttribute): (WebCore::SVGComponentTransferFunctionElement::transferFunction):
  • svg/SVGComponentTransferFunctionElement.h:
  • svg/SVGFEColorMatrixElement.cpp: Ditto. (WebCore::SVGFEColorMatrixElement::SVGFEColorMatrixElement): (WebCore::SVGFEColorMatrixElement::parseMappedAttribute): (WebCore::SVGFEColorMatrixElement::build):
  • svg/SVGFEColorMatrixElement.h:
  • svg/SVGFECompositeElement.h: Ditto.
  • svg/SVGFEConvolveMatrixElement.cpp: Ditto. (WebCore::SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement): (WebCore::SVGFEConvolveMatrixElement::kernelUnitLengthXIdentifier): Added, replacing char[] hack by a static atomic string. (WebCore::SVGFEConvolveMatrixElement::kernelUnitLengthYIdentifier): Ditto. (WebCore::SVGFEConvolveMatrixElement::parseMappedAttribute): (WebCore::SVGFEConvolveMatrixElement::build):
  • svg/SVGFEConvolveMatrixElement.h: Switch animated float properties to the new SVGAnimatedNumber(List).
  • svg/SVGFEDiffuseLightingElement.cpp: Ditto. (WebCore::SVGFEDiffuseLightingElement::kernelUnitLengthXIdentifier): Remove trailing whitespace. (WebCore::SVGFEDiffuseLightingElement::kernelUnitLengthYIdentifier): Ditto.
  • svg/SVGFEDiffuseLightingElement.h: Switch animated float properties to the new SVGAnimatedNumber(List).
  • svg/SVGFEDisplacementMapElement.h: Ditto.
  • svg/SVGFEGaussianBlurElement.cpp: Ditto. (WebCore::SVGFEGaussianBlurElement::stdDeviationXIdentifier): Remove trailing whitespace. (WebCore::SVGFEGaussianBlurElement::stdDeviationYIdentifier): Ditto.
  • svg/SVGFEGaussianBlurElement.h: Switch animated float properties to the new SVGAnimatedNumber(List).
  • svg/SVGFELightElement.h: Ditto.
  • svg/SVGFEMorphologyElement.cpp: (WebCore::SVGFEMorphologyElement::radiusXIdentifier): Added, replacing char[] hack by a static atomic string. (WebCore::SVGFEMorphologyElement::radiusYIdentifier): Ditto.
  • svg/SVGFEMorphologyElement.h: Switch animated float properties to the new SVGAnimatedNumber(List).
  • svg/SVGFEOffsetElement.h: Ditto.
  • svg/SVGFESpecularLightingElement.cpp: (WebCore::SVGFESpecularLightingElement::kernelUnitLengthXIdentifier): Remove trailing whitespace. (WebCore::SVGFESpecularLightingElement::kernelUnitLengthYIdentifier): Ditto.
  • svg/SVGFESpecularLightingElement.h: Switch animated float properties to the new SVGAnimatedNumber(List).
  • svg/SVGFETurbulenceElement.cpp: (WebCore::SVGFETurbulenceElement::baseFrequencyXIdentifier): Remove trailing whitespace. (WebCore::SVGFETurbulenceElement::baseFrequencyYIdentifier): Ditto.
  • svg/SVGFETurbulenceElement.h: Switch animated float properties to the new SVGAnimatedNumber(List).
  • svg/SVGFilterElement.cpp: (WebCore::SVGFilterElement::filterResXIdentifier): Remove trailing whitespace. (WebCore::SVGFilterElement::filterResYIdentifier): Ditto.
  • svg/SVGLengthList.idl: Remove leftover [SVGListProperty] marker.
  • svg/SVGMarkerElement.cpp: (WebCore::SVGMarkerElement::orientTypeIdentifier): Remove trailing whitespace. (WebCore::SVGMarkerElement::orientAngleIdentifier): Ditto.
  • svg/SVGNumber.idl: Remove [PODType] marker, add StrictTypeChecking.
  • svg/SVGNumberList.cpp: Convert from SVGPODList<RefPtr<SVGPODListItem<float> > > to plain Vector<float>, just like it has been done for SVGLengthList before. (WebCore::SVGNumberList::parse): (WebCore::SVGNumberList::valueAsString):
  • svg/SVGNumberList.h: (WebCore::SVGNumberList::SVGNumberList):
  • svg/SVGPathElement.h: Switch animated float properties to the new SVGAnimatedNumber(List).
  • svg/SVGStopElement.h: Ditto.
  • svg/SVGTextPositioningElement.cpp: Switch animated float properties to the new SVGAnimatedNumber(List). (WebCore::SVGTextPositioningElement::SVGTextPositioningElement): (WebCore::SVGTextPositioningElement::parseMappedAttribute):
  • svg/SVGTextPositioningElement.h: Ditto.
  • svg/properties/SVGPropertyTraits.h: Add SVGNumberList handling.

2010-10-30 Nikolas Zimmermann <nzimmermann@rim.com>

Reviewed by Rob Buis.

Convert SVGAnimatedNumber/SVGAnimatedNumberList to the new SVGAnimatedPropertyTearOff concept
https://bugs.webkit.org/show_bug.cgi?id=48686

Fix invalid tests in svg/dynamic-updates, that relied on a bug in our SVGNumberList implementation. If an item was already
inserted in a list, and we tried to insert it somewhere else, we didn't remove it from the old list. Now that SVGNumberList
has been switched to SVGAnimatedListPropertyTearOff, the bug is fixed, and it behaves exactly like SVGLengthList.

Side effect: svg/dynamic-updates/SVGFETurbulenceElement-svgdom-baseFrequency-prop.html now works as expected (dynamic update is executed)

  • platform/mac-leopard/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-baseFrequency-prop-expected.checksum:
  • platform/mac-leopard/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-baseFrequency-prop-expected.png:
  • svg/dom/SVGAnimatedNumber-expected.txt: Added.
  • svg/dom/SVGAnimatedNumber.html: Added.
  • svg/dom/SVGAnimatedNumberList-expected.txt: Added.
  • svg/dom/SVGAnimatedNumberList.html: Added.
  • svg/dom/SVGNumber-expected.txt: Added.
  • svg/dom/SVGNumber.html: Added.
  • svg/dom/script-tests/SVGAnimatedNumber.js: Added.
  • svg/dom/script-tests/SVGAnimatedNumberList.js: Added.
  • svg/dom/script-tests/SVGNumber.js: Added.
  • svg/dynamic-updates/script-tests/SVGFEColorMatrixElement-svgdom-type-prop.js: Test now works in Firefox as well. (executeTest): SVGNumber.value only accepts numbers, not strings, now that StrictTypeChecking is enabled.
  • svg/dynamic-updates/script-tests/SVGFEColorMatrixElement-svgdom-values-prop.js: Test now works in Firefox as well. (executeTest): Don't call appendItem several times with the same SVGNumber, it will be removed if it was already inserted in a list.
  • svg/dynamic-updates/script-tests/SVGFETurbulenceElement-svgdom-baseFrequency-prop.js:
Location:
trunk
Files:
10 added
50 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r70978 r70979  
     12010-10-30  Nikolas Zimmermann  <nzimmermann@rim.com>
     2
     3        Reviewed by Rob Buis.
     4
     5        Convert SVGAnimatedNumber/SVGAnimatedNumberList to the new SVGAnimatedPropertyTearOff concept
     6        https://bugs.webkit.org/show_bug.cgi?id=48686
     7
     8        Fix invalid tests in svg/dynamic-updates, that relied on a bug in our SVGNumberList implementation. If an item was already
     9        inserted in a list, and we tried to insert it somewhere else, we didn't remove it from the old list. Now that SVGNumberList
     10        has been switched to SVGAnimatedListPropertyTearOff, the bug is fixed, and it behaves exactly like SVGLengthList.
     11
     12        Side effect: svg/dynamic-updates/SVGFETurbulenceElement-svgdom-baseFrequency-prop.html now works as expected (dynamic update is executed)
     13
     14        * platform/mac-leopard/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-baseFrequency-prop-expected.checksum:
     15        * platform/mac-leopard/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-baseFrequency-prop-expected.png:
     16        * svg/dom/SVGAnimatedNumber-expected.txt: Added.
     17        * svg/dom/SVGAnimatedNumber.html: Added.
     18        * svg/dom/SVGAnimatedNumberList-expected.txt: Added.
     19        * svg/dom/SVGAnimatedNumberList.html: Added.
     20        * svg/dom/SVGNumber-expected.txt: Added.
     21        * svg/dom/SVGNumber.html: Added.
     22        * svg/dom/script-tests/SVGAnimatedNumber.js: Added.
     23        * svg/dom/script-tests/SVGAnimatedNumberList.js: Added.
     24        * svg/dom/script-tests/SVGNumber.js: Added.
     25        * svg/dynamic-updates/script-tests/SVGFEColorMatrixElement-svgdom-type-prop.js: Test now works in Firefox as well.
     26        (executeTest): SVGNumber.value only accepts numbers, not strings, now that StrictTypeChecking is enabled.
     27        * svg/dynamic-updates/script-tests/SVGFEColorMatrixElement-svgdom-values-prop.js: Test now works in Firefox as well.
     28        (executeTest): Don't call appendItem several times with the same SVGNumber, it will be removed if it was already inserted in a list.
     29        * svg/dynamic-updates/script-tests/SVGFETurbulenceElement-svgdom-baseFrequency-prop.js:
     30
    1312010-10-30  Nikolas Zimmermann  <nzimmermann@rim.com>
    232
  • trunk/LayoutTests/platform/mac-leopard/svg/dynamic-updates/SVGFETurbulenceElement-svgdom-baseFrequency-prop-expected.checksum

    r69230 r70979  
    1 1c199825420432255e0f64ba5c68374e
     10e9e0b9fa2fe65b56e30bc8d0b0f2f3c
  • trunk/LayoutTests/svg/dynamic-updates/script-tests/SVGFEColorMatrixElement-svgdom-type-prop.js

    r69409 r70979  
    172172    matrixElement.type.baseVal = SVGFEColorMatrixElement.SVG_FECOLORMATRIX_TYPE_MATRIX;
    173173
    174     var matrixArray = new Array("0.33", "0.33", "0.33", "0", "0", "0.33", "0.33", "0.33", "0", "0", "0.33", "0.33", "0.33", "0", "0", "0.33", "0.33", "0.33", "0", "0");
     174    var matrixArray = new Array(0.33, 0.33, 0.33, 0, 0, 0.33, 0.33, 0.33, 0, 0, 0.33, 0.33, 0.33, 0, 0, 0.33, 0.33, 0.33, 0, 0);
    175175    matrixElement.values.baseVal.clear();
    176     var number = rootSVGElement.createSVGNumber();
    177176    for (var i = 0; i < matrixArray.length; ++i) {
     177        var number = rootSVGElement.createSVGNumber();
    178178        number.value = matrixArray[i];
    179179        matrixElement.values.baseVal.appendItem(number, i);
     
    183183
    184184    hueRotateElement.type.baseVal = SVGFEColorMatrixElement.SVG_FECOLORMATRIX_TYPE_HUEROTATE;
     185    var number = rootSVGElement.createSVGNumber();
    185186    number.value = 90;
    186187    hueRotateElement.values.baseVal.appendItem(number, 0);
  • trunk/LayoutTests/svg/dynamic-updates/script-tests/SVGFEColorMatrixElement-svgdom-values-prop.js

    r69409 r70979  
    182182
    183183function executeTest() {
    184     var number = rootSVGElement.createSVGNumber();
    185 
    186     number.value = 0.33;
    187     matrixElement.values.baseVal.replaceItem(number, 0);
    188     matrixElement.values.baseVal.replaceItem(number, 1);
    189     matrixElement.values.baseVal.replaceItem(number, 2);
    190 
    191     number.value = 0.25;
    192     saturateElement.values.baseVal.replaceItem(number, 0);
    193 
    194     number.value = 90;
    195     hueRotateElement.values.baseVal.replaceItem(number, 0);
     184    var number1 = rootSVGElement.createSVGNumber();
     185    number1.value = 0.33;
     186    matrixElement.values.baseVal.replaceItem(number1, 0);
     187
     188    var number2 = rootSVGElement.createSVGNumber();
     189    number2.value = 0.33;
     190    matrixElement.values.baseVal.replaceItem(number2, 1);
     191
     192    var number3 = rootSVGElement.createSVGNumber();
     193    number3.value = 0.33;
     194    matrixElement.values.baseVal.replaceItem(number3, 2);
     195
     196    var number4 = rootSVGElement.createSVGNumber();
     197    number4.value = 0.25;
     198    saturateElement.values.baseVal.replaceItem(number4, 0);
     199
     200    var number5 = rootSVGElement.createSVGNumber();
     201    number5.value = 90;
     202    hueRotateElement.values.baseVal.replaceItem(number5, 0);
    196203
    197204    shouldBeEqualToString("SVGNumberListToString(matrixElement.values.baseVal)", "0.33 0.33 0.33 0 0 0.33 0.33 0.33 0 0 0.33 0.33 0.33 0 0 0.33 0.33 0.33 0 0 ");
  • trunk/LayoutTests/svg/dynamic-updates/script-tests/SVGFETurbulenceElement-svgdom-baseFrequency-prop.js

    r67544 r70979  
    3232rootSVGElement.appendChild(rectElement);
    3333
    34 <!-- We should multiply and round the value of baseFrequency otherwise the expected value cannot be precisely represented as a floating point number and the comparison will fail.-->
     34// We should multiply and round the value of baseFrequency otherwise the expected value cannot be precisely represented as a floating point number and the comparison will fail.
    3535shouldBe("Math.round(turbulence.baseFrequencyX.baseVal * 1000)", "70");
    3636shouldBe("Math.round(turbulence.baseFrequencyY.baseVal * 1000)", "70");
  • trunk/WebCore/ChangeLog

    r70976 r70979  
     12010-10-30  Nikolas Zimmermann  <nzimmermann@rim.com>
     2
     3        Reviewed by Rob Buis.
     4
     5        Convert SVGAnimatedNumber/SVGAnimatedNumberList to the new SVGAnimatedPropertyTearOff concept
     6        https://bugs.webkit.org/show_bug.cgi?id=48686
     7
     8        Convert the next set of primitives to use the new SVG(Animated)PropertyTearOff concept.
     9
     10        Tests: svg/dom/SVGAnimatedNumber.html
     11               svg/dom/SVGAnimatedNumberList.html
     12               svg/dom/SVGNumber.html
     13
     14        * GNUmakefile.am: Add SVGAnimatedNumber.h / SVGAnimatedNumberList.h to build.
     15        * WebCore.gypi: Ditto.
     16        * WebCore.pro: Ditto.
     17        * WebCore.vcproj/WebCore.vcproj: Ditto.
     18        * WebCore.xcodeproj/project.pbxproj: Ditto.
     19        * bindings/scripts/CodeGenerator.pm: Recognize SVGAnimatedNumber/SVGAnimatedNumberList as new style SVG animated properties. Remove SVGNumber from PODType hash.
     20        * bindings/scripts/CodeGeneratorJS.pm: Remove special SVGNumber handing, it's obsolete now.
     21        * bindings/scripts/CodeGeneratorObjC.pm: Add special SVGNumber handling, as it's the first of the converted dynamic SVGAnimatedProperty types that's not in WebCore namespace.
     22        * bindings/scripts/CodeGeneratorV8.pm: Use AvoidInclusionOfType method from CodeGenerator.pm, remove special SVGNumber handling, that's obsolete now.
     23        * rendering/svg/SVGTextLayoutAttributesBuilder.cpp:
     24        (WebCore::extractFloatValuesFromSVGNumberList): Adapt to SVGNumberList change, which is a plain Vector<float> now.
     25        * svg/DeprecatedSVGAnimatedPropertyTraits.h: Remove SVGAnimatedNumber/SVGAnimatedNumberList handling.
     26        * svg/DeprecatedSVGAnimatedTemplate.h: Ditto.
     27        * svg/SVGAnimatedNumber.h: Added.
     28        * svg/SVGAnimatedNumber.idl: Enable StrictTypeChecking.
     29        * svg/SVGAnimatedNumberList.h: Added.
     30        * svg/SVGAnimatedNumberList.idl: Ditto.
     31        * svg/SVGComponentTransferFunctionElement.cpp: Switch animated float properties to the new SVGAnimatedNumber(List).
     32        (WebCore::SVGComponentTransferFunctionElement::SVGComponentTransferFunctionElement):
     33        (WebCore::SVGComponentTransferFunctionElement::parseMappedAttribute):
     34        (WebCore::SVGComponentTransferFunctionElement::transferFunction):
     35        * svg/SVGComponentTransferFunctionElement.h:
     36        * svg/SVGFEColorMatrixElement.cpp: Ditto.
     37        (WebCore::SVGFEColorMatrixElement::SVGFEColorMatrixElement):
     38        (WebCore::SVGFEColorMatrixElement::parseMappedAttribute):
     39        (WebCore::SVGFEColorMatrixElement::build):
     40        * svg/SVGFEColorMatrixElement.h:
     41        * svg/SVGFECompositeElement.h: Ditto.
     42        * svg/SVGFEConvolveMatrixElement.cpp: Ditto.
     43        (WebCore::SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement):
     44        (WebCore::SVGFEConvolveMatrixElement::kernelUnitLengthXIdentifier): Added, replacing char[] hack by a static atomic string.
     45        (WebCore::SVGFEConvolveMatrixElement::kernelUnitLengthYIdentifier): Ditto.
     46        (WebCore::SVGFEConvolveMatrixElement::parseMappedAttribute):
     47        (WebCore::SVGFEConvolveMatrixElement::build):
     48        * svg/SVGFEConvolveMatrixElement.h: Switch animated float properties to the new SVGAnimatedNumber(List).
     49        * svg/SVGFEDiffuseLightingElement.cpp: Ditto.
     50        (WebCore::SVGFEDiffuseLightingElement::kernelUnitLengthXIdentifier): Remove trailing whitespace.
     51        (WebCore::SVGFEDiffuseLightingElement::kernelUnitLengthYIdentifier): Ditto.
     52        * svg/SVGFEDiffuseLightingElement.h: Switch animated float properties to the new SVGAnimatedNumber(List).
     53        * svg/SVGFEDisplacementMapElement.h: Ditto.
     54        * svg/SVGFEGaussianBlurElement.cpp: Ditto.
     55        (WebCore::SVGFEGaussianBlurElement::stdDeviationXIdentifier): Remove trailing whitespace.
     56        (WebCore::SVGFEGaussianBlurElement::stdDeviationYIdentifier): Ditto.
     57        * svg/SVGFEGaussianBlurElement.h: Switch animated float properties to the new SVGAnimatedNumber(List).
     58        * svg/SVGFELightElement.h: Ditto.
     59        * svg/SVGFEMorphologyElement.cpp:
     60        (WebCore::SVGFEMorphologyElement::radiusXIdentifier): Added, replacing char[] hack by a static atomic string.
     61        (WebCore::SVGFEMorphologyElement::radiusYIdentifier): Ditto.
     62        * svg/SVGFEMorphologyElement.h: Switch animated float properties to the new SVGAnimatedNumber(List).
     63        * svg/SVGFEOffsetElement.h: Ditto.
     64        * svg/SVGFESpecularLightingElement.cpp:
     65        (WebCore::SVGFESpecularLightingElement::kernelUnitLengthXIdentifier): Remove trailing whitespace.
     66        (WebCore::SVGFESpecularLightingElement::kernelUnitLengthYIdentifier): Ditto.
     67        * svg/SVGFESpecularLightingElement.h: Switch animated float properties to the new SVGAnimatedNumber(List).
     68        * svg/SVGFETurbulenceElement.cpp:
     69        (WebCore::SVGFETurbulenceElement::baseFrequencyXIdentifier): Remove trailing whitespace.
     70        (WebCore::SVGFETurbulenceElement::baseFrequencyYIdentifier): Ditto.
     71        * svg/SVGFETurbulenceElement.h: Switch animated float properties to the new SVGAnimatedNumber(List).
     72        * svg/SVGFilterElement.cpp:
     73        (WebCore::SVGFilterElement::filterResXIdentifier): Remove trailing whitespace.
     74        (WebCore::SVGFilterElement::filterResYIdentifier): Ditto.
     75        * svg/SVGLengthList.idl: Remove leftover [SVGListProperty] marker.
     76        * svg/SVGMarkerElement.cpp:
     77        (WebCore::SVGMarkerElement::orientTypeIdentifier): Remove trailing whitespace.
     78        (WebCore::SVGMarkerElement::orientAngleIdentifier): Ditto.
     79        * svg/SVGNumber.idl: Remove [PODType] marker, add StrictTypeChecking.
     80        * svg/SVGNumberList.cpp: Convert from SVGPODList<RefPtr<SVGPODListItem<float> > > to plain Vector<float>, just like it has been done for SVGLengthList before.
     81        (WebCore::SVGNumberList::parse):
     82        (WebCore::SVGNumberList::valueAsString):
     83        * svg/SVGNumberList.h:
     84        (WebCore::SVGNumberList::SVGNumberList):
     85        * svg/SVGPathElement.h: Switch animated float properties to the new SVGAnimatedNumber(List).
     86        * svg/SVGStopElement.h: Ditto.
     87        * svg/SVGTextPositioningElement.cpp: Switch animated float properties to the new SVGAnimatedNumber(List).
     88        (WebCore::SVGTextPositioningElement::SVGTextPositioningElement):
     89        (WebCore::SVGTextPositioningElement::parseMappedAttribute):
     90        * svg/SVGTextPositioningElement.h: Ditto.
     91        * svg/properties/SVGPropertyTraits.h: Add SVGNumberList handling.
     92
    1932010-10-29  Daniel Bates  <dbates@rim.com>
    294
  • trunk/WebCore/GNUmakefile.am

    r70970 r70979  
    30543054        WebCore/svg/SVGAnimatedLength.h \
    30553055        WebCore/svg/SVGAnimatedLengthList.h \
     3056        WebCore/svg/SVGAnimatedNumber.h \
     3057        WebCore/svg/SVGAnimatedNumberList.h \
    30563058        WebCore/svg/SVGAnimatedPathData.cpp \
    30573059        WebCore/svg/SVGAnimatedPathData.h \
  • trunk/WebCore/WebCore.gypi

    r70970 r70979  
    39873987            'svg/SVGAnimatedLength.h',
    39883988            'svg/SVGAnimatedLengthList.h',
     3989            'svg/SVGAnimatedNumber.h',
     3990            'svg/SVGAnimatedNumberList.h',
    39893991            'svg/SVGAnimatedPathData.cpp',
    39903992            'svg/SVGAnimatedPathData.h',
  • trunk/WebCore/WebCore.pro

    r70970 r70979  
    23792379    svg/SVGAnimatedLength.h \
    23802380    svg/SVGAnimatedLengthList.h \
     2381    svg/SVGAnimatedNumber.h \
     2382    svg/SVGAnimatedNumberList.h \
    23812383    svg/SVGAnimatedPathData.h \
    23822384    svg/SVGAnimatedPoints.h \
  • trunk/WebCore/WebCore.vcproj/WebCore.vcproj

    r70970 r70979  
    6159361593                        </File>
    6159461594                        <File
     61595                                RelativePath="..\svg\SVGAnimatedNumber.h"
     61596                                >
     61597                        </File>
     61598                        <File
     61599                                RelativePath="..\svg\SVGAnimatedNumberList.h"
     61600                                >
     61601                        </File>
     61602                        <File
    6159561603                                RelativePath="..\svg\SVGAnimatedPathData.h"
    6159661604                                >
  • trunk/WebCore/WebCore.xcodeproj/project.pbxproj

    r70970 r70979  
    214214                08A484780E5272C500C3FE76 /* ScriptElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 08A484760E5272C500C3FE76 /* ScriptElement.h */; };
    215215                08A48A6E0E86CF6D00E225DD /* JSSVGElementInstanceCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08A48A6D0E86CF6D00E225DD /* JSSVGElementInstanceCustom.cpp */; };
     216                08B35B13127B6A7C005314DD /* SVGAnimatedNumber.h in Headers */ = {isa = PBXBuildFile; fileRef = 08B35B12127B6A7C005314DD /* SVGAnimatedNumber.h */; settings = {ATTRIBUTES = (Private, ); }; };
     217                08B35B17127B6A88005314DD /* SVGAnimatedNumberList.h in Headers */ = {isa = PBXBuildFile; fileRef = 08B35B16127B6A88005314DD /* SVGAnimatedNumberList.h */; settings = {ATTRIBUTES = (Private, ); }; };
    216218                08C34AF51179C057002D7456 /* RenderSVGResourceGradient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08C34AF11179C056002D7456 /* RenderSVGResourceGradient.cpp */; };
    217219                08C34AF61179C057002D7456 /* RenderSVGResourceGradient.h in Headers */ = {isa = PBXBuildFile; fileRef = 08C34AF21179C057002D7456 /* RenderSVGResourceGradient.h */; };
     
    62226224                08A484760E5272C500C3FE76 /* ScriptElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptElement.h; sourceTree = "<group>"; };
    62236225                08A48A6D0E86CF6D00E225DD /* JSSVGElementInstanceCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGElementInstanceCustom.cpp; sourceTree = "<group>"; };
     6226                08B35B12127B6A7C005314DD /* SVGAnimatedNumber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedNumber.h; sourceTree = "<group>"; };
     6227                08B35B16127B6A88005314DD /* SVGAnimatedNumberList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedNumberList.h; sourceTree = "<group>"; };
    62246228                08C34AF11179C056002D7456 /* RenderSVGResourceGradient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGResourceGradient.cpp; sourceTree = "<group>"; };
    62256229                08C34AF21179C057002D7456 /* RenderSVGResourceGradient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGResourceGradient.h; sourceTree = "<group>"; };
     
    1601516019                                089021AC126EF5E90092D5EA /* SVGAnimatedLengthList.h */,
    1601616020                                B22277EB0D00BF1F0071B782 /* SVGAnimatedLengthList.idl */,
     16021                                08B35B12127B6A7C005314DD /* SVGAnimatedNumber.h */,
    1601716022                                B22277EC0D00BF1F0071B782 /* SVGAnimatedNumber.idl */,
     16023                                08B35B16127B6A88005314DD /* SVGAnimatedNumberList.h */,
    1601816024                                B22277ED0D00BF1F0071B782 /* SVGAnimatedNumberList.idl */,
    1601916025                                B22277EE0D00BF1F0071B782 /* SVGAnimatedPathData.cpp */,
     
    2123221238                                08D46CE3127AD5FC0089694B /* SVGAnimatedEnumeration.h in Headers */,
    2123321239                                0823D159127AD6AC000EBC95 /* SVGAnimatedInteger.h in Headers */,
     21240                                08B35B13127B6A7C005314DD /* SVGAnimatedNumber.h in Headers */,
     21241                                08B35B17127B6A88005314DD /* SVGAnimatedNumberList.h in Headers */,
    2123421242                        );
    2123521243                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/WebCore/bindings/scripts/CodeGenerator.pm

    r70872 r70979  
    5151my %primitiveTypeHash = ( "boolean" => 1, "void" => 1, "Date" => 1);
    5252
    53 my %podTypeHash = ("SVGNumber" => 1, "SVGTransform" => 1);
     53my %podTypeHash = ("SVGTransform" => 1);
    5454my %podTypesWithWritablePropertiesHash = ("SVGMatrix" => 1, "SVGPoint" => 1, "SVGPreserveAspectRatio" => 1);
    5555my %stringTypeHash = ("DOMString" => 1, "AtomicString" => 1);
     
    6060                                   "SVGAnimatedEnumeration" => 1, "SVGAnimatedInteger" => 1,
    6161                                   "SVGAnimatedLength" => 1, "SVGAnimatedLengthList" => 1,
     62                                   "SVGAnimatedNumber" => 1, "SVGAnimatedNumberList" => 1,
    6263                                   "SVGAnimatedRect" => 1);
    6364
     
    8081    "SVGLength" => "SVGPropertyTearOff<SVGLength>",
    8182    "SVGLengthList" => "SVGListPropertyTearOff<SVGLengthList>",
     83    "SVGNumber" => "SVGPropertyTearOff<float>",
     84    "SVGNumberList" => "SVGListPropertyTearOff<SVGNumberList>",
    8285    "SVGRect" => "SVGPropertyTearOff<FloatRect>"
    8386);
  • trunk/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r70918 r70979  
    24562456    "IDBKey" => "RefPtr<IDBKey>",
    24572457    "SVGMatrix" => "AffineTransform",
    2458     "SVGNumber" => "float",
    24592458    "SVGPaintType" => "SVGPaint::SVGPaintType",
    24602459    "SVGPreserveAspectRatio" => "SVGPreserveAspectRatio",
     
    25292528    return "$value.toBoolean(exec)" if $type eq "boolean";
    25302529    return "$value.toNumber(exec)" if $type eq "double";
    2531     return "$value.toFloat(exec)" if $type eq "float" or $type eq "SVGNumber";
     2530    return "$value.toFloat(exec)" if $type eq "float";
    25322531    return "$value.toInt32(exec)" if $type eq "long";
    25332532    return "$value.toUInt32(exec)" if $type eq "unsigned long" or $type eq "unsigned short";
  • trunk/WebCore/bindings/scripts/CodeGeneratorObjC.pm

    r70918 r70979  
    614614    }
    615615
    616     if ($type eq "SVGNumber") {
    617         $implIncludes{"DOMSVGNumberInternal.h"} = 1;
    618         return;
    619     }
    620 
    621616    if ($type =~ /(\w+)(Abs|Rel)$/) {
    622617        $implIncludes{"$1.h"} = 1;
     
    657652}
    658653
     654sub GetSVGTypeWithNamespace
     655{
     656    my $type = shift;
     657    my $typeWithNamespace = "WebCore::" . $codeGenerator->GetSVGTypeNeedingTearOff($type);
     658
     659    # Special case for DOMSVGNumber
     660    $typeWithNamespace =~ s/</\<WebCore::/ unless $type eq "SVGNumber";
     661    return $typeWithNamespace;
     662}
     663
    659664sub GetSVGPropertyTypes
    660665{
     
    672677    # Append space to avoid compilation errors when using  PassRefPtr<$svgNativeType>
    673678    $svgNativeType = "WebCore::$svgNativeType ";
    674     $svgNativeType =~ s/</\<WebCore::/;
     679    $svgNativeType =~ s/</\<WebCore::/ if not $svgNativeType =~ /float/;
    675680
    676681    my $svgWrappedNativeType = $codeGenerator->GetSVGWrappedTypeNeedingTearOff($implType);
    677682    if ($svgNativeType =~ /SVGPropertyTearOff/) {
    678         $svgPropertyType = "WebCore::$svgWrappedNativeType";
    679         $svgPropertyType =~ s/</\<WebCore::/;
     683        if ($svgWrappedNativeType eq "float") {
     684            # Special case for DOMSVGNumber
     685            $svgPropertyType = $svgWrappedNativeType;
     686        } else {
     687            $svgPropertyType = "WebCore::$svgWrappedNativeType";
     688            $svgPropertyType =~ s/</\<WebCore::/;
     689        }
    680690    } elsif ($svgNativeType =~ /SVGListPropertyTearOff/) {
    681691        $svgListPropertyType = "WebCore::$svgWrappedNativeType";
     
    12381248                if ($svgPropertyType eq "WebCore::SVGLength" and $attributeName eq "value") {
    12391249                    $getterContentHead = "value(0 /* FIXME */";
    1240                 }
    1241             } else {
    1242                 # Special case for DOMSVGNumber
    1243                 if ($podType and $podType eq "float") {
    1244                     $getterContentHead = "*IMPL";
    1245                     $getterContentTail = "";
    12461250                }
    12471251            }
     
    12881292                $getterContentTail .= ")";
    12891293            } elsif ($svgPropertyType) {
    1290                 $getterContentHead = "IMPL->propertyReference().$getterContentHead";
     1294                # Special case for DOMSVGNumber
     1295                if ($svgPropertyType eq "float") {
     1296                    # Intentional leave out closing brace, it's already contained in getterContentTail
     1297                    $getterContentHead = "IMPL->propertyReference(";
     1298                } else {   
     1299                    $getterContentHead = "IMPL->propertyReference().$getterContentHead";
     1300                }
    12911301            } elsif ($codeGenerator->IsSVGNewStyleAnimatedType($implClassName) and $codeGenerator->IsSVGTypeNeedingTearOff($idlType)) {
    1292                 my $idlTypeWithNamespace = "WebCore::" . $codeGenerator->GetSVGTypeNeedingTearOff($idlType);
    1293                 $idlTypeWithNamespace =~ s/</\<WebCore::/;
     1302                my $idlTypeWithNamespace = GetSVGTypeWithNamespace($idlType);
    12941303                $getterContentHead = "kit(static_cast<$idlTypeWithNamespace*>($getterContentHead)";
    12951304                $getterContentTail .= ")";
     
    13051314            } elsif (ConversionNeeded($attribute->signature->type)) {
    13061315                if ($codeGenerator->IsSVGTypeNeedingTearOff($attribute->signature->type) and not $implClassName =~ /List$/) {
    1307                     my $idlType = $attribute->signature->type;
    1308                     my $idlTypeWithNamespace = "WebCore::" . $codeGenerator->GetSVGTypeNeedingTearOff($idlType);
    1309                     $idlTypeWithNamespace =~ s/</\<WebCore::/;
     1316                    my $idlTypeWithNamespace = GetSVGTypeWithNamespace($attribute->signature->type);
    13101317                    $getterContentHead = "kit(WTF::getPtr(${idlTypeWithNamespace}::create($getterContentHead";
    13111318                    $getterContentTail .= ")))";
     
    13821389                    my $ec = $hasSetterException ? ", ec" : "";
    13831390                    push(@implContent, "    $exceptionInit\n") if $hasSetterException;
    1384                     push(@implContent, "    podImpl.$coreSetterName($arg$ec);\n");
     1391
     1392                    # Special case for DOMSVGNumber
     1393                    if ($svgPropertyType eq "float") {
     1394                        push(@implContent, "    podImpl = $arg;\n");
     1395                    } else {
     1396                        push(@implContent, "    podImpl.$coreSetterName($arg$ec);\n");
     1397                    }
     1398
    13851399                    if ($hasSetterException) {
    13861400                        push(@implContent, "    if (!ec)\n");
     
    13941408                    push(@implContent, "    IMPL->$coreSetterName($arg);\n");
    13951409                } elsif ($podType) {
    1396                     # Special case for DOMSVGNumber
    1397                     if ($podType eq "float") {
    1398                         push(@implContent, "    *IMPL = $arg;\n");
    1399                     } else {
    1400                         push(@implContent, "    IMPL->$coreSetterName($arg);\n");
    1401                     }
     1410                    push(@implContent, "    IMPL->$coreSetterName($arg);\n");
    14021411                } else {
    14031412                    my $setterExpressionPrefix = $codeGenerator->SetterExpressionPrefix(\%implIncludes, $interfaceName, $attribute);
     
    15341543
    15351544                my $implGetter = GetObjCTypeGetter($paramName, $idlType);
    1536                 my $idlTypeWithNamespace = "WebCore::" . $codeGenerator->GetSVGTypeNeedingTearOff($idlType);
    1537                 $idlTypeWithNamespace =~ s/</\<WebCore::/;
     1545                my $idlTypeWithNamespace = GetSVGTypeWithNamespace($idlType);
    15381546
    15391547                push(@functionContent, "    $idlTypeWithNamespace* ${paramName}Core = $implGetter;\n");
     
    16041612                if (ConversionNeeded($function->signature->type)) {
    16051613                    if ($codeGenerator->IsSVGTypeNeedingTearOff($function->signature->type) and not $implClassName =~ /List$/) {
    1606                         my $idlType = $function->signature->type;
    1607                         my $idlTypeWithNamespace = "WebCore::" . $codeGenerator->GetSVGTypeNeedingTearOff($idlType);
    1608                         $idlTypeWithNamespace =~ s/</\<WebCore::/;
     1614                        my $idlTypeWithNamespace = GetSVGTypeWithNamespace($function->signature->type);
    16091615                        $content = "kit(WTF::getPtr(${idlTypeWithNamespace}::create($content)))";
    16101616                    } elsif ($codeGenerator->IsPodType($function->signature->type)) {
  • trunk/WebCore/bindings/scripts/CodeGeneratorV8.pm

    r70918 r70979  
    131131}
    132132
    133 sub AvoidInclusionOfType
    134 {
    135     my $type = shift;
    136 
    137     # Special case: SVGRect.h / SVGPoint.h / SVGNumber.h / SVGMatrix.h do not exist.
    138     return 1 if $type eq "SVGRect" or $type eq "SVGPoint" or $type eq "SVGNumber" or $type eq "SVGMatrix";
    139     return 0;
    140 }
    141 
    142133sub AddIncludesForType
    143134{
     
    146137    # When we're finished with the one-file-per-class
    147138    # reorganization, we won't need these special cases.
    148     if (!$codeGenerator->IsPrimitiveType($type) and !AvoidInclusionOfType($type) and $type ne "Date") {
     139    if (!$codeGenerator->IsPrimitiveType($type) and !$codeGenerator->AvoidInclusionOfType($type) and $type ne "Date") {
    149140        # default, include the same named file
    150141        $implIncludes{GetV8HeaderName(${type})} = 1;
     
    479470        $className =~ s/Abs|Rel//;
    480471    }
    481     return "" if (AvoidInclusionOfType($className));
     472    return "" if ($codeGenerator->AvoidInclusionOfType($className));
    482473    return "DeprecatedSVGAnimatedTemplate.h" if $codeGenerator->IsSVGAnimatedType($className) and !$codeGenerator->IsSVGNewStyleAnimatedType($className);
    483474    return "${className}.h";
     
    728719    }
    729720
    730     my $getterStringUsesImp = $implClassName ne "float";
     721    my $getterStringUsesImp = $implClassName ne "SVGNumber";
    731722    my $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($implClassName);
    732723
     
    761752    $svgNativeType* wrapper = V8${implClassName}::toNative(info.Holder());
    762753    $svgWrappedNativeType& impInstance = wrapper->propertyReference();
     754END
     755            if ($getterStringUsesImp) {
     756                push(@implContentDecls, <<END);
    763757    $svgWrappedNativeType* imp = &impInstance;
    764758END
     759            }
    765760        }
    766761    } elsif ($attrExt->{"v8OnProto"} || $attrExt->{"V8DisallowShadowing"}) {
     
    10701065    }
    10711066
    1072     if ($implClassName eq "float") {
     1067    if ($implClassName eq "SVGNumber") {
    10731068        push(@implContentDecls, "    *imp = $result;\n");
    10741069    } else {
     
    26742669    $type = "FloatPoint" if $type eq "SVGPoint";
    26752670    $type = "AffineTransform" if $type eq "SVGMatrix";
    2676     $type = "float" if $type eq "SVGNumber";
    26772671    $type = "V8SVGPODTypeWrapper<$type>" if $dataNode->extendedAttributes->{"PODType"};
    26782672    $type = $codeGenerator->GetSVGTypeNeedingTearOff($type) if $codeGenerator->IsSVGTypeNeedingTearOff($type);
     
    29792973    return "AffineTransform" if $type eq "SVGMatrix";
    29802974    return "SVGTransform" if $type eq "SVGTransform";
    2981     return "float" if $type eq "SVGNumber";
    29822975    return "SVGPreserveAspectRatio" if $type eq "SVGPreserveAspectRatio";
    29832976    return "SVGPaint::SVGPaintType" if $type eq "SVGPaintType";
     
    30623055    return "$value->BooleanValue()" if $type eq "boolean";
    30633056    return "static_cast<$type>($value->NumberValue())" if $type eq "float" or $type eq "double";
    3064     return "$value->NumberValue()" if $type eq "SVGNumber";
    30653057
    30663058    return "toInt32($value${maybeOkParam})" if $type eq "long";
  • trunk/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp

    r70223 r70979  
    7373}
    7474
    75 static inline void extractFloatValuesFromSVGNumberList(SVGNumberList* list, Vector<float>& floatValues, unsigned textContentLength)
    76 {
    77     ASSERT(list);
    78 
    79     unsigned length = list->numberOfItems();
     75static inline void extractFloatValuesFromSVGNumberList(const SVGNumberList& list, Vector<float>& floatValues, unsigned textContentLength)
     76{
     77    unsigned length = list.size();
    8078    if (length > textContentLength)
    8179        length = textContentLength;
    8280    floatValues.reserveCapacity(length);
    8381
    84     ExceptionCode ec = 0;
    85     for (unsigned i = 0; i < length; ++i) {
    86         float length = list->getItem(i, ec);
    87         ASSERT(!ec);
    88         floatValues.append(length);
    89     }
     82    for (unsigned i = 0; i < length; ++i)
     83        floatValues.append(list.at(i));
    9084}
    9185
  • trunk/WebCore/svg/DeprecatedSVGAnimatedPropertyTraits.h

    r70872 r70979  
    2424#if ENABLE(SVG)
    2525#include "PlatformString.h"
    26 #include "SVGNumberList.h"
    2726#include "SVGPreserveAspectRatio.h"
    2827#include "SVGTransformList.h"
     
    3231template<typename Type>
    3332struct DeprecatedSVGAnimatedPropertyTraits : public Noncopyable { };
    34 
    35 // SVGAnimatedNumber
    36 template<>
    37 struct DeprecatedSVGAnimatedPropertyTraits<float> : public Noncopyable {
    38     typedef const float& PassType;
    39     typedef float ReturnType;
    40     typedef float StoredType;
    41 
    42     static ReturnType null() { return 0.0f; }
    43     static ReturnType toReturnType(const StoredType& type) { return type; }
    44     static String toString(PassType type) { return String::number(type); }
    45 };
    46 
    47 // SVGAnimatedNumberList
    48 template<>
    49 struct DeprecatedSVGAnimatedPropertyTraits<SVGNumberList*> : public Noncopyable {
    50     typedef SVGNumberList* PassType;
    51     typedef SVGNumberList* ReturnType;
    52     typedef RefPtr<SVGNumberList> StoredType;
    53 
    54     static ReturnType null() { return 0; }
    55     static ReturnType toReturnType(const StoredType& type) { return type.get(); }
    56     static String toString(PassType type) { return type ? type->valueAsString() : String(); }
    57 };
    5833
    5934// SVGAnimatedPreserveAspectRatio
  • trunk/WebCore/svg/DeprecatedSVGAnimatedTemplate.h

    r70872 r70979  
    3030   
    3131    class SVGElement;
    32     class SVGNumberList;
    3332    class SVGPreserveAspectRatio;
    3433    class SVGTransformList;
     
    155154
    156155    // Common type definitions, to ease IDL generation.
    157     typedef DeprecatedSVGAnimatedTemplate<float> SVGAnimatedNumber;
    158     typedef DeprecatedSVGAnimatedTemplate<SVGNumberList*> SVGAnimatedNumberList;
    159156    typedef DeprecatedSVGAnimatedTemplate<SVGPreserveAspectRatio> SVGAnimatedPreserveAspectRatio;
    160157    typedef DeprecatedSVGAnimatedTemplate<String> SVGAnimatedString;
  • trunk/WebCore/svg/SVGAnimatedNumber.idl

    r64579 r70979  
    2828
    2929    interface [Conditional=SVG] SVGAnimatedNumber {
    30                  attribute float baseVal
    31                      /*setter raises(DOMException)*/;
     30        attribute [StrictTypeChecking] float baseVal;
    3231        readonly attribute float animVal;
    3332    };
  • trunk/WebCore/svg/SVGComponentTransferFunctionElement.cpp

    r66397 r70979  
    3434    : SVGElement(tagName, document)
    3535    , m_type(FECOMPONENTTRANSFER_TYPE_UNKNOWN)
    36     , m_tableValues(SVGNumberList::create(SVGNames::tableValuesAttr))
    3736    , m_slope(1)
    3837    , m_amplitude(1)
     
    5554        else if (value == "gamma")
    5655            setTypeBaseValue(FECOMPONENTTRANSFER_TYPE_GAMMA);
    57     }
    58     else if (attr->name() == SVGNames::tableValuesAttr)
    59         tableValuesBaseValue()->parse(value);
    60     else if (attr->name() == SVGNames::slopeAttr)
     56    } else if (attr->name() == SVGNames::tableValuesAttr) {
     57        SVGNumberList newList;
     58        newList.parse(value);
     59        detachAnimatedTableValuesListWrappers(newList.size());
     60        tableValuesBaseValue() = newList;
     61    } else if (attr->name() == SVGNames::slopeAttr)
    6162        setSlopeBaseValue(value.toFloat());
    6263    else if (attr->name() == SVGNames::interceptAttr)
     
    106107{
    107108    ComponentTransferFunction func;
    108     func.type = (ComponentTransferType) type();
     109    func.type = static_cast<ComponentTransferType>(type());
    109110    func.slope = slope();
    110111    func.intercept = intercept();
     
    112113    func.exponent = exponent();
    113114    func.offset = offset();
    114     SVGNumberList* numbers = tableValues();
    115 
    116     ExceptionCode ec = 0;
    117     unsigned int nr = numbers->numberOfItems();
    118     for (unsigned int i = 0; i < nr; i++)
    119         func.tableValues.append(numbers->getItem(i, ec));
     115    func.tableValues = tableValues();
    120116    return func;
    121117}
  • trunk/WebCore/svg/SVGComponentTransferFunctionElement.h

    r70872 r70979  
    2323
    2424#if ENABLE(SVG) && ENABLE(FILTERS)
     25#include "FEComponentTransfer.h"
    2526#include "SVGAnimatedPropertyMacros.h"
    2627#include "SVGNumberList.h"
    27 #include "FEComponentTransfer.h"
    2828
    2929namespace WebCore {
     
    4141    private:
    4242        DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGComponentTransferFunctionElement, SVGNames::typeAttr, int, Type, type)
    43         DECLARE_ANIMATED_PROPERTY(SVGComponentTransferFunctionElement, SVGNames::tableValuesAttr, SVGNumberList*, TableValues, tableValues)
    44         DECLARE_ANIMATED_PROPERTY(SVGComponentTransferFunctionElement, SVGNames::slopeAttr, float, Slope, slope)
    45         DECLARE_ANIMATED_PROPERTY(SVGComponentTransferFunctionElement, SVGNames::interceptAttr, float, Intercept, intercept)
    46         DECLARE_ANIMATED_PROPERTY(SVGComponentTransferFunctionElement, SVGNames::amplitudeAttr, float, Amplitude, amplitude)
    47         DECLARE_ANIMATED_PROPERTY(SVGComponentTransferFunctionElement, SVGNames::exponentAttr, float, Exponent, exponent)
    48         DECLARE_ANIMATED_PROPERTY(SVGComponentTransferFunctionElement, SVGNames::offsetAttr, float, Offset, offset)
     43        DECLARE_ANIMATED_LIST_PROPERTY_NEW(SVGComponentTransferFunctionElement, SVGNames::tableValuesAttr, SVGNumberList, TableValues, tableValues)
     44        DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGComponentTransferFunctionElement, SVGNames::slopeAttr, float, Slope, slope)
     45        DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGComponentTransferFunctionElement, SVGNames::interceptAttr, float, Intercept, intercept)
     46        DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGComponentTransferFunctionElement, SVGNames::amplitudeAttr, float, Amplitude, amplitude)
     47        DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGComponentTransferFunctionElement, SVGNames::exponentAttr, float, Exponent, exponent)
     48        DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGComponentTransferFunctionElement, SVGNames::offsetAttr, float, Offset, offset)
    4949    };
    5050
  • trunk/WebCore/svg/SVGFEColorMatrixElement.cpp

    r69409 r70979  
    3333    : SVGFilterPrimitiveStandardAttributes(tagName, document)
    3434    , m_type(FECOLORMATRIX_TYPE_UNKNOWN)
    35     , m_values(SVGNumberList::create(SVGNames::valuesAttr))
    3635{
    3736}
     
    5756    else if (attr->name() == SVGNames::inAttr)
    5857        setIn1BaseValue(value);
    59     else if (attr->name() == SVGNames::valuesAttr)
    60         valuesBaseValue()->parse(value);
    61     else
     58    else if (attr->name() == SVGNames::valuesAttr) {
     59        SVGNumberList newList;
     60        newList.parse(value);
     61        detachAnimatedValuesListWrappers(newList.size());
     62        valuesBaseValue() = newList;
     63    } else
    6264        SVGFilterPrimitiveStandardAttributes::parseMappedAttribute(attr);
    6365}
     
    100102
    101103    Vector<float> filterValues;
    102     SVGNumberList* numbers = values();
    103104    const ColorMatrixType filterType(static_cast<ColorMatrixType>(type()));
    104105
     
    120121        }
    121122    } else {
    122         size_t size = numbers->numberOfItems();
    123         for (size_t i = 0; i < size; i++) {
    124             ExceptionCode ec = 0;
    125             filterValues.append(numbers->getItem(i, ec));
    126         }
    127         size = filterValues.size();
     123        filterValues = values();
     124        unsigned size = filterValues.size();
    128125
    129126        if ((filterType == FECOLORMATRIX_TYPE_MATRIX && size != 20)
  • trunk/WebCore/svg/SVGFEColorMatrixElement.h

    r70872 r70979  
    4343    DECLARE_ANIMATED_PROPERTY(SVGFEColorMatrixElement, SVGNames::inAttr, String, In1, in1)
    4444    DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEColorMatrixElement, SVGNames::typeAttr, int, Type, type)
    45     DECLARE_ANIMATED_PROPERTY(SVGFEColorMatrixElement, SVGNames::valuesAttr, SVGNumberList*, Values, values)
     45    DECLARE_ANIMATED_LIST_PROPERTY_NEW(SVGFEColorMatrixElement, SVGNames::valuesAttr, SVGNumberList, Values, values)
    4646};
    4747
  • trunk/WebCore/svg/SVGFECompositeElement.h

    r70872 r70979  
    4343    DECLARE_ANIMATED_PROPERTY(SVGFECompositeElement, SVGNames::in2Attr, String, In2, in2)
    4444    DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFECompositeElement, SVGNames::operatorAttr, int, _operator, _operator)
    45     DECLARE_ANIMATED_PROPERTY(SVGFECompositeElement, SVGNames::k1Attr, float, K1, k1)
    46     DECLARE_ANIMATED_PROPERTY(SVGFECompositeElement, SVGNames::k2Attr, float, K2, k2)
    47     DECLARE_ANIMATED_PROPERTY(SVGFECompositeElement, SVGNames::k3Attr, float, K3, k3)
    48     DECLARE_ANIMATED_PROPERTY(SVGFECompositeElement, SVGNames::k4Attr, float, K4, k4)
     45    DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFECompositeElement, SVGNames::k1Attr, float, K1, k1)
     46    DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFECompositeElement, SVGNames::k2Attr, float, K2, k2)
     47    DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFECompositeElement, SVGNames::k3Attr, float, K3, k3)
     48    DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFECompositeElement, SVGNames::k4Attr, float, K4, k4)
    4949};
    5050
  • trunk/WebCore/svg/SVGFEConvolveMatrixElement.cpp

    r69774 r70979  
    3636namespace WebCore {
    3737
    38 char SVGKernelUnitLengthXAttrIdentifier[] = "SVGKernelUnitLengthXAttr";
    39 char SVGKernelUnitLengthYAttrIdentifier[] = "SVGKernelUnitLengthYAttr";
    40 
    4138inline SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement(const QualifiedName& tagName, Document* document)
    4239    : SVGFilterPrimitiveStandardAttributes(tagName, document)
    43     , m_kernelMatrix(SVGNumberList::create(SVGNames::kernelMatrixAttr))
    4440    , m_edgeMode(EDGEMODE_DUPLICATE)
    4541{
     
    4945{
    5046    return adoptRef(new SVGFEConvolveMatrixElement(tagName, document));
     47}
     48
     49const AtomicString& SVGFEConvolveMatrixElement::kernelUnitLengthXIdentifier()
     50{
     51    DEFINE_STATIC_LOCAL(AtomicString, s_identifier, ("SVGKernelUnitLengthX"));
     52    return s_identifier;
     53}
     54
     55const AtomicString& SVGFEConvolveMatrixElement::kernelUnitLengthYIdentifier()
     56{
     57    DEFINE_STATIC_LOCAL(AtomicString, s_identifier, ("SVGKernelUnitLengthY"));
     58    return s_identifier;
    5159}
    5260
     
    6977        else if (value == "none")
    7078            setEdgeModeBaseValue(EDGEMODE_NONE);
    71     } else if (attr->name() == SVGNames::kernelMatrixAttr)
    72         kernelMatrixBaseValue()->parse(value);
    73     else if (attr->name() == SVGNames::divisorAttr)
     79    } else if (attr->name() == SVGNames::kernelMatrixAttr) {
     80        SVGNumberList newList;
     81        newList.parse(value);
     82        detachAnimatedKernelMatrixListWrappers(newList.size());
     83        kernelMatrixBaseValue() = newList;
     84    } else if (attr->name() == SVGNames::divisorAttr)
    7485        setDivisorBaseValue(value.toFloat());
    7586    else if (attr->name() == SVGNames::biasAttr)
     
    132143        return 0;
    133144
    134     Vector<float> kernelMatrixValues;
    135     SVGNumberList* numbers = kernelMatrix();
    136 
    137     ExceptionCode ec = 0;
    138     int numberOfItems = numbers->numberOfItems();
    139     for (int i = 0; i < numberOfItems; ++i)
    140         kernelMatrixValues.append(numbers->getItem(i, ec));
    141 
    142145    int orderXValue = orderX();
    143146    int orderYValue = orderY();
     
    146149        orderYValue = 3;
    147150    }
     151    SVGNumberList& kernelMatrix = this->kernelMatrix();
     152    int kernelMatrixSize = kernelMatrix.size();
    148153    // The spec says this is a requirement, and should bail out if fails
    149     if (orderXValue * orderYValue != numberOfItems)
     154    if (orderXValue * orderYValue != kernelMatrixSize)
    150155        return 0;
    151156
     
    167172        return 0;
    168173    if (!hasAttribute(SVGNames::divisorAttr)) {
    169         for (int i = 0; i < numberOfItems; ++i)
    170             divisorValue += kernelMatrixValues[i];
     174        for (int i = 0; i < kernelMatrixSize; ++i)
     175            divisorValue += kernelMatrix.at(i);
    171176        if (!divisorValue)
    172177            divisorValue = 1;
     
    176181                    IntSize(orderXValue, orderYValue), divisorValue,
    177182                    bias(), IntPoint(targetXValue, targetYValue), static_cast<EdgeModeType>(edgeMode()),
    178                     FloatPoint(kernelUnitLengthX(), kernelUnitLengthX()), preserveAlpha(), kernelMatrixValues);
     183                    FloatPoint(kernelUnitLengthX(), kernelUnitLengthX()), preserveAlpha(), kernelMatrix);
    179184    effect->inputEffects().append(input1);
    180185    return effect.release();
  • trunk/WebCore/svg/SVGFEConvolveMatrixElement.h

    r70872 r70979  
    4242    virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*);
    4343
     44    static const AtomicString& kernelUnitLengthXIdentifier();
     45    static const AtomicString& kernelUnitLengthYIdentifier();
     46
    4447    DECLARE_ANIMATED_PROPERTY(SVGFEConvolveMatrixElement, SVGNames::inAttr, String, In1, in1)
    4548    DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEConvolveMatrixElement, SVGNames::orderXAttr, long, OrderX, orderX)
    4649    DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEConvolveMatrixElement, SVGNames::orderYAttr, long, OrderY, orderY)
    47     DECLARE_ANIMATED_PROPERTY(SVGFEConvolveMatrixElement, SVGNames::kernelMatrixAttr, SVGNumberList*, KernelMatrix, kernelMatrix)
    48     DECLARE_ANIMATED_PROPERTY(SVGFEConvolveMatrixElement, SVGNames::divisorAttr, float, Divisor, divisor)
    49     DECLARE_ANIMATED_PROPERTY(SVGFEConvolveMatrixElement, SVGNames::biasAttr, float, Bias, bias)
     50    DECLARE_ANIMATED_LIST_PROPERTY_NEW(SVGFEConvolveMatrixElement, SVGNames::kernelMatrixAttr, SVGNumberList, KernelMatrix, kernelMatrix)
     51    DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEConvolveMatrixElement, SVGNames::divisorAttr, float, Divisor, divisor)
     52    DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEConvolveMatrixElement, SVGNames::biasAttr, float, Bias, bias)
    5053    DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEConvolveMatrixElement, SVGNames::targetXAttr, long, TargetX, targetX)
    5154    DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEConvolveMatrixElement, SVGNames::targetYAttr, long, TargetY, targetY)
    5255    DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEConvolveMatrixElement, SVGNames::operatorAttr, int, EdgeMode, edgeMode)
    53     DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFEConvolveMatrixElement, SVGNames::kernelUnitLengthAttr, SVGKernelUnitLengthXIdentifier, float, KernelUnitLengthX, kernelUnitLengthX)
    54     DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFEConvolveMatrixElement, SVGNames::kernelUnitLengthAttr, SVGKernelUnitLengthYIdentifier, float, KernelUnitLengthY, kernelUnitLengthY)
     56    DECLARE_ANIMATED_STATIC_PROPERTY_MULTIPLE_WRAPPERS_NEW(SVGFEConvolveMatrixElement, SVGNames::kernelUnitLengthAttr, kernelUnitLengthXIdentifier(), float, KernelUnitLengthX, kernelUnitLengthX)
     57    DECLARE_ANIMATED_STATIC_PROPERTY_MULTIPLE_WRAPPERS_NEW(SVGFEConvolveMatrixElement, SVGNames::kernelUnitLengthAttr, kernelUnitLengthYIdentifier(), float, KernelUnitLengthY, kernelUnitLengthY)
    5558    DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEConvolveMatrixElement, SVGNames::preserveAlphaAttr, bool, PreserveAlpha, preserveAlpha)
    5659};
  • trunk/WebCore/svg/SVGFEDiffuseLightingElement.cpp

    r70872 r70979  
    4848{
    4949    DEFINE_STATIC_LOCAL(AtomicString, s_identifier, ("SVGKernelUnitLengthX"));
    50     return s_identifier;   
     50    return s_identifier;
    5151}
    5252
     
    5454{
    5555    DEFINE_STATIC_LOCAL(AtomicString, s_identifier, ("SVGKernelUnitLengthY"));
    56     return s_identifier;   
     56    return s_identifier;
    5757}
    5858
  • trunk/WebCore/svg/SVGFEDiffuseLightingElement.h

    r70872 r70979  
    4848
    4949    DECLARE_ANIMATED_PROPERTY(SVGFEDiffuseLightingElement, SVGNames::inAttr, String, In1, in1)
    50     DECLARE_ANIMATED_PROPERTY(SVGFEDiffuseLightingElement, SVGNames::diffuseConstantAttr, float, DiffuseConstant, diffuseConstant)
    51     DECLARE_ANIMATED_PROPERTY(SVGFEDiffuseLightingElement, SVGNames::surfaceScaleAttr, float, SurfaceScale, surfaceScale)
    52     DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFEDiffuseLightingElement, SVGNames::kernelUnitLengthAttr, kernelUnitLengthXIdentifier(), float, KernelUnitLengthX, kernelUnitLengthX)
    53     DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFEDiffuseLightingElement, SVGNames::kernelUnitLengthAttr, kernelUnitLengthYIdentifier(), float, KernelUnitLengthY, kernelUnitLengthY)
     50    DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEDiffuseLightingElement, SVGNames::diffuseConstantAttr, float, DiffuseConstant, diffuseConstant)
     51    DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEDiffuseLightingElement, SVGNames::surfaceScaleAttr, float, SurfaceScale, surfaceScale)
     52    DECLARE_ANIMATED_STATIC_PROPERTY_MULTIPLE_WRAPPERS_NEW(SVGFEDiffuseLightingElement, SVGNames::kernelUnitLengthAttr, kernelUnitLengthXIdentifier(), float, KernelUnitLengthX, kernelUnitLengthX)
     53    DECLARE_ANIMATED_STATIC_PROPERTY_MULTIPLE_WRAPPERS_NEW(SVGFEDiffuseLightingElement, SVGNames::kernelUnitLengthAttr, kernelUnitLengthYIdentifier(), float, KernelUnitLengthY, kernelUnitLengthY)
    5454
    5555    PassRefPtr<LightSource> findLights() const;
  • trunk/WebCore/svg/SVGFEDisplacementMapElement.h

    r70872 r70979  
    4444    DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEDisplacementMapElement, SVGNames::xChannelSelectorAttr, int, XChannelSelector, xChannelSelector)
    4545    DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEDisplacementMapElement, SVGNames::yChannelSelectorAttr, int, YChannelSelector, yChannelSelector)
    46     DECLARE_ANIMATED_PROPERTY(SVGFEDisplacementMapElement, SVGNames::scaleAttr, float, Scale, scale)
     46    DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEDisplacementMapElement, SVGNames::scaleAttr, float, Scale, scale)
    4747};
    4848
  • trunk/WebCore/svg/SVGFEGaussianBlurElement.cpp

    r70872 r70979  
    4343{
    4444    DEFINE_STATIC_LOCAL(AtomicString, s_identifier, ("SVGStdDeviationX"));
    45     return s_identifier;   
     45    return s_identifier;
    4646}
    4747
     
    4949{
    5050    DEFINE_STATIC_LOCAL(AtomicString, s_identifier, ("SVGStdDeviationY"));
    51     return s_identifier;   
     51    return s_identifier;
    5252}
    5353
  • trunk/WebCore/svg/SVGFEGaussianBlurElement.h

    r70872 r70979  
    4646
    4747    DECLARE_ANIMATED_PROPERTY(SVGFEGaussianBlurElement, SVGNames::inAttr, String, In1, in1)
    48     DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFEGaussianBlurElement, SVGNames::stdDeviationAttr, stdDeviationXIdentifier(), float, StdDeviationX, stdDeviationX)
    49     DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFEGaussianBlurElement, SVGNames::stdDeviationAttr, stdDeviationYIdentifier(), float, StdDeviationY, stdDeviationY)
     48    DECLARE_ANIMATED_STATIC_PROPERTY_MULTIPLE_WRAPPERS_NEW(SVGFEGaussianBlurElement, SVGNames::stdDeviationAttr, stdDeviationXIdentifier(), float, StdDeviationX, stdDeviationX)
     49    DECLARE_ANIMATED_STATIC_PROPERTY_MULTIPLE_WRAPPERS_NEW(SVGFEGaussianBlurElement, SVGNames::stdDeviationAttr, stdDeviationYIdentifier(), float, StdDeviationY, stdDeviationY)
    5050};
    5151
  • trunk/WebCore/svg/SVGFELightElement.h

    r68022 r70979  
    2525#if ENABLE(SVG) && ENABLE(FILTERS)
    2626#include "LightSource.h"
     27#include "SVGAnimatedPropertyMacros.h"
    2728#include "SVGElement.h"
    28 #include "SVGNames.h"
    2929
    3030namespace WebCore {
     
    4343    virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
    4444
    45     DECLARE_ANIMATED_PROPERTY(SVGFELightElement, SVGNames::azimuthAttr, float, Azimuth, azimuth)
    46     DECLARE_ANIMATED_PROPERTY(SVGFELightElement, SVGNames::elevationAttr, float, Elevation, elevation)
    47     DECLARE_ANIMATED_PROPERTY(SVGFELightElement, SVGNames::xAttr, float, X, x)
    48     DECLARE_ANIMATED_PROPERTY(SVGFELightElement, SVGNames::yAttr, float, Y, y)
    49     DECLARE_ANIMATED_PROPERTY(SVGFELightElement, SVGNames::zAttr, float, Z, z)
    50     DECLARE_ANIMATED_PROPERTY(SVGFELightElement, SVGNames::pointsAtXAttr, float, PointsAtX, pointsAtX)
    51     DECLARE_ANIMATED_PROPERTY(SVGFELightElement, SVGNames::pointsAtYAttr, float, PointsAtY, pointsAtY)
    52     DECLARE_ANIMATED_PROPERTY(SVGFELightElement, SVGNames::pointsAtZAttr, float, PointsAtZ, pointsAtZ)
    53     DECLARE_ANIMATED_PROPERTY(SVGFELightElement, SVGNames::specularExponentAttr, float, SpecularExponent, specularExponent)
    54     DECLARE_ANIMATED_PROPERTY(SVGFELightElement, SVGNames::limitingConeAngleAttr, float, LimitingConeAngle, limitingConeAngle)
     45    DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFELightElement, SVGNames::azimuthAttr, float, Azimuth, azimuth)
     46    DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFELightElement, SVGNames::elevationAttr, float, Elevation, elevation)
     47    DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFELightElement, SVGNames::xAttr, float, X, x)
     48    DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFELightElement, SVGNames::yAttr, float, Y, y)
     49    DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFELightElement, SVGNames::zAttr, float, Z, z)
     50    DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFELightElement, SVGNames::pointsAtXAttr, float, PointsAtX, pointsAtX)
     51    DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFELightElement, SVGNames::pointsAtYAttr, float, PointsAtY, pointsAtY)
     52    DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFELightElement, SVGNames::pointsAtZAttr, float, PointsAtZ, pointsAtZ)
     53    DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFELightElement, SVGNames::specularExponentAttr, float, SpecularExponent, specularExponent)
     54    DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFELightElement, SVGNames::limitingConeAngleAttr, float, LimitingConeAngle, limitingConeAngle)
    5555};
    5656
  • trunk/WebCore/svg/SVGFEMorphologyElement.cpp

    r68168 r70979  
    2929namespace WebCore {
    3030
    31 char SVGRadiusXAttrIdentifier[] = "SVGRadiusXAttr";
    32 char SVGRadiusYAttrIdentifier[] = "SVGRadiusYAttr";
    33 
    3431inline SVGFEMorphologyElement::SVGFEMorphologyElement(const QualifiedName& tagName, Document* document)
    3532    : SVGFilterPrimitiveStandardAttributes(tagName, document)
     
    4138{
    4239    return adoptRef(new SVGFEMorphologyElement(tagName, document));
     40}
     41
     42const AtomicString& SVGFEMorphologyElement::radiusXIdentifier()
     43{
     44    DEFINE_STATIC_LOCAL(AtomicString, s_identifier, ("SVGRadiusX"));
     45    return s_identifier;
     46}
     47
     48const AtomicString& SVGFEMorphologyElement::radiusYIdentifier()
     49{
     50    DEFINE_STATIC_LOCAL(AtomicString, s_identifier, ("SVGRadiusY"));
     51    return s_identifier;
    4352}
    4453
  • trunk/WebCore/svg/SVGFEMorphologyElement.h

    r70872 r70979  
    2727namespace WebCore {
    2828
    29 extern char SVGRadiusXAttrIdentifier[];
    30 extern char SVGRadiusYAttrIdentifier[];
    31 
    3229class SVGFEMorphologyElement : public SVGFilterPrimitiveStandardAttributes {
    3330public:
     
    4946    DECLARE_ANIMATED_PROPERTY(SVGFEMorphologyElement, SVGNames::inAttr, String, In1, in1)
    5047    DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEMorphologyElement, SVGNames::operatorAttr, int, _operator, _operator)
    51     DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFEMorphologyElement, SVGNames::radiusAttr, SVGRadiusXAttrIdentifier, float, RadiusX, radiusX)
    52     DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFEMorphologyElement, SVGNames::radiusAttr, SVGRadiusYAttrIdentifier, float, RadiusY, radiusY)
     48    DECLARE_ANIMATED_STATIC_PROPERTY_MULTIPLE_WRAPPERS_NEW(SVGFEMorphologyElement, SVGNames::radiusAttr, radiusXIdentifier(), float, RadiusX, radiusX)
     49    DECLARE_ANIMATED_STATIC_PROPERTY_MULTIPLE_WRAPPERS_NEW(SVGFEMorphologyElement, SVGNames::radiusAttr, radiusYIdentifier(), float, RadiusY, radiusY)
    5350};
    5451
  • trunk/WebCore/svg/SVGFEOffsetElement.h

    r68022 r70979  
    4141
    4242    DECLARE_ANIMATED_PROPERTY(SVGFEOffsetElement, SVGNames::inAttr, String, In1, in1)
    43     DECLARE_ANIMATED_PROPERTY(SVGFEOffsetElement, SVGNames::dxAttr, float, Dx, dx)
    44     DECLARE_ANIMATED_PROPERTY(SVGFEOffsetElement, SVGNames::dyAttr, float, Dy, dy)
     43    DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEOffsetElement, SVGNames::dxAttr, float, Dx, dx)
     44    DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFEOffsetElement, SVGNames::dyAttr, float, Dy, dy)
    4545};
    4646
  • trunk/WebCore/svg/SVGFESpecularLightingElement.cpp

    r70872 r70979  
    4949{
    5050    DEFINE_STATIC_LOCAL(AtomicString, s_identifier, ("SVGKernelUnitLengthX"));
    51     return s_identifier;   
     51    return s_identifier;
    5252}
    5353
     
    5555{
    5656    DEFINE_STATIC_LOCAL(AtomicString, s_identifier, ("SVGKernelUnitLengthY"));
    57     return s_identifier;   
     57    return s_identifier;
    5858}
    5959
  • trunk/WebCore/svg/SVGFESpecularLightingElement.h

    r70872 r70979  
    4444
    4545    DECLARE_ANIMATED_PROPERTY(SVGFESpecularLightingElement, SVGNames::inAttr, String, In1, in1)
    46     DECLARE_ANIMATED_PROPERTY(SVGFESpecularLightingElement, SVGNames::specularConstantAttr, float, SpecularConstant, specularConstant)
    47     DECLARE_ANIMATED_PROPERTY(SVGFESpecularLightingElement, SVGNames::specularExponentAttr, float, SpecularExponent, specularExponent)
    48     DECLARE_ANIMATED_PROPERTY(SVGFESpecularLightingElement, SVGNames::surfaceScaleAttr, float, SurfaceScale, surfaceScale)
    49     DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFESpecularLightingElement, SVGNames::kernelUnitLengthAttr, kernelUnitLengthXIdentifier(), float, KernelUnitLengthX, kernelUnitLengthX)
    50     DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFESpecularLightingElement, SVGNames::kernelUnitLengthAttr, kernelUnitLengthYIdentifier(), float, KernelUnitLengthY, kernelUnitLengthY)
     46    DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFESpecularLightingElement, SVGNames::specularConstantAttr, float, SpecularConstant, specularConstant)
     47    DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFESpecularLightingElement, SVGNames::specularExponentAttr, float, SpecularExponent, specularExponent)
     48    DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFESpecularLightingElement, SVGNames::surfaceScaleAttr, float, SurfaceScale, surfaceScale)
     49    DECLARE_ANIMATED_STATIC_PROPERTY_MULTIPLE_WRAPPERS_NEW(SVGFESpecularLightingElement, SVGNames::kernelUnitLengthAttr, kernelUnitLengthXIdentifier(), float, KernelUnitLengthX, kernelUnitLengthX)
     50    DECLARE_ANIMATED_STATIC_PROPERTY_MULTIPLE_WRAPPERS_NEW(SVGFESpecularLightingElement, SVGNames::kernelUnitLengthAttr, kernelUnitLengthYIdentifier(), float, KernelUnitLengthY, kernelUnitLengthY)
    5151
    5252    PassRefPtr<LightSource> findLights() const;
  • trunk/WebCore/svg/SVGFETurbulenceElement.cpp

    r70872 r70979  
    4545{
    4646    DEFINE_STATIC_LOCAL(AtomicString, s_identifier, ("SVGBaseFrequencyX"));
    47     return s_identifier;   
     47    return s_identifier;
    4848}
    4949
     
    5151{
    5252    DEFINE_STATIC_LOCAL(AtomicString, s_identifier, ("SVGBaseFrequencyY"));
    53     return s_identifier;   
     53    return s_identifier;
    5454}
    5555
  • trunk/WebCore/svg/SVGFETurbulenceElement.h

    r70872 r70979  
    4949    static const AtomicString& baseFrequencyYIdentifier();
    5050
    51     DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFETurbulenceElement, SVGNames::baseFrequencyAttr, baseFrequencyXIdentifier(), float, BaseFrequencyX, baseFrequencyX)
    52     DECLARE_ANIMATED_PROPERTY_MULTIPLE_WRAPPERS(SVGFETurbulenceElement, SVGNames::baseFrequencyAttr, baseFrequencyYIdentifier(), float, BaseFrequencyY, baseFrequencyY)
     51    DECLARE_ANIMATED_STATIC_PROPERTY_MULTIPLE_WRAPPERS_NEW(SVGFETurbulenceElement, SVGNames::baseFrequencyAttr, baseFrequencyXIdentifier(), float, BaseFrequencyX, baseFrequencyX)
     52    DECLARE_ANIMATED_STATIC_PROPERTY_MULTIPLE_WRAPPERS_NEW(SVGFETurbulenceElement, SVGNames::baseFrequencyAttr, baseFrequencyYIdentifier(), float, BaseFrequencyY, baseFrequencyY)
    5353    DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFETurbulenceElement, SVGNames::numOctavesAttr, long, NumOctaves, numOctaves)
    54     DECLARE_ANIMATED_PROPERTY(SVGFETurbulenceElement, SVGNames::seedAttr, float, Seed, seed)
     54    DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFETurbulenceElement, SVGNames::seedAttr, float, Seed, seed)
    5555    DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFETurbulenceElement, SVGNames::stitchTilesAttr, int, StitchTiles, stitchTiles)
    5656    DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFETurbulenceElement, SVGNames::typeAttr, int, Type, type)
  • trunk/WebCore/svg/SVGFilterElement.cpp

    r70872 r70979  
    6464{
    6565    DEFINE_STATIC_LOCAL(AtomicString, s_identifier, ("SVGFilterResX"));
    66     return s_identifier;   
     66    return s_identifier;
    6767}
    6868
     
    7070{
    7171    DEFINE_STATIC_LOCAL(AtomicString, s_identifier, ("SVGFilterResY"));
    72     return s_identifier;   
     72    return s_identifier;
    7373}
    7474
  • trunk/WebCore/svg/SVGMarkerElement.cpp

    r70872 r70979  
    5656{
    5757    DEFINE_STATIC_LOCAL(AtomicString, s_identifier, ("SVGOrientType"));
    58     return s_identifier;   
     58    return s_identifier;
    5959}
    6060
     
    6262{
    6363    DEFINE_STATIC_LOCAL(AtomicString, s_identifier, ("SVGOrientAngle"));
    64     return s_identifier;   
     64    return s_identifier;
    6565}
    6666
  • trunk/WebCore/svg/SVGNumber.idl

    r70410 r70979  
    2323module svg {
    2424
    25     interface [Conditional=SVG, PODType=float] SVGNumber {
    26         attribute float value;
     25    interface [Conditional=SVG] SVGNumber {
     26        attribute [StrictTypeChecking] float value;
    2727    };
    2828
  • trunk/WebCore/svg/SVGNumberList.cpp

    r66397 r70979  
    2525
    2626#include "SVGParserUtilities.h"
     27#include <wtf/text/StringBuilder.h>
    2728
    2829namespace WebCore {
    2930
    30 SVGNumberList::SVGNumberList(const QualifiedName& attributeName)
    31     : SVGPODList<float>(attributeName)
    32 {
    33 }
    34 
    3531void SVGNumberList::parse(const String& value)
    3632{
    37     ExceptionCode ec = 0;
    38     clear(ec);
     33    clear();
    3934
    40     float number = 0.0f;
    41    
     35    float number = 0;
    4236    const UChar* ptr = value.characters();
    4337    const UChar* end = ptr + value.length();
     38
    4439    // The spec strangely doesn't allow leading whitespace.  We might choose to violate that intentionally. (section 4.1)
    4540    while (ptr < end) {
    4641        if (!parseNumber(ptr, end, number))
    4742            return;
    48         appendItem(number, ec);
     43        append(number);
    4944    }
    5045}
     
    5247String SVGNumberList::valueAsString() const
    5348{
    54     String result;
     49    StringBuilder builder;
    5550
    56     ExceptionCode ec = 0;
    57     for (unsigned int i = 0; i < numberOfItems(); ++i) {
     51    unsigned size = this->size();
     52    for (unsigned i = 0; i < size; ++i) {
    5853        if (i > 0)
    59             result += ", ";
     54            builder.append(", ");
    6055
    61         result += String::number(getItem(i, ec));
    62         ASSERT(ec == 0);
     56        builder.append(String::number(at(i)));
    6357    }
    6458
    65     return result;
     59    return builder.toString();
    6660}
    6761
  • trunk/WebCore/svg/SVGNumberList.h

    r66397 r70979  
    2323
    2424#if ENABLE(SVG)
    25 #include "SVGList.h"
    26 #include <wtf/Forward.h>
    27 #include <wtf/PassRefPtr.h>
     25#include <wtf/Vector.h>
     26#include <wtf/text/WTFString.h>
    2827
    2928namespace WebCore {
    3029
    31     class SVGNumberList : public SVGPODList<float> {
    32     public:
    33         static PassRefPtr<SVGNumberList> create(const QualifiedName& attributeName) { return adoptRef(new SVGNumberList(attributeName)); }
     30class SVGNumberList : public Vector<float> {
     31public:
     32    SVGNumberList() { }
    3433
    35         void parse(const String& value);
    36  
    37         String valueAsString() const;
    38 
    39     private:
    40         SVGNumberList(const QualifiedName&);
    41     };
     34    void parse(const String&);
     35    String valueAsString() const;
     36};
    4237
    4338} // namespace WebCore
  • trunk/WebCore/svg/SVGPathElement.h

    r70857 r70979  
    106106        mutable RefPtr<SVGPathSegList> m_pathSegList;
    107107
    108         DECLARE_ANIMATED_PROPERTY(SVGPathElement, SVGNames::pathLengthAttr, float, PathLength, pathLength)
     108        DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGPathElement, SVGNames::pathLengthAttr, float, PathLength, pathLength)
    109109
    110110        // SVGExternalResourcesRequired
  • trunk/WebCore/svg/SVGStopElement.h

    r66397 r70979  
    2323
    2424#if ENABLE(SVG)
    25 #include "SVGNames.h"
     25#include "SVGAnimatedPropertyMacros.h"
    2626#include "SVGStyledElement.h"
    2727
     
    4545        virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
    4646
    47         DECLARE_ANIMATED_PROPERTY(SVGStopElement, SVGNames::offsetAttr, float, Offset, offset)
     47        DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGStopElement, SVGNames::offsetAttr, float, Offset, offset)
    4848    };
    4949
  • trunk/WebCore/svg/SVGTextPositioningElement.cpp

    r70223 r70979  
    3535SVGTextPositioningElement::SVGTextPositioningElement(const QualifiedName& tagName, Document* document)
    3636    : SVGTextContentElement(tagName, document)
    37     , m_rotate(SVGNumberList::create(SVGNames::rotateAttr))
    3837{
    3938}
     
    6160        detachAnimatedDyListWrappers(newList.size());
    6261        dyBaseValue() = newList;
    63     } else if (attr->name() == SVGNames::rotateAttr)
    64         rotateBaseValue()->parse(attr->value());
    65     else
     62    } else if (attr->name() == SVGNames::rotateAttr) {
     63        SVGNumberList newList;
     64        newList.parse(attr->value());
     65        detachAnimatedRotateListWrappers(newList.size());
     66        rotateBaseValue() = newList;
     67    } else
    6668        SVGTextContentElement::parseMappedAttribute(attr);
    6769}
  • trunk/WebCore/svg/SVGTextPositioningElement.h

    r70223 r70979  
    4747        DECLARE_ANIMATED_LIST_PROPERTY_NEW(SVGTextPositioningElement, SVGNames::dxAttr, SVGLengthList, Dx, dx)
    4848        DECLARE_ANIMATED_LIST_PROPERTY_NEW(SVGTextPositioningElement, SVGNames::dyAttr, SVGLengthList, Dy, dy)
    49         DECLARE_ANIMATED_PROPERTY(SVGTextPositioningElement, SVGNames::rotateAttr, SVGNumberList*, Rotate, rotate)
     49        DECLARE_ANIMATED_LIST_PROPERTY_NEW(SVGTextPositioningElement, SVGNames::rotateAttr, SVGNumberList, Rotate, rotate)
    5050    };
    5151
  • trunk/WebCore/svg/properties/SVGPropertyTraits.h

    r70303 r70979  
    2727#include "SVGLength.h"
    2828#include "SVGLengthList.h"
     29#include "SVGNumberList.h"
    2930#include "SVGPreserveAspectRatio.h"
    3031#include <wtf/text/StringBuilder.h>
     
    8081
    8182template<>
     83struct SVGPropertyTraits<SVGNumberList> {
     84    typedef float ListItemType;
     85
     86    static SVGNumberList initialValue() { return SVGNumberList(); }
     87    static String toString(const SVGNumberList& type) { return type.valueAsString(); }
     88};
     89
     90template<>
    8291struct SVGPropertyTraits<SVGPreserveAspectRatio> {
    8392    static SVGPreserveAspectRatio initialValue() { return SVGPreserveAspectRatio(); }
Note: See TracChangeset for help on using the changeset viewer.