Changeset 86765 in webkit


Ignore:
Timestamp:
May 18, 2011 8:35:36 AM (13 years ago)
Author:
Nikolas Zimmermann
Message:

2011-05-18 Nikolas Zimmermann <nzimmermann@rim.com>

Reviewed by Rob Buis.

All animated SVG enum properties are now ints
https://bugs.webkit.org/show_bug.cgi?id=10749

Add tests for all elements using SVGAnimatedEnumeration in the SVG DOM API.

  • platform/mac/svg/dynamic-updates/SVGTextElement-svgdom-lengthAdjust-prop-expected.png: Update result, progression.
  • svg/dom/SVGAnimatedEnumeration-SVGClipPathElement-expected.txt: Added.
  • svg/dom/SVGAnimatedEnumeration-SVGClipPathElement.html: Added.
  • svg/dom/SVGAnimatedEnumeration-SVGComponentTransferFunctionElement-expected.txt: Added.
  • svg/dom/SVGAnimatedEnumeration-SVGComponentTransferFunctionElement.html: Added.
  • svg/dom/SVGAnimatedEnumeration-SVGFEBlendElement-expected.txt: Added.
  • svg/dom/SVGAnimatedEnumeration-SVGFEBlendElement.html: Added.
  • svg/dom/SVGAnimatedEnumeration-SVGFEColorMatrixElement-expected.txt: Added.
  • svg/dom/SVGAnimatedEnumeration-SVGFEColorMatrixElement.html: Added.
  • svg/dom/SVGAnimatedEnumeration-SVGFECompositeElement-expected.txt: Added.
  • svg/dom/SVGAnimatedEnumeration-SVGFECompositeElement.html: Added.
  • svg/dom/SVGAnimatedEnumeration-SVGFEConvolveMatrixElement-expected.txt: Added.
  • svg/dom/SVGAnimatedEnumeration-SVGFEConvolveMatrixElement.html: Added.
  • svg/dom/SVGAnimatedEnumeration-SVGFEDisplacementMapElement-expected.txt: Added.
  • svg/dom/SVGAnimatedEnumeration-SVGFEDisplacementMapElement.html: Added.
  • svg/dom/SVGAnimatedEnumeration-SVGFEMorphologyElement-expected.txt: Added.
  • svg/dom/SVGAnimatedEnumeration-SVGFEMorphologyElement.html: Added.
  • svg/dom/SVGAnimatedEnumeration-SVGFETurbulenceElement-expected.txt: Added.
  • svg/dom/SVGAnimatedEnumeration-SVGFETurbulenceElement.html: Added.
  • svg/dom/SVGAnimatedEnumeration-SVGFilterElement-expected.txt: Added.
  • svg/dom/SVGAnimatedEnumeration-SVGFilterElement.html: Added.
  • svg/dom/SVGAnimatedEnumeration-SVGGradientElement-expected.txt: Added.
  • svg/dom/SVGAnimatedEnumeration-SVGGradientElement.html: Added.
  • svg/dom/SVGAnimatedEnumeration-SVGMarkerElement-expected.txt: Added.
  • svg/dom/SVGAnimatedEnumeration-SVGMarkerElement.html: Added.
  • svg/dom/SVGAnimatedEnumeration-SVGMaskElement-expected.txt: Added.
  • svg/dom/SVGAnimatedEnumeration-SVGMaskElement.html: Added.
  • svg/dom/SVGAnimatedEnumeration-SVGPatternElement-expected.txt: Added.
  • svg/dom/SVGAnimatedEnumeration-SVGPatternElement.html: Added.
  • svg/dom/SVGAnimatedEnumeration-SVGTextContentElement-expected.txt: Added.
  • svg/dom/SVGAnimatedEnumeration-SVGTextContentElement.html: Added.
  • svg/dom/SVGAnimatedEnumeration-SVGTextPathElement-expected.txt: Added.
  • svg/dom/SVGAnimatedEnumeration-SVGTextPathElement.html: Added.
  • svg/dom/SVGAnimatedEnumeration-expected.txt:
  • svg/dom/script-tests/SVGAnimatedEnumeration-SVGClipPathElement.js: Added.
  • svg/dom/script-tests/SVGAnimatedEnumeration-SVGComponentTransferFunctionElement.js: Added.
  • svg/dom/script-tests/SVGAnimatedEnumeration-SVGFEBlendElement.js: Added.
  • svg/dom/script-tests/SVGAnimatedEnumeration-SVGFEColorMatrixElement.js: Added.
  • svg/dom/script-tests/SVGAnimatedEnumeration-SVGFECompositeElement.js: Added.
  • svg/dom/script-tests/SVGAnimatedEnumeration-SVGFEConvolveMatrixElement.js: Added.
  • svg/dom/script-tests/SVGAnimatedEnumeration-SVGFEDisplacementMapElement.js: Added.
  • svg/dom/script-tests/SVGAnimatedEnumeration-SVGFEMorphologyElement.js: Added.
  • svg/dom/script-tests/SVGAnimatedEnumeration-SVGFETurbulenceElement.js: Added.
  • svg/dom/script-tests/SVGAnimatedEnumeration-SVGFilterElement.js: Added.
  • svg/dom/script-tests/SVGAnimatedEnumeration-SVGGradientElement.js: Added.
  • svg/dom/script-tests/SVGAnimatedEnumeration-SVGMarkerElement.js: Added.
  • svg/dom/script-tests/SVGAnimatedEnumeration-SVGMaskElement.js: Added.
  • svg/dom/script-tests/SVGAnimatedEnumeration-SVGPatternElement.js: Added.
  • svg/dom/script-tests/SVGAnimatedEnumeration-SVGTextContentElement.js: Added.
  • svg/dom/script-tests/SVGAnimatedEnumeration-SVGTextPathElement.js: Added.
  • svg/dom/script-tests/SVGAnimatedEnumeration.js:
  • svg/dynamic-updates/SVGTextElement-svgdom-lengthAdjust-prop-expected.txt:
  • svg/dynamic-updates/script-tests/SVGTextElement-svgdom-lengthAdjust-prop.js: (executeTest):
  • svg/filters/feBlend-invalid-mode-expected.txt:
  • svg/filters/feComponentTransfer-style-crash-expected.txt:
  • svg/filters/feComponentTransfer-style-crash.xhtml:
  • svg/filters/feDisplacementMap-crash-test-expected.txt:
  • svg/filters/feDisplacementMap-crash-test.xhtml:

2011-05-18 Nikolas Zimmermann <nzimmermann@rim.com>

Reviewed by Rob Buis.

All animated SVG enum properties are now ints
https://bugs.webkit.org/show_bug.cgi?id=10749

DECLARE/DEFINE_ANIMATED_ENUMERATION created fooBaseVal()/setFooBaseVal() methods that take int parameters, and stored all enum types as integers.
Modify the SVG DOM API to store real enums, and get rid of any int<->enum conversions. It's now impossible to change any enum values to undefined
types, which is the root of several filter security bugs in the past, that were fixed by adding workarounds.
(Usual workaround: svgAttributeChanged(): if fooAttr has been changed from SVG DOM, and if it's an enum, check whether the enum is in range, or fix it up.)

Using a type-safe internal representation for these enum values we can get rid of ugly int<->enum conversions.
A lot of parseMappedAttribute() functions duplicated the code for parsing enum values (eg. userSpaceOnUse/objectBoundingBox unit values, in pattern/filter/mask/etc..)
Add dozens of new SVGPropertyTraits<EnumType> specializations for all enums we expose to JS, and offer static fromString/toString conversion methods in single places.
Use the new SVGPropertyTraits everywhere in svg/.

This also fixes SVG DOM <-> XML DOM synchronization for SVGAnimatedEnumeration types.
Example: <clipPath clipPathUnits="objectBoundingBox">
myClipPath.clipPathUnits.baseVal = SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE;
alert(myClipPath.getAttribute('clipPathUnits')); <- without this patch it says "1", now it says "userSpaceOnUse" as expected, and as other browsers do.
We're now properly converting the enum values to strings.

Add testcases for all SVGAnimatedEnumeration objects used in the SVG DOM API. Found several small bugs:

  • SVGFEConvolveMatrix 'edgeMode' SVG DOM <-> XML DOM synchronization was not working, because of a typo: s/operatorAttr/edgeModeAttr
  • SVGFEConvolveMatrix was missing an synchronizeProperty() implementation, disabling SVG <-> XML DOM synchronization completly.

Tests: svg/dom/SVGAnimatedEnumeration-SVGClipPathElement.html

svg/dom/SVGAnimatedEnumeration-SVGComponentTransferFunctionElement.html
svg/dom/SVGAnimatedEnumeration-SVGFEBlendElement.html
svg/dom/SVGAnimatedEnumeration-SVGFEColorMatrixElement.html
svg/dom/SVGAnimatedEnumeration-SVGFECompositeElement.html
svg/dom/SVGAnimatedEnumeration-SVGFEConvolveMatrixElement.html
svg/dom/SVGAnimatedEnumeration-SVGFEDisplacementMapElement.html
svg/dom/SVGAnimatedEnumeration-SVGFEMorphologyElement.html
svg/dom/SVGAnimatedEnumeration-SVGFETurbulenceElement.html
svg/dom/SVGAnimatedEnumeration-SVGFilterElement.html
svg/dom/SVGAnimatedEnumeration-SVGGradientElement.html
svg/dom/SVGAnimatedEnumeration-SVGMarkerElement.html
svg/dom/SVGAnimatedEnumeration-SVGMaskElement.html
svg/dom/SVGAnimatedEnumeration-SVGPatternElement.html
svg/dom/SVGAnimatedEnumeration-SVGTextContentElement.html
svg/dom/SVGAnimatedEnumeration-SVGTextPathElement.html

Fixes existing svg/dynamic-update/SVGTextContentElement-svgdom-lengthAdjust-prop.html where I found the bug initially.

  • GNUmakefile.list.am: Add svg/properties/SVGAnimatedEnumerationPropertyTearOff.h to build.
  • WebCore.gypi: Ditto.
  • WebCore.pro: Ditto.
  • WebCore.vcproj/WebCore.vcproj: Ditto.
  • WebCore.xcodeproj/project.pbxproj: Ditto.
  • bindings/scripts/CodeGeneratorV8.pm: Add V8 magic, to avoid ambigious conversion warning in toV8(PassRefPtr<SVGAnimatedEnumeration>).
  • platform/graphics/GraphicsTypes.h: Cleanup GradientSpreadMethod, as the SVG dependency is gone.
  • platform/graphics/filters/FEBlend.cpp: (WebCore::FEBlend::apply): Turn early-returns (introduce in security patches a while ago) into ASSERTs, as the underlying bug has been fixed.
  • platform/graphics/filters/FEDisplacementMap.cpp: (WebCore::FEDisplacementMap::apply): Ditto.
  • rendering/svg/RenderSVGResourceClipper.h: Remove toUnitType() usage, the clipPathUnits() provided by SVGClipPathElement have the correct enum type now. (WebCore::RenderSVGResourceClipper::clipPathUnits):
  • rendering/svg/RenderSVGResourceFilter.h: Remove toUnitType() usage, the filterUnits()/primitiveUnits() provided by SVGFilterElement have the correct enum type now. (WebCore::RenderSVGResourceFilter::filterUnits): (WebCore::RenderSVGResourceFilter::primitiveUnits):
  • rendering/svg/RenderSVGResourceGradient.cpp: Add helper method platformSpreadMethodFromSVGType() converting from SVGGradientElement::SVGSpreadMethodType to GradientSpreadMethod (platform). (WebCore::RenderSVGResourceGradient::applyResource):
  • rendering/svg/RenderSVGResourceGradient.h: Ditto.
  • rendering/svg/RenderSVGResourceLinearGradient.cpp: (WebCore::RenderSVGResourceLinearGradient::buildGradient): Use platformSpreadMethodFromSVGType().
  • rendering/svg/RenderSVGResourceMarker.h: Remove toUnitType() usage, the markerUnits() provided by SVGMarkerElement have the correct enum type now. (WebCore::RenderSVGResourceMarker::markerUnits):
  • rendering/svg/RenderSVGResourceMasker.h: Remove toUnitType() usage, the maskUnits()/maskContentUnits() provided by SVGMaskElement have the correct enum type now. (WebCore::RenderSVGResourceMasker::maskUnits): (WebCore::RenderSVGResourceMasker::maskContentUnits):
  • rendering/svg/RenderSVGResourceRadialGradient.cpp: (WebCore::RenderSVGResourceRadialGradient::buildGradient): Use platformSpreadMethodFromSVGType().
  • rendering/svg/SVGRenderTreeAsText.cpp: (WebCore::operator<<): Use SVGPropertyTraits<SomeSVGEnumType>::toString() to convert from enum to string, remove code duplication. (WebCore::writeCommonGradientProperties):
  • rendering/svg/SVGTextChunkBuilder.cpp: (WebCore::SVGTextChunkBuilder::addTextChunk): Remove int->enum casting for SVGAnimatedEnumeration types, they are enums now.
  • rendering/svg/SVGTextLayoutEngine.cpp: (WebCore::SVGTextLayoutEngine::parentDefinesTextLength): Ditto. (WebCore::SVGTextLayoutEngine::beginTextPathLayout): Ditto.
  • svg/GradientAttributes.h: Change spread method type from platform GradientSpreadMethod to SVGSpreadMethodType. (WebCore::GradientAttributes::GradientAttributes): (WebCore::GradientAttributes::spreadMethod): (WebCore::GradientAttributes::setSpreadMethod):
  • svg/SVGAnimatedBoolean.idl: Enable potential exception raising on baseVal setting for the primitive types.
  • svg/SVGAnimatedEnumeration.h: Switch from generic SVGAnimatedStaticPropertyTearOff<int> to new SVGAnimatedEnumerationPropertyTearOff<EnumType>.
  • svg/SVGAnimatedEnumeration.idl: Enable potential exception raising on baseVal setting for the primitive types.

Only SVGAnimatedEnumeration makes use of this if the assigned value is out of range.

  • svg/SVGAnimatedInteger.idl: Ditto.
  • svg/SVGAnimatedNumber.idl: Ditto.
  • svg/SVGAnimatedString.idl: Ditto.
  • svg/SVGClipPathElement.cpp: (WebCore::SVGClipPathElement::parseMappedAttribute): Convert attribute parsing to use SVGPropertyTraits<EnumType>::fromString(attr->value()).
  • svg/SVGClipPathElement.h:
  • svg/SVGComponentTransferFunctionElement.cpp: (WebCore::SVGComponentTransferFunctionElement::SVGComponentTransferFunctionElement): Initialize type to identity, not unknown, as per spec. (WebCore::SVGComponentTransferFunctionElement::parseMappedAttribute): Convert attribute parsing to use SVGPropertyTraits<EnumType>::fromString(attr->value()). (WebCore::SVGComponentTransferFunctionElement::transferFunction): Remove int->enum casting for SVGAnimatedEnumeration types, they are enums now.
  • svg/SVGComponentTransferFunctionElement.h: Remove svgAttributeChanged() method, that verified the enum value is not out of range.

It's not possible anymore for these values to go out of range.

  • svg/SVGFEBlendElement.cpp: (WebCore::SVGFEBlendElement::parseMappedAttribute): Convert attribute parsing to use SVGPropertyTraits<BlendModeType>::fromString(attr->value()). (WebCore::SVGFEBlendElement::setFilterEffectAttribute): Remove int->enum casting for SVGAnimatedEnumeration types, they are enums now. (WebCore::SVGFEBlendElement::build): Ditto.
  • svg/SVGFEBlendElement.h: Add SVGPropertyTraits<BlendModeType> specializations.
  • svg/SVGFEColorMatrixElement.cpp: (WebCore::SVGFEColorMatrixElement::parseMappedAttribute): Convert attribute parsing to use SVGPropertyTraits<ColorMatrixType>::fromString(attr->value()). (WebCore::SVGFEColorMatrixElement::setFilterEffectAttribute): Remove int->enum casting for SVGAnimatedEnumeration types, they are enums now.. (WebCore::SVGFEColorMatrixElement::build): Ditto.
  • svg/SVGFEColorMatrixElement.h: Add SVGPropertyTraits<ColorMatrixType> specializations.
  • svg/SVGFECompositeElement.cpp: (WebCore::SVGFECompositeElement::parseMappedAttribute): Convert attribute parsing to use SVGPropertyTraits<CompositeOperationType>::fromString(attr->value()). (WebCore::SVGFECompositeElement::setFilterEffectAttribute): Remove int->enum casting for SVGAnimatedEnumeration types, they are enums now. (WebCore::SVGFECompositeElement::build): Ditto.
  • svg/SVGFECompositeElement.h: Add SVGPropertyTraits<CompositeOperationType> specializations.
  • svg/SVGFEConvolveMatrixElement.cpp: Fix typo, edgeMode needs to be associated with SVGNames::edgeModeAttr, not SVGNames::operatorAttr. (WebCore::SVGFEConvolveMatrixElement::parseMappedAttribute): Convert attribute parsing to use SVGPropertyTraits<EdgeModeType>::fromString(attr->value()). (WebCore::SVGFEConvolveMatrixElement::setFilterEffectAttribute): Remove int->enum casting for SVGAnimatedEnumeration types, they are enums now. (WebCore::SVGFEConvolveMatrixElement::synchronizeProperty): Add missing synchronizeProperty() implementation, otherwhise SVG DOM <-> XML DOM is not in sync. (WebCore::SVGFEConvolveMatrixElement::build): Remove int->enum casting for SVGAnimatedEnumeration types, they are enums now.
  • svg/SVGFEConvolveMatrixElement.h: Add SVGPropertyTraits<EdgeModeType> specializations.
  • svg/SVGFEDisplacementMapElement.cpp: (WebCore::SVGFEDisplacementMapElement::parseMappedAttribute): Convert attribute parsing to use SVGPropertyTraits<ChannelSelectorType>::fromString(attr->value()). (WebCore::SVGFEDisplacementMapElement::setFilterEffectAttribute): Remove int->enum casting for SVGAnimatedEnumeration types, they are enums now. (WebCore::SVGFEDisplacementMapElement::svgAttributeChanged): Remove range validation for enum types, they are always in range now. (WebCore::SVGFEDisplacementMapElement::build): Remove int->enum casting for SVGAnimatedEnumeration types, they are enums now.
  • svg/SVGFEDisplacementMapElement.h: Add SVGPropertyTraits<ChannelSelectorType> specializations.
  • svg/SVGFEMorphologyElement.cpp: (WebCore::SVGFEMorphologyElement::parseMappedAttribute): Convert attribute parsing to use SVGPropertyTraits<MorphologyOperatorType>::fromString(attr->value()). (WebCore::SVGFEMorphologyElement::setFilterEffectAttribute): Remove int->enum casting for SVGAnimatedEnumeration types, they are enums now. (WebCore::SVGFEMorphologyElement::build): Ditto.
  • svg/SVGFEMorphologyElement.h: Add SVGPropertyTraits<MorphologyOperatorType> specializations.
  • svg/SVGFETurbulenceElement.cpp: (WebCore::SVGFETurbulenceElement::parseMappedAttribute): Convert attribute parsing to use SVGPropertyTraits<SVGStitchOptions/TurbulenceType>::fromString(attr->value()). (WebCore::SVGFETurbulenceElement::setFilterEffectAttribute): Remove int->enum casting for SVGAnimatedEnumeration types, they are enums now. (WebCore::SVGFETurbulenceElement::build): Ditto.
  • svg/SVGFETurbulenceElement.h: Add SVGPropertyTraits<SVGStitchOptions/TurbulenceType> specializations.
  • svg/SVGFilterElement.cpp: (WebCore::SVGFilterElement::parseMappedAttribute): Convert attribute parsing to use SVGPropertyTraits<SVGUnitType>::fromString(attr->value()).
  • svg/SVGFilterElement.h:
  • svg/SVGGradientElement.cpp: (WebCore::SVGGradientElement::SVGGradientElement): Missing spread method default initialization: set it to 'pad' as per spec. (WebCore::SVGGradientElement::parseMappedAttribute): Convert attribute parsing to use SVGPropertyTraits<SVGUnitType/SVGSpreadMethodType>::fromString(attr->value()).
  • svg/SVGGradientElement.h: Add SVGPropertyTraits<SVGSpreadMethodType> specializations.
  • svg/SVGLinearGradientElement.cpp: (WebCore::SVGLinearGradientElement::collectGradientAttributes): Remove int->enum casting for SVGAnimatedEnumeration types, they are enums now.
  • svg/SVGMarkerElement.cpp: (WebCore::SVGMarkerElement::parseMappedAttribute): Convert attribute parsing to use SVGPropertyTraits<EnumType>::fromString(attr->value()). (WebCore::SVGMarkerElement::synchronizeOrientType): Add a custom synchronization method, that handles orientType/orientAngle -> orientAttr synchronization, which is special

as it depends on to other SVG DOM objects (SVGAnimatedAngle and SVGAnimatedEnumeration). All covered by new tests.

(WebCore::SVGMarkerElement::orientTypeAnimated): Custom tear off creation method, which would usually be generated by the DECLARE_ANIMATED_... macros.

  • svg/SVGMarkerElement.h: Add SVGPropertyTraits<SVGMarkerUnitsType/SVGMarkerOrientType> specializations. (WebCore::SVGMarkerElement::orientType): Add custom property handling for the 'orientType' SVGAnimatedEnumeration object, as it has special demands, based on 'orientAngle'. (WebCore::SVGMarkerElement::orientTypeBaseValue): Ditto. (WebCore::SVGMarkerElement::setOrientTypeBaseValue): Ditto.
  • svg/SVGMaskElement.cpp: (WebCore::SVGMaskElement::parseMappedAttribute): Convert attribute parsing to use SVGPropertyTraits<EnumType>::fromString(attr->value()).
  • svg/SVGMaskElement.h:
  • svg/SVGPatternElement.cpp: (WebCore::SVGPatternElement::parseMappedAttribute): Convert attribute parsing to use SVGPropertyTraits<EnumType>::fromString(attr->value()).
  • svg/SVGPatternElement.h:
  • svg/SVGRadialGradientElement.cpp: (WebCore::SVGRadialGradientElement::collectGradientAttributes): Remove int->enum casting for SVGAnimatedEnumeration types, they are enums now.
  • svg/SVGTextContentElement.cpp: (WebCore::SVGTextContentElement::parseMappedAttribute): Convert attribute parsing to use SVGPropertyTraits<SVGLengthAdjustType>::fromString(attr->value()).
  • svg/SVGTextContentElement.h: Add SVGPropertyTraits<SVGLengthAdjustType> specializations.
  • svg/SVGTextPathElement.cpp: (WebCore::SVGTextPathElement::parseMappedAttribute): Convert attribute parsing to use SVGPropertyTraits<SVGTextPathMethodType/SVGTextPathSpacingType>::fromString(attr->value()).
  • svg/SVGTextPathElement.h: Add SVGPropertyTraits<SVGTextPathMethodType/SVGTextPathSpacingType> specializations.
  • svg/SVGUnitTypes.h: Add SVGPropertyTraits<SVGUnitType> specializations.
  • svg/properties/SVGAnimatedEnumerationPropertyTearOff.h: Added. SVGAnimatedEnumerationPropertyTearOff inherits from SVGAnimatedStaticPropertyTearOff<int>.

SVGAnimatedEnumeration remains a typedef to SVGAnimatedStaticPropertyTearOff<int>, to have a common base
class for all enum types. This special tear off object, overrides setBaseVal, to verify the incoming int
is within the enum range, otherwhise raise an SVG DOM exception. This makes it impossible to make any of
the enums go out of range anymore (which lead to security bugs in the past).

(WebCore::SVGAnimatedEnumerationPropertyTearOff::setBaseVal):
(WebCore::SVGAnimatedEnumerationPropertyTearOff::create):
(WebCore::SVGAnimatedEnumerationPropertyTearOff::SVGAnimatedEnumerationPropertyTearOff):

  • svg/properties/SVGAnimatedStaticPropertyTearOff.h: (WebCore::SVGAnimatedStaticPropertyTearOff::setBaseVal): Made this method virtual, to SVGAnimatedEnumerationPropertyTearOff can override the default behaviour. Also added an ExceptionCode param. (WebCore::SVGAnimatedStaticPropertyTearOff::~SVGAnimatedStaticPropertyTearOff):
Location:
trunk
Files:
49 added
75 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r86764 r86765  
     12011-05-18  Nikolas Zimmermann  <nzimmermann@rim.com>
     2
     3        Reviewed by Rob Buis.
     4
     5        All animated SVG enum properties are now ints
     6        https://bugs.webkit.org/show_bug.cgi?id=10749
     7
     8        Add tests for all elements using SVGAnimatedEnumeration in the SVG DOM API.
     9
     10        * platform/mac/svg/dynamic-updates/SVGTextElement-svgdom-lengthAdjust-prop-expected.png: Update result, progression.
     11        * svg/dom/SVGAnimatedEnumeration-SVGClipPathElement-expected.txt: Added.
     12        * svg/dom/SVGAnimatedEnumeration-SVGClipPathElement.html: Added.
     13        * svg/dom/SVGAnimatedEnumeration-SVGComponentTransferFunctionElement-expected.txt: Added.
     14        * svg/dom/SVGAnimatedEnumeration-SVGComponentTransferFunctionElement.html: Added.
     15        * svg/dom/SVGAnimatedEnumeration-SVGFEBlendElement-expected.txt: Added.
     16        * svg/dom/SVGAnimatedEnumeration-SVGFEBlendElement.html: Added.
     17        * svg/dom/SVGAnimatedEnumeration-SVGFEColorMatrixElement-expected.txt: Added.
     18        * svg/dom/SVGAnimatedEnumeration-SVGFEColorMatrixElement.html: Added.
     19        * svg/dom/SVGAnimatedEnumeration-SVGFECompositeElement-expected.txt: Added.
     20        * svg/dom/SVGAnimatedEnumeration-SVGFECompositeElement.html: Added.
     21        * svg/dom/SVGAnimatedEnumeration-SVGFEConvolveMatrixElement-expected.txt: Added.
     22        * svg/dom/SVGAnimatedEnumeration-SVGFEConvolveMatrixElement.html: Added.
     23        * svg/dom/SVGAnimatedEnumeration-SVGFEDisplacementMapElement-expected.txt: Added.
     24        * svg/dom/SVGAnimatedEnumeration-SVGFEDisplacementMapElement.html: Added.
     25        * svg/dom/SVGAnimatedEnumeration-SVGFEMorphologyElement-expected.txt: Added.
     26        * svg/dom/SVGAnimatedEnumeration-SVGFEMorphologyElement.html: Added.
     27        * svg/dom/SVGAnimatedEnumeration-SVGFETurbulenceElement-expected.txt: Added.
     28        * svg/dom/SVGAnimatedEnumeration-SVGFETurbulenceElement.html: Added.
     29        * svg/dom/SVGAnimatedEnumeration-SVGFilterElement-expected.txt: Added.
     30        * svg/dom/SVGAnimatedEnumeration-SVGFilterElement.html: Added.
     31        * svg/dom/SVGAnimatedEnumeration-SVGGradientElement-expected.txt: Added.
     32        * svg/dom/SVGAnimatedEnumeration-SVGGradientElement.html: Added.
     33        * svg/dom/SVGAnimatedEnumeration-SVGMarkerElement-expected.txt: Added.
     34        * svg/dom/SVGAnimatedEnumeration-SVGMarkerElement.html: Added.
     35        * svg/dom/SVGAnimatedEnumeration-SVGMaskElement-expected.txt: Added.
     36        * svg/dom/SVGAnimatedEnumeration-SVGMaskElement.html: Added.
     37        * svg/dom/SVGAnimatedEnumeration-SVGPatternElement-expected.txt: Added.
     38        * svg/dom/SVGAnimatedEnumeration-SVGPatternElement.html: Added.
     39        * svg/dom/SVGAnimatedEnumeration-SVGTextContentElement-expected.txt: Added.
     40        * svg/dom/SVGAnimatedEnumeration-SVGTextContentElement.html: Added.
     41        * svg/dom/SVGAnimatedEnumeration-SVGTextPathElement-expected.txt: Added.
     42        * svg/dom/SVGAnimatedEnumeration-SVGTextPathElement.html: Added.
     43        * svg/dom/SVGAnimatedEnumeration-expected.txt:
     44        * svg/dom/script-tests/SVGAnimatedEnumeration-SVGClipPathElement.js: Added.
     45        * svg/dom/script-tests/SVGAnimatedEnumeration-SVGComponentTransferFunctionElement.js: Added.
     46        * svg/dom/script-tests/SVGAnimatedEnumeration-SVGFEBlendElement.js: Added.
     47        * svg/dom/script-tests/SVGAnimatedEnumeration-SVGFEColorMatrixElement.js: Added.
     48        * svg/dom/script-tests/SVGAnimatedEnumeration-SVGFECompositeElement.js: Added.
     49        * svg/dom/script-tests/SVGAnimatedEnumeration-SVGFEConvolveMatrixElement.js: Added.
     50        * svg/dom/script-tests/SVGAnimatedEnumeration-SVGFEDisplacementMapElement.js: Added.
     51        * svg/dom/script-tests/SVGAnimatedEnumeration-SVGFEMorphologyElement.js: Added.
     52        * svg/dom/script-tests/SVGAnimatedEnumeration-SVGFETurbulenceElement.js: Added.
     53        * svg/dom/script-tests/SVGAnimatedEnumeration-SVGFilterElement.js: Added.
     54        * svg/dom/script-tests/SVGAnimatedEnumeration-SVGGradientElement.js: Added.
     55        * svg/dom/script-tests/SVGAnimatedEnumeration-SVGMarkerElement.js: Added.
     56        * svg/dom/script-tests/SVGAnimatedEnumeration-SVGMaskElement.js: Added.
     57        * svg/dom/script-tests/SVGAnimatedEnumeration-SVGPatternElement.js: Added.
     58        * svg/dom/script-tests/SVGAnimatedEnumeration-SVGTextContentElement.js: Added.
     59        * svg/dom/script-tests/SVGAnimatedEnumeration-SVGTextPathElement.js: Added.
     60        * svg/dom/script-tests/SVGAnimatedEnumeration.js:
     61        * svg/dynamic-updates/SVGTextElement-svgdom-lengthAdjust-prop-expected.txt:
     62        * svg/dynamic-updates/script-tests/SVGTextElement-svgdom-lengthAdjust-prop.js:
     63        (executeTest):
     64        * svg/filters/feBlend-invalid-mode-expected.txt:
     65        * svg/filters/feComponentTransfer-style-crash-expected.txt:
     66        * svg/filters/feComponentTransfer-style-crash.xhtml:
     67        * svg/filters/feDisplacementMap-crash-test-expected.txt:
     68        * svg/filters/feDisplacementMap-crash-test.xhtml:
     69
    1702011-05-18  Kinuko Yasuda  <kinuko@chromium.org>
    271
  • trunk/LayoutTests/svg/dom/SVGAnimatedEnumeration-expected.txt

    r72123 r86765  
    1111
    1212Check that enumerations are static, caching value in a local variable and modifying it, should have no effect
    13 PASS enumRef is SVGUnitTypes.SVG_UNIT_TYPE_UNKNOWN
     13PASS enumRef is SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
    1414PASS clipPathElement.clipPathUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE
    1515
    1616Check assigning various valid and invalid values
    17 FAIL clipPathElement.clipPathUnits.baseVal = 3 should throw an exception. Was 3.
     17PASS clipPathElement.clipPathUnits.baseVal = 3 threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1.
     18PASS clipPathElement.clipPathUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE
     19PASS clipPathElement.clipPathUnits.baseVal = -1 threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1.
     20PASS clipPathElement.clipPathUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE
     21PASS clipPathElement.clipPathUnits.baseVal = '1' is "1"
     22PASS clipPathElement.clipPathUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE
     23PASS clipPathElement.clipPathUnits.baseVal = 'aString' threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1.
     24PASS clipPathElement.clipPathUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE
    1825PASS clipPathElement.clipPathUnits.baseVal = 2 is SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
    19 FAIL clipPathElement.clipPathUnits.baseVal = -1 should throw an exception. Was -1.
    20 PASS clipPathElement.clipPathUnits.baseVal = 'aString' is 'aString'
    21 PASS clipPathElement.clipPathUnits.baseVal is 0
    22 PASS clipPathElement.clipPathUnits.baseVal = 2 is SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
    23 PASS clipPathElement.clipPathUnits.baseVal = clipPathElement is clipPathElement
    24 PASS clipPathElement.clipPathUnits.baseVal is 0
    25 PASS clipPathElement.clipPathUnits.baseVal = 2 is SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
    26 
    27 Check that the clipPathUnits value remained objectBBox
     26PASS clipPathElement.clipPathUnits.baseVal = clipPathElement threw exception Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1.
    2827PASS clipPathElement.clipPathUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
    2928PASS successfullyParsed is true
  • trunk/LayoutTests/svg/dom/script-tests/SVGAnimatedEnumeration.js

    r72123 r86765  
    1212debug("Check that enumerations are static, caching value in a local variable and modifying it, should have no effect");
    1313var enumRef = clipPathElement.clipPathUnits.baseVal;
    14 enumRef = SVGUnitTypes.SVG_UNIT_TYPE_UNKNOWN;
    15 shouldBe("enumRef", "SVGUnitTypes.SVG_UNIT_TYPE_UNKNOWN");
     14enumRef = SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX;
     15shouldBe("enumRef", "SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX");
    1616shouldBe("clipPathElement.clipPathUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE");
    1717
    1818debug("");
    1919debug("Check assigning various valid and invalid values");
    20 shouldThrow("clipPathElement.clipPathUnits.baseVal = 3"); // FIXME: Doesn't throw in WebKit, we're not clamping to the allowed range.
     20shouldThrow("clipPathElement.clipPathUnits.baseVal = 3");
     21shouldBe("clipPathElement.clipPathUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE");
     22shouldThrow("clipPathElement.clipPathUnits.baseVal = -1");
     23shouldBe("clipPathElement.clipPathUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE");
     24
     25// ECMA-262, 9.7, "ToUint16"
     26shouldBeEqualToString("clipPathElement.clipPathUnits.baseVal = '1'", SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE.toString());
     27shouldBe("clipPathElement.clipPathUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE");
     28
     29// ECMA-262, 9.7, "ToUint16"
     30shouldThrow("clipPathElement.clipPathUnits.baseVal = 'aString'");
     31shouldBe("clipPathElement.clipPathUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE");
     32
    2133shouldBe("clipPathElement.clipPathUnits.baseVal = 2", "SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX");
    22 shouldThrow("clipPathElement.clipPathUnits.baseVal = -1"); // FIXME: Doesn't throw in WebKit, we're not clamping to the allowed range.
    23 // ECMA-262, 9.7, "ToUint16"
    24 shouldBe("clipPathElement.clipPathUnits.baseVal = 'aString'", "'aString'");
    25 shouldBe("clipPathElement.clipPathUnits.baseVal", "0");
    26 shouldBe("clipPathElement.clipPathUnits.baseVal = 2", "SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX");
    27 shouldBe("clipPathElement.clipPathUnits.baseVal = clipPathElement", "clipPathElement");
    28 shouldBe("clipPathElement.clipPathUnits.baseVal", "0");
    29 shouldBe("clipPathElement.clipPathUnits.baseVal = 2", "SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX");
    30 
    31 debug("");
    32 debug("Check that the clipPathUnits value remained objectBBox");
     34shouldThrow("clipPathElement.clipPathUnits.baseVal = clipPathElement");
    3335shouldBe("clipPathElement.clipPathUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX");
    3436
  • trunk/LayoutTests/svg/dynamic-updates/SVGTextElement-svgdom-lengthAdjust-prop-expected.txt

    r83710 r86765  
    1111PASS textElement.textLength.baseVal.value is 200
    1212PASS lastLength = textElement.getComputedTextLength(); lastLength > 0 && lastLength < 200 is true
    13 FAIL textElement.getAttribute('lengthAdjust') should be spacingAndGlyphs. Was 2.
     13PASS textElement.getAttribute('lengthAdjust') is "spacingAndGlyphs"
    1414PASS textElement.lengthAdjust.baseVal is SVGTextContentElement.LENGTHADJUST_SPACINGANDGLYPHS
    1515PASS textElement.textLength.baseVal.value is 200
  • trunk/LayoutTests/svg/dynamic-updates/script-tests/SVGTextElement-svgdom-lengthAdjust-prop.js

    r83710 r86765  
    1919function executeTest() {
    2020    textElement.lengthAdjust.baseVal = SVGTextContentElement.LENGTHADJUST_SPACINGANDGLYPHS;
    21     // FIXME: This currently fails, as the attribute value is "2" instead of "spacingAndGlyphs". Investigate.
    2221    shouldBeEqualToString("textElement.getAttribute('lengthAdjust')", "spacingAndGlyphs");
    2322    shouldBe("textElement.lengthAdjust.baseVal", "SVGTextContentElement.LENGTHADJUST_SPACINGANDGLYPHS");
  • trunk/LayoutTests/svg/filters/feBlend-invalid-mode-expected.txt

    r70652 r86765  
     1CONSOLE MESSAGE: line 14: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1: An invalid value was passed to an operation or assigned to an attribute.
    12PASS: Invalid blend modes do not trigger a crash.
  • trunk/LayoutTests/svg/filters/feComponentTransfer-style-crash-expected.txt

    r82351 r86765  
     1ALERT: Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1
    12PASS
  • trunk/LayoutTests/svg/filters/feComponentTransfer-style-crash.xhtml

    r82351 r86765  
    99window.onload = function()
    1010{
    11     document.getElementById('tgt').type.baseVal=99999;
     11    try {
     12        document.getElementById('tgt').type.baseVal=99999;
     13    } catch (e) {
     14        alert (e);
     15    }
     16
    1217    setTimeout(function () {
    1318            document.body.innerHTML = "PASS";
  • trunk/LayoutTests/svg/filters/feDisplacementMap-crash-test-expected.txt

    r81689 r86765  
     1ALERT: Error: SVG_INVALID_VALUE_ERR: DOM SVG Exception 1
    12PASS
  • trunk/LayoutTests/svg/filters/feDisplacementMap-crash-test.xhtml

    r81689 r86765  
    1010window.onload = function()
    1111{
    12     document.getElementById('d').xChannelSelector.baseVal=0x80000000;
    13     document.getElementById('d').yChannelSelector.baseVal=0x40000000;
     12    try {
     13        document.getElementById('d').xChannelSelector.baseVal=0x80000000;
     14        document.getElementById('d').yChannelSelector.baseVal=0x40000000;
     15    } catch(e) {
     16        alert (e);
     17    }
     18
    1419    setTimeout(function () {
    1520            document.body.innerHTML = "PASS";
  • trunk/Source/WebCore/ChangeLog

    r86764 r86765  
     12011-05-18  Nikolas Zimmermann  <nzimmermann@rim.com>
     2
     3        Reviewed by Rob Buis.
     4
     5        All animated SVG enum properties are now ints
     6        https://bugs.webkit.org/show_bug.cgi?id=10749
     7
     8        DECLARE/DEFINE_ANIMATED_ENUMERATION created fooBaseVal()/setFooBaseVal() methods that take int parameters, and stored all enum types as integers.
     9        Modify the SVG DOM API to store real enums, and get rid of any int<->enum conversions. It's now impossible to change any enum values to undefined
     10        types, which is the root of several filter security bugs in the past, that were fixed by adding workarounds.
     11        (Usual workaround: svgAttributeChanged(): if fooAttr has been changed from SVG DOM, and if it's an enum, check whether the enum is in range, or fix it up.)
     12
     13        Using a type-safe internal representation for these enum values we can get rid of ugly int<->enum conversions.
     14        A lot of parseMappedAttribute() functions duplicated the code for parsing enum values (eg. userSpaceOnUse/objectBoundingBox unit values, in pattern/filter/mask/etc..)
     15        Add dozens of new SVGPropertyTraits<EnumType> specializations for all enums we expose to JS, and offer static fromString/toString conversion methods in single places.
     16        Use the new SVGPropertyTraits everywhere in svg/.
     17
     18        This also fixes SVG DOM <-> XML DOM synchronization for SVGAnimatedEnumeration types.
     19        Example: <clipPath clipPathUnits="objectBoundingBox">
     20        myClipPath.clipPathUnits.baseVal = SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE;
     21        alert(myClipPath.getAttribute('clipPathUnits')); <- without this patch it says "1", now it says "userSpaceOnUse" as expected, and as other browsers do.
     22        We're now properly converting the enum values to strings.
     23
     24        Add testcases for all SVGAnimatedEnumeration objects used in the SVG DOM API. Found several small bugs:
     25        - SVGFEConvolveMatrix 'edgeMode' SVG DOM <-> XML DOM synchronization was not working, because of a typo: s/operatorAttr/edgeModeAttr
     26        - SVGFEConvolveMatrix was missing an synchronizeProperty() implementation, disabling SVG <-> XML DOM synchronization completly.
     27
     28        Tests: svg/dom/SVGAnimatedEnumeration-SVGClipPathElement.html
     29               svg/dom/SVGAnimatedEnumeration-SVGComponentTransferFunctionElement.html
     30               svg/dom/SVGAnimatedEnumeration-SVGFEBlendElement.html
     31               svg/dom/SVGAnimatedEnumeration-SVGFEColorMatrixElement.html
     32               svg/dom/SVGAnimatedEnumeration-SVGFECompositeElement.html
     33               svg/dom/SVGAnimatedEnumeration-SVGFEConvolveMatrixElement.html
     34               svg/dom/SVGAnimatedEnumeration-SVGFEDisplacementMapElement.html
     35               svg/dom/SVGAnimatedEnumeration-SVGFEMorphologyElement.html
     36               svg/dom/SVGAnimatedEnumeration-SVGFETurbulenceElement.html
     37               svg/dom/SVGAnimatedEnumeration-SVGFilterElement.html
     38               svg/dom/SVGAnimatedEnumeration-SVGGradientElement.html
     39               svg/dom/SVGAnimatedEnumeration-SVGMarkerElement.html
     40               svg/dom/SVGAnimatedEnumeration-SVGMaskElement.html
     41               svg/dom/SVGAnimatedEnumeration-SVGPatternElement.html
     42               svg/dom/SVGAnimatedEnumeration-SVGTextContentElement.html
     43               svg/dom/SVGAnimatedEnumeration-SVGTextPathElement.html
     44
     45        Fixes existing svg/dynamic-update/SVGTextContentElement-svgdom-lengthAdjust-prop.html where I found the bug initially.
     46
     47        * GNUmakefile.list.am: Add svg/properties/SVGAnimatedEnumerationPropertyTearOff.h to build.
     48        * WebCore.gypi: Ditto.
     49        * WebCore.pro: Ditto.
     50        * WebCore.vcproj/WebCore.vcproj: Ditto.
     51        * WebCore.xcodeproj/project.pbxproj: Ditto.
     52        * bindings/scripts/CodeGeneratorV8.pm: Add V8 magic, to avoid ambigious conversion warning in toV8(PassRefPtr<SVGAnimatedEnumeration>).
     53        * platform/graphics/GraphicsTypes.h: Cleanup GradientSpreadMethod, as the SVG dependency is gone.
     54        * platform/graphics/filters/FEBlend.cpp:
     55        (WebCore::FEBlend::apply): Turn early-returns (introduce in security patches a while ago) into ASSERTs, as the underlying bug has been fixed.
     56        * platform/graphics/filters/FEDisplacementMap.cpp:
     57        (WebCore::FEDisplacementMap::apply): Ditto.
     58        * rendering/svg/RenderSVGResourceClipper.h: Remove toUnitType() usage, the clipPathUnits() provided by SVGClipPathElement have the correct enum type now.
     59        (WebCore::RenderSVGResourceClipper::clipPathUnits):
     60        * rendering/svg/RenderSVGResourceFilter.h: Remove toUnitType() usage, the filterUnits()/primitiveUnits() provided by SVGFilterElement have the correct enum type now.
     61        (WebCore::RenderSVGResourceFilter::filterUnits):
     62        (WebCore::RenderSVGResourceFilter::primitiveUnits):
     63        * rendering/svg/RenderSVGResourceGradient.cpp: Add helper method platformSpreadMethodFromSVGType() converting from SVGGradientElement::SVGSpreadMethodType to GradientSpreadMethod (platform).
     64        (WebCore::RenderSVGResourceGradient::applyResource):
     65        * rendering/svg/RenderSVGResourceGradient.h: Ditto.
     66        * rendering/svg/RenderSVGResourceLinearGradient.cpp:
     67        (WebCore::RenderSVGResourceLinearGradient::buildGradient): Use platformSpreadMethodFromSVGType().
     68        * rendering/svg/RenderSVGResourceMarker.h: Remove toUnitType() usage, the markerUnits() provided by SVGMarkerElement have the correct enum type now.
     69        (WebCore::RenderSVGResourceMarker::markerUnits):
     70        * rendering/svg/RenderSVGResourceMasker.h: Remove toUnitType() usage, the maskUnits()/maskContentUnits() provided by SVGMaskElement have the correct enum type now.
     71        (WebCore::RenderSVGResourceMasker::maskUnits):
     72        (WebCore::RenderSVGResourceMasker::maskContentUnits):
     73        * rendering/svg/RenderSVGResourceRadialGradient.cpp:
     74        (WebCore::RenderSVGResourceRadialGradient::buildGradient): Use platformSpreadMethodFromSVGType().
     75        * rendering/svg/SVGRenderTreeAsText.cpp:
     76        (WebCore::operator<<): Use SVGPropertyTraits<SomeSVGEnumType>::toString() to convert from enum to string, remove code duplication.
     77        (WebCore::writeCommonGradientProperties):
     78        * rendering/svg/SVGTextChunkBuilder.cpp:
     79        (WebCore::SVGTextChunkBuilder::addTextChunk): Remove int->enum casting for SVGAnimatedEnumeration types, they are enums now.
     80        * rendering/svg/SVGTextLayoutEngine.cpp:
     81        (WebCore::SVGTextLayoutEngine::parentDefinesTextLength): Ditto.
     82        (WebCore::SVGTextLayoutEngine::beginTextPathLayout): Ditto.
     83        * svg/GradientAttributes.h: Change spread method type from platform GradientSpreadMethod to SVGSpreadMethodType.
     84        (WebCore::GradientAttributes::GradientAttributes):
     85        (WebCore::GradientAttributes::spreadMethod):
     86        (WebCore::GradientAttributes::setSpreadMethod):
     87        * svg/SVGAnimatedBoolean.idl: Enable potential exception raising on baseVal setting for the primitive types.
     88        * svg/SVGAnimatedEnumeration.h: Switch from generic SVGAnimatedStaticPropertyTearOff<int> to new SVGAnimatedEnumerationPropertyTearOff<EnumType>.
     89        * svg/SVGAnimatedEnumeration.idl: Enable potential exception raising on baseVal setting for the primitive types.
     90                                          Only SVGAnimatedEnumeration makes use of this if the assigned value is out of range.
     91        * svg/SVGAnimatedInteger.idl: Ditto.
     92        * svg/SVGAnimatedNumber.idl: Ditto.
     93        * svg/SVGAnimatedString.idl: Ditto.
     94        * svg/SVGClipPathElement.cpp:
     95        (WebCore::SVGClipPathElement::parseMappedAttribute): Convert attribute parsing to use SVGPropertyTraits<EnumType>::fromString(attr->value()).
     96        * svg/SVGClipPathElement.h:
     97        * svg/SVGComponentTransferFunctionElement.cpp:
     98        (WebCore::SVGComponentTransferFunctionElement::SVGComponentTransferFunctionElement): Initialize type to identity, not unknown, as per spec.
     99        (WebCore::SVGComponentTransferFunctionElement::parseMappedAttribute): Convert attribute parsing to use SVGPropertyTraits<EnumType>::fromString(attr->value()).
     100        (WebCore::SVGComponentTransferFunctionElement::transferFunction): Remove int->enum casting for SVGAnimatedEnumeration types, they are enums now.
     101        * svg/SVGComponentTransferFunctionElement.h: Remove svgAttributeChanged() method, that verified the enum value is not out of range.
     102                                                     It's not possible anymore for these values to go out of range.
     103        * svg/SVGFEBlendElement.cpp:
     104        (WebCore::SVGFEBlendElement::parseMappedAttribute): Convert attribute parsing to use SVGPropertyTraits<BlendModeType>::fromString(attr->value()).
     105        (WebCore::SVGFEBlendElement::setFilterEffectAttribute): Remove int->enum casting for SVGAnimatedEnumeration types, they are enums now.
     106        (WebCore::SVGFEBlendElement::build): Ditto.
     107        * svg/SVGFEBlendElement.h: Add SVGPropertyTraits<BlendModeType> specializations.
     108        * svg/SVGFEColorMatrixElement.cpp:
     109        (WebCore::SVGFEColorMatrixElement::parseMappedAttribute): Convert attribute parsing to use SVGPropertyTraits<ColorMatrixType>::fromString(attr->value()).
     110        (WebCore::SVGFEColorMatrixElement::setFilterEffectAttribute): Remove int->enum casting for SVGAnimatedEnumeration types, they are enums now..
     111        (WebCore::SVGFEColorMatrixElement::build): Ditto.
     112        * svg/SVGFEColorMatrixElement.h: Add SVGPropertyTraits<ColorMatrixType> specializations.
     113        * svg/SVGFECompositeElement.cpp:
     114        (WebCore::SVGFECompositeElement::parseMappedAttribute): Convert attribute parsing to use SVGPropertyTraits<CompositeOperationType>::fromString(attr->value()).
     115        (WebCore::SVGFECompositeElement::setFilterEffectAttribute): Remove int->enum casting for SVGAnimatedEnumeration types, they are enums now.
     116        (WebCore::SVGFECompositeElement::build): Ditto.
     117        * svg/SVGFECompositeElement.h: Add SVGPropertyTraits<CompositeOperationType> specializations.
     118        * svg/SVGFEConvolveMatrixElement.cpp: Fix typo, edgeMode needs to be associated with SVGNames::edgeModeAttr, not SVGNames::operatorAttr.
     119        (WebCore::SVGFEConvolveMatrixElement::parseMappedAttribute): Convert attribute parsing to use SVGPropertyTraits<EdgeModeType>::fromString(attr->value()).
     120        (WebCore::SVGFEConvolveMatrixElement::setFilterEffectAttribute): Remove int->enum casting for SVGAnimatedEnumeration types, they are enums now.
     121        (WebCore::SVGFEConvolveMatrixElement::synchronizeProperty): Add missing synchronizeProperty() implementation, otherwhise SVG DOM <-> XML DOM is not in sync.
     122        (WebCore::SVGFEConvolveMatrixElement::build): Remove int->enum casting for SVGAnimatedEnumeration types, they are enums now.
     123        * svg/SVGFEConvolveMatrixElement.h: Add SVGPropertyTraits<EdgeModeType> specializations.
     124        * svg/SVGFEDisplacementMapElement.cpp:
     125        (WebCore::SVGFEDisplacementMapElement::parseMappedAttribute): Convert attribute parsing to use SVGPropertyTraits<ChannelSelectorType>::fromString(attr->value()).
     126        (WebCore::SVGFEDisplacementMapElement::setFilterEffectAttribute): Remove int->enum casting for SVGAnimatedEnumeration types, they are enums now.
     127        (WebCore::SVGFEDisplacementMapElement::svgAttributeChanged): Remove range validation for enum types, they are always in range now.
     128        (WebCore::SVGFEDisplacementMapElement::build): Remove int->enum casting for SVGAnimatedEnumeration types, they are enums now.
     129        * svg/SVGFEDisplacementMapElement.h: Add SVGPropertyTraits<ChannelSelectorType> specializations.
     130        * svg/SVGFEMorphologyElement.cpp:
     131        (WebCore::SVGFEMorphologyElement::parseMappedAttribute): Convert attribute parsing to use SVGPropertyTraits<MorphologyOperatorType>::fromString(attr->value()).
     132        (WebCore::SVGFEMorphologyElement::setFilterEffectAttribute): Remove int->enum casting for SVGAnimatedEnumeration types, they are enums now.
     133        (WebCore::SVGFEMorphologyElement::build): Ditto.
     134        * svg/SVGFEMorphologyElement.h: Add SVGPropertyTraits<MorphologyOperatorType> specializations.
     135        * svg/SVGFETurbulenceElement.cpp:
     136        (WebCore::SVGFETurbulenceElement::parseMappedAttribute): Convert attribute parsing to use SVGPropertyTraits<SVGStitchOptions/TurbulenceType>::fromString(attr->value()).
     137        (WebCore::SVGFETurbulenceElement::setFilterEffectAttribute): Remove int->enum casting for SVGAnimatedEnumeration types, they are enums now.
     138        (WebCore::SVGFETurbulenceElement::build): Ditto.
     139        * svg/SVGFETurbulenceElement.h: Add SVGPropertyTraits<SVGStitchOptions/TurbulenceType> specializations.
     140        * svg/SVGFilterElement.cpp:
     141        (WebCore::SVGFilterElement::parseMappedAttribute): Convert attribute parsing to use SVGPropertyTraits<SVGUnitType>::fromString(attr->value()).
     142        * svg/SVGFilterElement.h:
     143        * svg/SVGGradientElement.cpp:
     144        (WebCore::SVGGradientElement::SVGGradientElement): Missing spread method default initialization: set it to 'pad' as per spec.
     145        (WebCore::SVGGradientElement::parseMappedAttribute): Convert attribute parsing to use SVGPropertyTraits<SVGUnitType/SVGSpreadMethodType>::fromString(attr->value()).
     146        * svg/SVGGradientElement.h: Add SVGPropertyTraits<SVGSpreadMethodType> specializations.
     147        * svg/SVGLinearGradientElement.cpp:
     148        (WebCore::SVGLinearGradientElement::collectGradientAttributes): Remove int->enum casting for SVGAnimatedEnumeration types, they are enums now.
     149        * svg/SVGMarkerElement.cpp:
     150        (WebCore::SVGMarkerElement::parseMappedAttribute): Convert attribute parsing to use SVGPropertyTraits<EnumType>::fromString(attr->value()).
     151        (WebCore::SVGMarkerElement::synchronizeOrientType): Add a custom synchronization method, that handles orientType/orientAngle -> orientAttr synchronization, which is special
     152                                                            as it depends on to other SVG DOM objects (SVGAnimatedAngle and SVGAnimatedEnumeration). All covered by new tests.
     153        (WebCore::SVGMarkerElement::orientTypeAnimated): Custom tear off creation method, which would usually be generated by the DECLARE_ANIMATED_... macros.
     154        * svg/SVGMarkerElement.h: Add SVGPropertyTraits<SVGMarkerUnitsType/SVGMarkerOrientType> specializations.
     155        (WebCore::SVGMarkerElement::orientType): Add custom property handling for the 'orientType' SVGAnimatedEnumeration object, as it has special demands, based on 'orientAngle'.
     156        (WebCore::SVGMarkerElement::orientTypeBaseValue): Ditto.
     157        (WebCore::SVGMarkerElement::setOrientTypeBaseValue): Ditto.
     158        * svg/SVGMaskElement.cpp:
     159        (WebCore::SVGMaskElement::parseMappedAttribute): Convert attribute parsing to use SVGPropertyTraits<EnumType>::fromString(attr->value()).
     160        * svg/SVGMaskElement.h:
     161        * svg/SVGPatternElement.cpp:
     162        (WebCore::SVGPatternElement::parseMappedAttribute): Convert attribute parsing to use SVGPropertyTraits<EnumType>::fromString(attr->value()).
     163        * svg/SVGPatternElement.h:
     164        * svg/SVGRadialGradientElement.cpp:
     165        (WebCore::SVGRadialGradientElement::collectGradientAttributes): Remove int->enum casting for SVGAnimatedEnumeration types, they are enums now.
     166        * svg/SVGTextContentElement.cpp:
     167        (WebCore::SVGTextContentElement::parseMappedAttribute): Convert attribute parsing to use SVGPropertyTraits<SVGLengthAdjustType>::fromString(attr->value()).
     168        * svg/SVGTextContentElement.h: Add SVGPropertyTraits<SVGLengthAdjustType> specializations.
     169        * svg/SVGTextPathElement.cpp:
     170        (WebCore::SVGTextPathElement::parseMappedAttribute): Convert attribute parsing to use SVGPropertyTraits<SVGTextPathMethodType/SVGTextPathSpacingType>::fromString(attr->value()).
     171        * svg/SVGTextPathElement.h: Add SVGPropertyTraits<SVGTextPathMethodType/SVGTextPathSpacingType> specializations.
     172        * svg/SVGUnitTypes.h: Add SVGPropertyTraits<SVGUnitType> specializations.
     173        * svg/properties/SVGAnimatedEnumerationPropertyTearOff.h: Added. SVGAnimatedEnumerationPropertyTearOff inherits from SVGAnimatedStaticPropertyTearOff<int>.
     174                                                                  SVGAnimatedEnumeration remains a typedef to SVGAnimatedStaticPropertyTearOff<int>, to have a common base
     175                                                                  class for all enum types. This special tear off object, overrides setBaseVal, to verify the incoming int
     176                                                                  is within the enum range, otherwhise raise an SVG DOM exception. This makes it impossible to make any of
     177                                                                  the enums go out of range anymore (which lead to security bugs in the past).
     178        (WebCore::SVGAnimatedEnumerationPropertyTearOff::setBaseVal):
     179        (WebCore::SVGAnimatedEnumerationPropertyTearOff::create):
     180        (WebCore::SVGAnimatedEnumerationPropertyTearOff::SVGAnimatedEnumerationPropertyTearOff):
     181        * svg/properties/SVGAnimatedStaticPropertyTearOff.h:
     182        (WebCore::SVGAnimatedStaticPropertyTearOff::setBaseVal): Made this method virtual, to SVGAnimatedEnumerationPropertyTearOff can override the default behaviour. Also added an ExceptionCode param.
     183        (WebCore::SVGAnimatedStaticPropertyTearOff::~SVGAnimatedStaticPropertyTearOff):
     184
    11852011-05-18  Kinuko Yasuda  <kinuko@chromium.org>
    2186
  • trunk/Source/WebCore/GNUmakefile.list.am

    r86764 r86765  
    32433243        Source/WebCore/svg/LinearGradientAttributes.h \
    32443244        Source/WebCore/svg/PatternAttributes.h \
     3245        Source/WebCore/svg/properties/SVGAnimatedEnumerationPropertyTearOff.h \
    32453246        Source/WebCore/svg/properties/SVGAnimatedListPropertyTearOff.h \
    32463247        Source/WebCore/svg/properties/SVGAnimatedPathSegListPropertyTearOff.h \
  • trunk/Source/WebCore/WebCore.gypi

    r86764 r86765  
    10621062            'svg/animation/SMILTime.h',
    10631063            'svg/animation/SVGSMILElement.h',
     1064            'svg/properties/SVGAnimatedEnumerationPropertyTearOff.h',
    10641065            'svg/properties/SVGAnimatedListPropertyTearOff.h',
    10651066            'svg/properties/SVGAnimatedProperty.h',
  • trunk/Source/WebCore/WebCore.pro

    r86726 r86765  
    22632263    svg/graphics/filters/SVGFilter.h \
    22642264    svg/graphics/SVGImage.h \
     2265    svg/properties/SVGAnimatedEnumerationPropertyTearOff.h \
    22652266    svg/properties/SVGAnimatedListPropertyTearOff.h \
    22662267    svg/properties/SVGAnimatedPathSegListPropertyTearOff.h \
  • trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj

    r86764 r86765  
    6541865418                                >
    6541965419                                <File
     65420                                        RelativePath="..\svg\properties\SVGAnimatedEnumerationPropertyTearOff.h"
     65421                                        >
     65422                                </File>
     65423                                <File
    6542065424                                        RelativePath="..\svg\properties\SVGAnimatedListPropertyTearOff.h"
    6542165425                                        >
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r86764 r86765  
    15501550                6EE8A77210F803F3005A4A24 /* JSWebGLContextAttributes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6EE8A77010F803F3005A4A24 /* JSWebGLContextAttributes.cpp */; };
    15511551                6EE8A77310F803F3005A4A24 /* JSWebGLContextAttributes.h in Headers */ = {isa = PBXBuildFile; fileRef = 6EE8A77110F803F3005A4A24 /* JSWebGLContextAttributes.h */; };
     1552                71FB967B1383D64600AC8A4C /* SVGAnimatedEnumerationPropertyTearOff.h in Headers */ = {isa = PBXBuildFile; fileRef = 71FB967A1383D64600AC8A4C /* SVGAnimatedEnumerationPropertyTearOff.h */; settings = {ATTRIBUTES = (Private, ); }; };
    15521553                72626E020EF022FE00A07E20 /* FontFastPath.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 72626E010EF022FE00A07E20 /* FontFastPath.cpp */; };
    15531554                750D029311D0E7F300BD1B27 /* RenderInputSpeech.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 750D029111D0E7F300BD1B27 /* RenderInputSpeech.cpp */; };
     
    40934094                B1827493134CA4C100B98C2D /* CallbackFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B1827492134CA4C100B98C2D /* CallbackFunction.cpp */; };
    40944095                B1D5ECB5134B58DA0087C78F /* CallbackFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = B1D5ECB4134B58DA0087C78F /* CallbackFunction.h */; };
     4096                B1E54593134629C10092A545 /* CallbackTask.h in Headers */ = {isa = PBXBuildFile; fileRef = B1E54587134629C10092A545 /* CallbackTask.h */; };
    40954097                B1E54594134629C10092A545 /* MediaStreamClient.h in Headers */ = {isa = PBXBuildFile; fileRef = B1E54588134629C10092A545 /* MediaStreamClient.h */; };
    40964098                B1E54595134629C10092A545 /* MediaStreamFrameController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B1E54589134629C10092A545 /* MediaStreamFrameController.cpp */; };
     
    40984100                B1E54597134629C10092A545 /* MediaStreamController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B1E5458B134629C10092A545 /* MediaStreamController.cpp */; };
    40994101                B1E54598134629C10092A545 /* MediaStreamController.h in Headers */ = {isa = PBXBuildFile; fileRef = B1E5458C134629C10092A545 /* MediaStreamController.h */; };
    4100                 B1E54593134629C10092A545 /* CallbackTask.h in Headers */ = {isa = PBXBuildFile; fileRef = B1E54587134629C10092A545 /* CallbackTask.h */; };
    41014102                B1E54599134629C10092A545 /* NavigatorUserMediaError.h in Headers */ = {isa = PBXBuildFile; fileRef = B1E5458D134629C10092A545 /* NavigatorUserMediaError.h */; };
    41024103                B1E5459B134629C10092A545 /* NavigatorUserMediaErrorCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = B1E5458F134629C10092A545 /* NavigatorUserMediaErrorCallback.h */; };
     
    81048105                6EE8A77010F803F3005A4A24 /* JSWebGLContextAttributes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebGLContextAttributes.cpp; sourceTree = "<group>"; };
    81058106                6EE8A77110F803F3005A4A24 /* JSWebGLContextAttributes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebGLContextAttributes.h; sourceTree = "<group>"; };
     8107                71FB967A1383D64600AC8A4C /* SVGAnimatedEnumerationPropertyTearOff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedEnumerationPropertyTearOff.h; sourceTree = "<group>"; };
    81068108                72626E010EF022FE00A07E20 /* FontFastPath.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontFastPath.cpp; sourceTree = "<group>"; };
    81078109                750D029111D0E7F300BD1B27 /* RenderInputSpeech.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderInputSpeech.cpp; sourceTree = "<group>"; };
     
    1036510367                B1827492134CA4C100B98C2D /* CallbackFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CallbackFunction.cpp; sourceTree = "<group>"; };
    1036610368                B1D5ECB4134B58DA0087C78F /* CallbackFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallbackFunction.h; sourceTree = "<group>"; };
     10369                B1E54587134629C10092A545 /* CallbackTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallbackTask.h; sourceTree = "<group>"; };
    1036710370                B1E54588134629C10092A545 /* MediaStreamClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaStreamClient.h; sourceTree = "<group>"; };
    1036810371                B1E54589134629C10092A545 /* MediaStreamFrameController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaStreamFrameController.cpp; sourceTree = "<group>"; };
     
    1037010373                B1E5458B134629C10092A545 /* MediaStreamController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaStreamController.cpp; sourceTree = "<group>"; };
    1037110374                B1E5458C134629C10092A545 /* MediaStreamController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaStreamController.h; sourceTree = "<group>"; };
    10372                 B1E54587134629C10092A545 /* CallbackTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallbackTask.h; sourceTree = "<group>"; };
    1037310375                B1E5458D134629C10092A545 /* NavigatorUserMediaError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NavigatorUserMediaError.h; sourceTree = "<group>"; };
    1037410376                B1E5458E134629C10092A545 /* NavigatorUserMediaError.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = NavigatorUserMediaError.idl; sourceTree = "<group>"; };
     
    1256312565                        isa = PBXGroup;
    1256412566                        children = (
     12567                                71FB967A1383D64600AC8A4C /* SVGAnimatedEnumerationPropertyTearOff.h */,
    1256512568                                088A0DFB126EF1DB00978F7A /* SVGAnimatedListPropertyTearOff.h */,
    1256612569                                089A8E06128D8B3D00E7A534 /* SVGAnimatedPathSegListPropertyTearOff.h */,
     
    2283322836                                BCF7E491137CD7C7001DDAE7 /* AdjustViewSizeOrNot.h in Headers */,
    2283422837                                B1E54593134629C10092A545 /* CallbackTask.h in Headers */,
     22838                                71FB967B1383D64600AC8A4C /* SVGAnimatedEnumerationPropertyTearOff.h in Headers */,
    2283522839                        );
    2283622840                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm

    r84741 r86765  
    804804        # Can inline the function call into the return statement to avoid overhead of using a Ref<> temporary
    805805        $result = $getterString;
     806        # Fix amigious conversion problem, by casting to the base type first ($getterString returns a type that inherits from SVGAnimatedEnumeration, not the base class directly).
     807        $result = "static_pointer_cast<SVGAnimatedEnumeration>($result)" if $returnType eq "SVGAnimatedEnumeration";
    806808    }
    807809 
  • trunk/Source/WebCore/platform/graphics/GraphicsTypes.h

    r65021 r86765  
    5151    };
    5252
    53     // FIXME: Currently these constants have to match the values used in the SVG
    54     // DOM API. That's a mistake. We need to make cut that dependency.
    5553    enum GradientSpreadMethod {
    56         SpreadMethodPad = 1,
    57         SpreadMethodReflect = 2,
    58         SpreadMethodRepeat = 3
     54        SpreadMethodPad,
     55        SpreadMethodReflect,
     56        SpreadMethodRepeat
    5957    };
    6058
  • trunk/Source/WebCore/platform/graphics/filters/FEBlend.cpp

    r79664 r86765  
    103103        return;
    104104
    105     if (m_mode <= FEBLEND_MODE_UNKNOWN || m_mode > FEBLEND_MODE_LIGHTEN)
    106         return;
     105    ASSERT(m_mode > FEBLEND_MODE_UNKNOWN);
     106    ASSERT(m_mode <= FEBLEND_MODE_LIGHTEN);
    107107
    108108    ByteArray* dstPixelArray = createPremultipliedImageResult();
  • trunk/Source/WebCore/platform/graphics/filters/FEDisplacementMap.cpp

    r80022 r86765  
    100100        return;
    101101
    102     if (m_xChannelSelector == CHANNEL_UNKNOWN || m_yChannelSelector == CHANNEL_UNKNOWN)
    103         return;
     102    ASSERT(m_xChannelSelector != CHANNEL_UNKNOWN);
     103    ASSERT(m_yChannelSelector != CHANNEL_UNKNOWN);
    104104
    105105    ByteArray* dstPixelArray = createPremultipliedImageResult();
  • trunk/Source/WebCore/rendering/svg/RenderSVGResourceClipper.h

    r76248 r86765  
    5959    bool hitTestClipContent(const FloatRect&, const FloatPoint&);
    6060
    61     SVGUnitTypes::SVGUnitType clipPathUnits() const { return toUnitType(static_cast<SVGClipPathElement*>(node())->clipPathUnits()); }
     61    SVGUnitTypes::SVGUnitType clipPathUnits() const { return static_cast<SVGClipPathElement*>(node())->clipPathUnits(); }
    6262
    6363    static RenderSVGResourceType s_resourceType;
  • trunk/Source/WebCore/rendering/svg/RenderSVGResourceFilter.h

    r85406 r86765  
    7979    PassRefPtr<SVGFilterBuilder> buildPrimitives(Filter*);
    8080
    81     SVGUnitTypes::SVGUnitType filterUnits() const { return toUnitType(static_cast<SVGFilterElement*>(node())->filterUnits()); }
    82     SVGUnitTypes::SVGUnitType primitiveUnits() const { return toUnitType(static_cast<SVGFilterElement*>(node())->primitiveUnits()); }
     81    SVGUnitTypes::SVGUnitType filterUnits() const { return static_cast<SVGFilterElement*>(node())->filterUnits(); }
     82    SVGUnitTypes::SVGUnitType primitiveUnits() const { return static_cast<SVGFilterElement*>(node())->primitiveUnits(); }
    8383
    8484    void primitiveAttributeChanged(RenderObject*, const QualifiedName&);
  • trunk/Source/WebCore/rendering/svg/RenderSVGResourceGradient.cpp

    r84101 r86765  
    277277}
    278278
    279 }
    280 
    281 #endif
     279GradientSpreadMethod RenderSVGResourceGradient::platformSpreadMethodFromSVGType(SVGGradientElement::SVGSpreadMethodType method) const
     280{
     281    switch (method) {
     282    case SVGGradientElement::SVG_SPREADMETHOD_UNKNOWN:
     283    case SVGGradientElement::SVG_SPREADMETHOD_PAD:
     284        return SpreadMethodPad;
     285    case SVGGradientElement::SVG_SPREADMETHOD_REFLECT:
     286        return SpreadMethodReflect;
     287    case SVGGradientElement::SVG_SPREADMETHOD_REPEAT:
     288        return SpreadMethodRepeat;
     289    }
     290
     291    ASSERT_NOT_REACHED();
     292    return SpreadMethodPad;
     293}
     294
     295}
     296
     297#endif
  • trunk/Source/WebCore/rendering/svg/RenderSVGResourceGradient.h

    r84101 r86765  
    6262    virtual void buildGradient(GradientData*, SVGGradientElement*) const = 0;
    6363
     64    GradientSpreadMethod platformSpreadMethodFromSVGType(SVGGradientElement::SVGSpreadMethodType) const;
     65
    6466private:
    6567    bool m_shouldCollectGradientAttributes : 1;
  • trunk/Source/WebCore/rendering/svg/RenderSVGResourceLinearGradient.cpp

    r75350 r86765  
    5656
    5757    gradientData->gradient = Gradient::create(startPoint, endPoint);
    58     gradientData->gradient->setSpreadMethod(m_attributes.spreadMethod());
     58    gradientData->gradient->setSpreadMethod(platformSpreadMethodFromSVGType(m_attributes.spreadMethod()));
    5959
    6060    // Add stops
  • trunk/Source/WebCore/rendering/svg/RenderSVGResourceMarker.h

    r75350 r86765  
    6161    FloatPoint referencePoint() const;
    6262    float angle() const;
    63     SVGMarkerElement::SVGMarkerUnitsType markerUnits() const { return static_cast<SVGMarkerElement::SVGMarkerUnitsType>(static_cast<SVGMarkerElement*>(node())->markerUnits()); }
     63    SVGMarkerElement::SVGMarkerUnitsType markerUnits() const { return static_cast<SVGMarkerElement*>(node())->markerUnits(); }
    6464
    6565    virtual RenderSVGResourceType resourceType() const { return s_resourceType; }
  • trunk/Source/WebCore/rendering/svg/RenderSVGResourceMasker.h

    r75350 r86765  
    5151    virtual FloatRect resourceBoundingBox(RenderObject*);
    5252
    53     SVGUnitTypes::SVGUnitType maskUnits() const { return toUnitType(static_cast<SVGMaskElement*>(node())->maskUnits()); }
    54     SVGUnitTypes::SVGUnitType maskContentUnits() const { return toUnitType(static_cast<SVGMaskElement*>(node())->maskContentUnits()); }
     53    SVGUnitTypes::SVGUnitType maskUnits() const { return static_cast<SVGMaskElement*>(node())->maskUnits(); }
     54    SVGUnitTypes::SVGUnitType maskContentUnits() const { return static_cast<SVGMaskElement*>(node())->maskContentUnits(); }
    5555
    5656    virtual RenderSVGResourceType resourceType() const { return s_resourceType; }
  • trunk/Source/WebCore/rendering/svg/RenderSVGResourceRadialGradient.cpp

    r75350 r86765  
    6161                                              radius);
    6262
    63     gradientData->gradient->setSpreadMethod(m_attributes.spreadMethod());
     63    gradientData->gradient->setSpreadMethod(platformSpreadMethodFromSVGType(m_attributes.spreadMethod()));
    6464
    6565    // Add stops
  • trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp

    r83607 r86765  
    189189static TextStream& operator<<(TextStream& ts, const SVGUnitTypes::SVGUnitType& unitType)
    190190{
    191     switch (unitType) {
    192     case SVGUnitTypes::SVG_UNIT_TYPE_UNKNOWN:
    193         ts << "unknown";
    194         break;
    195     case SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE:
    196         ts << "userSpaceOnUse";
    197         break;
    198     case SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX:
    199         ts << "objectBoundingBox";
    200         break;
    201     }
    202 
     191    ts << SVGPropertyTraits<SVGUnitTypes::SVGUnitType>::toString(unitType);
    203192    return ts;
    204193}
     
    206195static TextStream& operator<<(TextStream& ts, const SVGMarkerElement::SVGMarkerUnitsType& markerUnit)
    207196{
    208     switch (markerUnit) {
    209     case SVGMarkerElement::SVG_MARKERUNITS_UNKNOWN:
    210         ts << "unknown";
    211         break;
    212     case SVGMarkerElement::SVG_MARKERUNITS_USERSPACEONUSE:
    213         ts << "userSpaceOnUse";
    214         break;
    215     case SVGMarkerElement::SVG_MARKERUNITS_STROKEWIDTH:
    216         ts << "strokeWidth";
    217         break;
    218     }
    219 
     197    ts << SVGPropertyTraits<SVGMarkerElement::SVGMarkerUnitsType>::toString(markerUnit);
    220198    return ts;
    221199}
     
    274252}
    275253
    276 // FIXME: Maybe this should be in Gradient.cpp
    277 static TextStream& operator<<(TextStream& ts, GradientSpreadMethod mode)
    278 {
    279     switch (mode) {
    280     case SpreadMethodPad:
    281         ts << "PAD";
    282         break;
    283     case SpreadMethodRepeat:
    284         ts << "REPEAT";
    285         break;
    286     case SpreadMethodReflect:
    287         ts << "REFLECT";
    288         break;
    289     }
    290 
     254static TextStream& operator<<(TextStream& ts, const SVGGradientElement::SVGSpreadMethodType& type)
     255{
     256    ts << SVGPropertyTraits<SVGGradientElement::SVGSpreadMethodType>::toString(type).upper();
    291257    return ts;
    292258}
     
    535501}
    536502
    537 static inline void writeCommonGradientProperties(TextStream& ts, GradientSpreadMethod spreadMethod, const AffineTransform& gradientTransform, bool boundingBoxMode)
     503static inline void writeCommonGradientProperties(TextStream& ts, SVGGradientElement::SVGSpreadMethodType spreadMethod, const AffineTransform& gradientTransform, bool boundingBoxMode)
    538504{
    539505    writeNameValuePair(ts, "gradientUnits", boundingBoxModeString(boundingBoxMode));
    540506
    541     if (spreadMethod != SpreadMethodPad)
     507    if (spreadMethod != SVGGradientElement::SVG_SPREADMETHOD_PAD)
    542508        ts << " [spreadMethod=" << spreadMethod << "]";
    543509
  • trunk/Source/WebCore/rendering/svg/SVGTextChunkBuilder.cpp

    r83710 r86765  
    130130        desiredTextLength = textContentElement->specifiedTextLength().value(textContentElement);
    131131
    132         switch (static_cast<SVGTextContentElement::SVGLengthAdjustType>(textContentElement->lengthAdjust())) {
     132        switch (textContentElement->lengthAdjust()) {
    133133        case SVGTextContentElement::LENGTHADJUST_UNKNOWN:
    134134            break;
  • trunk/Source/WebCore/rendering/svg/SVGTextLayoutEngine.cpp

    r83710 r86765  
    157157        SVGTextContentElement* textContentElement = SVGTextContentElement::elementFromRenderer(currentParent);
    158158        if (textContentElement) {
    159             SVGTextContentElement::SVGLengthAdjustType lengthAdjust = static_cast<SVGTextContentElement::SVGLengthAdjustType>(textContentElement->lengthAdjust());
     159            SVGTextContentElement::SVGLengthAdjustType lengthAdjust = textContentElement->lengthAdjust();
    160160            if (lengthAdjust == SVGTextContentElement::LENGTHADJUST_SPACING && textContentElement->specifiedTextLength().value(textContentElement) > 0)
    161161                return true;
     
    213213
    214214    if (SVGTextContentElement* textContentElement = SVGTextContentElement::elementFromRenderer(textPath)) {
    215         lengthAdjust = static_cast<SVGTextContentElement::SVGLengthAdjustType>(textContentElement->lengthAdjust());
     215        lengthAdjust = textContentElement->lengthAdjust();
    216216        desiredTextLength = textContentElement->specifiedTextLength().value(textContentElement);
    217217    }
  • trunk/Source/WebCore/svg/GradientAttributes.h

    r64579 r86765  
    2222
    2323#if ENABLE(SVG)
    24 #include "Color.h"
    25 #include "Gradient.h"
     24#include "SVGGradientElement.h"
    2625#include "SVGLength.h"
    2726
     
    3029struct GradientAttributes {
    3130    GradientAttributes()
    32         : m_spreadMethod(SpreadMethodPad)
     31        : m_spreadMethod(SVGGradientElement::SVG_SPREADMETHOD_PAD)
    3332        , m_boundingBoxMode(true)
    3433        , m_spreadMethodSet(false)
     
    3938    }
    4039
    41     GradientSpreadMethod spreadMethod() const { return m_spreadMethod; }
     40    SVGGradientElement::SVGSpreadMethodType spreadMethod() const { return m_spreadMethod; }
    4241    bool boundingBoxMode() const { return m_boundingBoxMode; }
    4342    AffineTransform gradientTransform() const { return m_gradientTransform; }
    4443    const Vector<Gradient::ColorStop>& stops() const { return m_stops; }
    4544
    46     void setSpreadMethod(GradientSpreadMethod value)
     45    void setSpreadMethod(SVGGradientElement::SVGSpreadMethodType value)
    4746    {
    4847        m_spreadMethod = value;
     
    7574private:
    7675    // Properties
    77     GradientSpreadMethod m_spreadMethod;
     76    SVGGradientElement::SVGSpreadMethodType m_spreadMethod;
    7877    bool m_boundingBoxMode;
    7978    AffineTransform m_gradientTransform;
  • trunk/Source/WebCore/svg/SVGAnimatedBoolean.idl

    r71014 r86765  
    2727
    2828    interface [Conditional=SVG] SVGAnimatedBoolean {
    29         attribute [StrictTypeChecking] boolean baseVal;
     29        attribute [StrictTypeChecking] boolean baseVal
     30            setter raises(DOMException);
    3031        readonly attribute boolean animVal;
    3132    };
  • trunk/Source/WebCore/svg/SVGAnimatedEnumeration.h

    r73130 r86765  
    2222
    2323#if ENABLE(SVG)
     24#include "SVGAnimatedEnumerationPropertyTearOff.h"
    2425#include "SVGAnimatedPropertyMacros.h"
    25 #include "SVGAnimatedStaticPropertyTearOff.h"
    2626
    2727namespace WebCore {
     
    3030
    3131// Helper macros to declare/define a SVGAnimatedEnumeration object
    32 #define DECLARE_ANIMATED_ENUMERATION(UpperProperty, LowerProperty) \
    33 DECLARE_ANIMATED_PROPERTY(SVGAnimatedEnumeration, int, UpperProperty, LowerProperty)
     32#define DECLARE_ANIMATED_ENUMERATION(UpperProperty, LowerProperty, EnumType) \
     33DECLARE_ANIMATED_PROPERTY(SVGAnimatedEnumerationPropertyTearOff<EnumType>, EnumType, UpperProperty, LowerProperty)
    3434
    35 #define DEFINE_ANIMATED_ENUMERATION(OwnerType, DOMAttribute, UpperProperty, LowerProperty) \
    36 DEFINE_ANIMATED_PROPERTY(OwnerType, DOMAttribute, DOMAttribute.localName(), SVGAnimatedEnumeration, int, UpperProperty, LowerProperty)
     35#define DEFINE_ANIMATED_ENUMERATION(OwnerType, DOMAttribute, UpperProperty, LowerProperty, EnumType) \
     36DEFINE_ANIMATED_PROPERTY(OwnerType, DOMAttribute, DOMAttribute.localName(), SVGAnimatedEnumerationPropertyTearOff<EnumType>, EnumType, UpperProperty, LowerProperty)
    3737
    38 #define DEFINE_ANIMATED_ENUMERATION_MULTIPLE_WRAPPERS(OwnerType, DOMAttribute, SVGDOMAttributeIdentifier, UpperProperty, LowerProperty) \
    39 DEFINE_ANIMATED_PROPERTY(OwnerType, DOMAttribute, SVGDOMAttributeIdentifier, SVGAnimatedEnumeration, int, UpperProperty, LowerProperty)
     38#define DEFINE_ANIMATED_ENUMERATION_MULTIPLE_WRAPPERS(OwnerType, DOMAttribute, SVGDOMAttributeIdentifier, UpperProperty, LowerProperty, EnumType) \
     39DEFINE_ANIMATED_PROPERTY(OwnerType, DOMAttribute, SVGDOMAttributeIdentifier, SVGAnimatedEnumerationPropertyTearOff<EnumType>, EnumType, UpperProperty, LowerProperty)
    4040
    4141} // namespace WebCore
  • trunk/Source/WebCore/svg/SVGAnimatedEnumeration.idl

    r71014 r86765  
    2727
    2828    interface [Conditional=SVG] SVGAnimatedEnumeration {
    29         attribute [StrictTypeChecking] unsigned short baseVal;
     29        attribute [StrictTypeChecking] unsigned short baseVal
     30            setter raises(DOMException);
    3031        readonly attribute unsigned short animVal;
    3132    };
  • trunk/Source/WebCore/svg/SVGAnimatedInteger.idl

    r71014 r86765  
    2727
    2828    interface [Conditional=SVG] SVGAnimatedInteger {
    29         attribute [StrictTypeChecking] long baseVal;
     29        attribute [StrictTypeChecking] long baseVal
     30            setter raises(DOMException);
    3031        readonly attribute long animVal;
    3132    };
  • trunk/Source/WebCore/svg/SVGAnimatedNumber.idl

    r70979 r86765  
    2828
    2929    interface [Conditional=SVG] SVGAnimatedNumber {
    30         attribute [StrictTypeChecking] float baseVal;
     30        attribute [StrictTypeChecking] float baseVal
     31            setter raises(DOMException);
    3132        readonly attribute float animVal;
    3233    };
  • trunk/Source/WebCore/svg/SVGAnimatedString.idl

    r64579 r86765  
    2727
    2828    interface [Conditional=SVG] SVGAnimatedString {
    29                  attribute DOMString baseVal
    30                      /*setter raises(DOMException)*/;
     29        attribute DOMString baseVal
     30            setter raises(DOMException);
    3131        readonly attribute DOMString animVal;
    3232    };
  • trunk/Source/WebCore/svg/SVGClipPathElement.cpp

    r86050 r86765  
    3131#include "SVGNames.h"
    3232#include "SVGTransformList.h"
    33 #include "SVGUnitTypes.h"
    3433
    3534namespace WebCore {
    3635
    3736// Animated property definitions
    38 DEFINE_ANIMATED_ENUMERATION(SVGClipPathElement, SVGNames::clipPathUnitsAttr, ClipPathUnits, clipPathUnits)
     37DEFINE_ANIMATED_ENUMERATION(SVGClipPathElement, SVGNames::clipPathUnitsAttr, ClipPathUnits, clipPathUnits, SVGUnitTypes::SVGUnitType)
    3938DEFINE_ANIMATED_BOOLEAN(SVGClipPathElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
    4039
     
    5453{
    5554    if (attr->name() == SVGNames::clipPathUnitsAttr) {
    56         if (attr->value() == "userSpaceOnUse")
    57             setClipPathUnitsBaseValue(SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE);
    58         else if (attr->value() == "objectBoundingBox")
    59             setClipPathUnitsBaseValue(SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX);
     55        SVGUnitTypes::SVGUnitType propertyValue = SVGPropertyTraits<SVGUnitTypes::SVGUnitType>::fromString(attr->value());
     56        if (propertyValue > 0)
     57            setClipPathUnitsBaseValue(propertyValue);
    6058    } else {
    6159        if (SVGTests::parseMappedAttribute(attr))
  • trunk/Source/WebCore/svg/SVGClipPathElement.h

    r78249 r86765  
    2929#include "SVGStyledTransformableElement.h"
    3030#include "SVGTests.h"
     31#include "SVGUnitTypes.h"
    3132
    3233namespace WebCore {
     
    5758
    5859    // Animated property declarations
    59     DECLARE_ANIMATED_ENUMERATION(ClipPathUnits, clipPathUnits)
     60    DECLARE_ANIMATED_ENUMERATION(ClipPathUnits, clipPathUnits, SVGUnitTypes::SVGUnitType)
    6061
    6162    // SVGExternalResourcesRequired
  • trunk/Source/WebCore/svg/SVGComponentTransferFunctionElement.cpp

    r82351 r86765  
    3232
    3333// Animated property definitions
    34 DEFINE_ANIMATED_ENUMERATION(SVGComponentTransferFunctionElement, SVGNames::typeAttr, Type, type)
     34DEFINE_ANIMATED_ENUMERATION(SVGComponentTransferFunctionElement, SVGNames::typeAttr, Type, type, ComponentTransferType)
    3535DEFINE_ANIMATED_NUMBER_LIST(SVGComponentTransferFunctionElement, SVGNames::tableValuesAttr, TableValues, tableValues)
    3636DEFINE_ANIMATED_NUMBER(SVGComponentTransferFunctionElement, SVGNames::slopeAttr, Slope, slope)
     
    4242SVGComponentTransferFunctionElement::SVGComponentTransferFunctionElement(const QualifiedName& tagName, Document* document)
    4343    : SVGElement(tagName, document)
    44     , m_type(FECOMPONENTTRANSFER_TYPE_UNKNOWN)
     44    , m_type(FECOMPONENTTRANSFER_TYPE_IDENTITY)
    4545    , m_slope(1)
    4646    , m_amplitude(1)
     
    5353    const String& value = attr->value();
    5454    if (attr->name() == SVGNames::typeAttr) {
    55         if (value == "identity")
    56             setTypeBaseValue(FECOMPONENTTRANSFER_TYPE_IDENTITY);
    57         else if (value == "table")
    58             setTypeBaseValue(FECOMPONENTTRANSFER_TYPE_TABLE);
    59         else if (value == "discrete")
    60             setTypeBaseValue(FECOMPONENTTRANSFER_TYPE_DISCRETE);
    61         else if (value == "linear")
    62             setTypeBaseValue(FECOMPONENTTRANSFER_TYPE_LINEAR);
    63         else if (value == "gamma")
    64             setTypeBaseValue(FECOMPONENTTRANSFER_TYPE_GAMMA);
     55        ComponentTransferType propertyValue = SVGPropertyTraits<ComponentTransferType>::fromString(value);
     56        if (propertyValue > 0)
     57            setTypeBaseValue(propertyValue);
    6558    } else if (attr->name() == SVGNames::tableValuesAttr) {
    6659        SVGNumberList newList;
     
    8073    else
    8174        SVGElement::parseMappedAttribute(attr);
    82 }
    83 
    84 void SVGComponentTransferFunctionElement::svgAttributeChanged(const QualifiedName& attrName)
    85 {
    86     SVGElement::svgAttributeChanged(attrName);
    87 
    88     if (attrName == SVGNames::typeAttr) {
    89         ComponentTransferType componentType = static_cast<ComponentTransferType>(type());
    90         if (componentType < FECOMPONENTTRANSFER_TYPE_UNKNOWN || componentType > FECOMPONENTTRANSFER_TYPE_GAMMA)
    91             setTypeBaseValue(FECOMPONENTTRANSFER_TYPE_UNKNOWN);
    92     }
    9375}
    9476
     
    145127{
    146128    ComponentTransferFunction func;
    147     func.type = static_cast<ComponentTransferType>(type());
     129    func.type = type();
    148130    func.slope = slope();
    149131    func.intercept = intercept();
  • trunk/Source/WebCore/svg/SVGComponentTransferFunctionElement.h

    r82351 r86765  
    3838
    3939    virtual void parseMappedAttribute(Attribute*);
    40     virtual void svgAttributeChanged(const QualifiedName&);
    4140    virtual void synchronizeProperty(const QualifiedName&);
    4241    virtual void fillAttributeToPropertyTypeMap();
     
    4544private:
    4645    // Animated property declarations
    47     DECLARE_ANIMATED_ENUMERATION(Type, type)
     46    DECLARE_ANIMATED_ENUMERATION(Type, type, ComponentTransferType)
    4847    DECLARE_ANIMATED_NUMBER_LIST(TableValues, tableValues)
    4948    DECLARE_ANIMATED_NUMBER(Slope, slope)
     
    5453};
    5554
     55template<>
     56struct SVGPropertyTraits<ComponentTransferType> {
     57    static ComponentTransferType highestEnumValue() { return FECOMPONENTTRANSFER_TYPE_GAMMA; }
     58
     59    static String toString(ComponentTransferType type)
     60    {
     61        switch (type) {
     62        case FECOMPONENTTRANSFER_TYPE_UNKNOWN:
     63            return emptyString();
     64        case FECOMPONENTTRANSFER_TYPE_IDENTITY:
     65            return "identity";
     66        case FECOMPONENTTRANSFER_TYPE_TABLE:
     67            return "table";
     68        case FECOMPONENTTRANSFER_TYPE_DISCRETE:
     69            return "discrete";
     70        case FECOMPONENTTRANSFER_TYPE_LINEAR:
     71            return "linear";
     72        case FECOMPONENTTRANSFER_TYPE_GAMMA:
     73            return "gamma";
     74        }
     75
     76        ASSERT_NOT_REACHED();
     77        return emptyString();
     78    }
     79
     80    static ComponentTransferType fromString(const String& value)
     81    {
     82        if (value == "identity")
     83            return FECOMPONENTTRANSFER_TYPE_IDENTITY;
     84        if (value == "table")
     85            return FECOMPONENTTRANSFER_TYPE_TABLE;
     86        if (value == "discrete")
     87            return FECOMPONENTTRANSFER_TYPE_DISCRETE;
     88        if (value == "linear")
     89            return FECOMPONENTTRANSFER_TYPE_LINEAR;
     90        if (value == "gamma")
     91            return FECOMPONENTTRANSFER_TYPE_GAMMA;
     92        return FECOMPONENTTRANSFER_TYPE_UNKNOWN;
     93    }
     94};
     95
    5696} // namespace WebCore
    5797
  • trunk/Source/WebCore/svg/SVGFEBlendElement.cpp

    r86050 r86765  
    3434DEFINE_ANIMATED_STRING(SVGFEBlendElement, SVGNames::inAttr, In1, in1)
    3535DEFINE_ANIMATED_STRING(SVGFEBlendElement, SVGNames::in2Attr, In2, in2)
    36 DEFINE_ANIMATED_ENUMERATION(SVGFEBlendElement, SVGNames::modeAttr, Mode, mode)
     36DEFINE_ANIMATED_ENUMERATION(SVGFEBlendElement, SVGNames::modeAttr, Mode, mode, BlendModeType)
    3737
    3838inline SVGFEBlendElement::SVGFEBlendElement(const QualifiedName& tagName, Document* document)
     
    5252    const String& value = attr->value();
    5353    if (attr->name() == SVGNames::modeAttr) {
    54         if (value == "normal")
    55             setModeBaseValue(FEBLEND_MODE_NORMAL);
    56         else if (value == "multiply")
    57             setModeBaseValue(FEBLEND_MODE_MULTIPLY);
    58         else if (value == "screen")
    59             setModeBaseValue(FEBLEND_MODE_SCREEN);
    60         else if (value == "darken")
    61             setModeBaseValue(FEBLEND_MODE_DARKEN);
    62         else if (value == "lighten")
    63             setModeBaseValue(FEBLEND_MODE_LIGHTEN);
     54        BlendModeType propertyValue = SVGPropertyTraits<BlendModeType>::fromString(value);
     55        if (propertyValue > 0)
     56            setModeBaseValue(propertyValue);
    6457    } else if (attr->name() == SVGNames::inAttr)
    6558        setIn1BaseValue(value);
     
    7467    FEBlend* blend = static_cast<FEBlend*>(effect);
    7568    if (attrName == SVGNames::modeAttr)
    76         return blend->setBlendMode(static_cast<BlendModeType>(mode()));
     69        return blend->setBlendMode(mode());
    7770
    7871    ASSERT_NOT_REACHED();
     
    135128        return 0;
    136129
    137     RefPtr<FilterEffect> effect = FEBlend::create(filter, static_cast<BlendModeType>(mode()));
     130    RefPtr<FilterEffect> effect = FEBlend::create(filter, mode());
    138131    FilterEffectVector& inputEffects = effect->inputEffects();
    139132    inputEffects.reserveCapacity(2);
     
    146139
    147140#endif // ENABLE(SVG)
    148 
    149 // vim:ts=4:noet
  • trunk/Source/WebCore/svg/SVGFEBlendElement.h

    r79664 r86765  
    4747    DECLARE_ANIMATED_STRING(In1, in1)
    4848    DECLARE_ANIMATED_STRING(In2, in2)
    49     DECLARE_ANIMATED_ENUMERATION(Mode, mode)
     49    DECLARE_ANIMATED_ENUMERATION(Mode, mode, BlendModeType)
     50};
     51
     52template<>
     53struct SVGPropertyTraits<BlendModeType> {
     54    static BlendModeType highestEnumValue() { return FEBLEND_MODE_LIGHTEN; }
     55
     56    static String toString(BlendModeType type)
     57    {
     58        switch (type) {
     59        case FEBLEND_MODE_UNKNOWN:
     60            return emptyString();
     61        case FEBLEND_MODE_NORMAL:
     62            return "normal";
     63        case FEBLEND_MODE_MULTIPLY:
     64            return "multiply";
     65        case FEBLEND_MODE_SCREEN:
     66            return "screen";
     67        case FEBLEND_MODE_DARKEN:
     68            return "darken";
     69        case FEBLEND_MODE_LIGHTEN:
     70            return "lighten";
     71        }
     72
     73        ASSERT_NOT_REACHED();
     74        return emptyString();
     75    }
     76
     77    static BlendModeType fromString(const String& value)
     78    {
     79        if (value == "normal")
     80            return FEBLEND_MODE_NORMAL;
     81        if (value == "multiply")
     82            return FEBLEND_MODE_MULTIPLY;
     83        if (value == "screen")
     84            return FEBLEND_MODE_SCREEN;
     85        if (value == "darken")
     86            return FEBLEND_MODE_DARKEN;
     87        if (value == "lighten")
     88            return FEBLEND_MODE_LIGHTEN;
     89        return FEBLEND_MODE_UNKNOWN;
     90    }
    5091};
    5192
  • trunk/Source/WebCore/svg/SVGFEColorMatrixElement.cpp

    r86050 r86765  
    3333// Animated property definitions
    3434DEFINE_ANIMATED_STRING(SVGFEColorMatrixElement, SVGNames::inAttr, In1, in1)
    35 DEFINE_ANIMATED_ENUMERATION(SVGFEColorMatrixElement, SVGNames::typeAttr, Type, type)
     35DEFINE_ANIMATED_ENUMERATION(SVGFEColorMatrixElement, SVGNames::typeAttr, Type, type, ColorMatrixType)
    3636DEFINE_ANIMATED_NUMBER_LIST(SVGFEColorMatrixElement, SVGNames::valuesAttr, Values, values)
    3737
     
    5252    const String& value = attr->value();
    5353    if (attr->name() == SVGNames::typeAttr) {
    54         if (value == "matrix")
    55             setTypeBaseValue(FECOLORMATRIX_TYPE_MATRIX);
    56         else if (value == "saturate")
    57             setTypeBaseValue(FECOLORMATRIX_TYPE_SATURATE);
    58         else if (value == "hueRotate")
    59             setTypeBaseValue(FECOLORMATRIX_TYPE_HUEROTATE);
    60         else if (value == "luminanceToAlpha")
    61             setTypeBaseValue(FECOLORMATRIX_TYPE_LUMINANCETOALPHA);
     54        ColorMatrixType propertyValue = SVGPropertyTraits<ColorMatrixType>::fromString(attr->value());
     55        if (propertyValue > 0)
     56            setTypeBaseValue(propertyValue);
    6257    } else if (attr->name() == SVGNames::inAttr)
    6358        setIn1BaseValue(value);
     
    7570    FEColorMatrix* colorMatrix = static_cast<FEColorMatrix*>(effect);
    7671    if (attrName == SVGNames::typeAttr)
    77         return colorMatrix->setType(static_cast<ColorMatrixType>(type()));
     72        return colorMatrix->setType(type());
    7873    if (attrName == SVGNames::valuesAttr)
    7974        return colorMatrix->setValues(values());
     
    137132
    138133    Vector<float> filterValues;
    139     const ColorMatrixType filterType(static_cast<ColorMatrixType>(type()));
     134    ColorMatrixType filterType = type();
    140135
    141136    // Use defaults if values is empty (SVG 1.1 15.10).
  • trunk/Source/WebCore/svg/SVGFEColorMatrixElement.h

    r79488 r86765  
    4747    // Animated property declarations
    4848    DECLARE_ANIMATED_STRING(In1, in1)
    49     DECLARE_ANIMATED_ENUMERATION(Type, type)
     49    DECLARE_ANIMATED_ENUMERATION(Type, type, ColorMatrixType)
    5050    DECLARE_ANIMATED_NUMBER_LIST(Values, values)
     51};
     52
     53template<>
     54struct SVGPropertyTraits<ColorMatrixType> {
     55    static ColorMatrixType highestEnumValue() { return FECOLORMATRIX_TYPE_LUMINANCETOALPHA; }
     56
     57    static String toString(ColorMatrixType type)
     58    {
     59        switch (type) {
     60        case FECOLORMATRIX_TYPE_UNKNOWN:
     61            return emptyString();
     62        case FECOLORMATRIX_TYPE_MATRIX:
     63            return "matrix";
     64        case FECOLORMATRIX_TYPE_SATURATE:
     65            return "saturate";
     66        case FECOLORMATRIX_TYPE_HUEROTATE:
     67            return "hueRotate";
     68        case FECOLORMATRIX_TYPE_LUMINANCETOALPHA:
     69            return "luminanceToAlpha";
     70        }
     71
     72        ASSERT_NOT_REACHED();
     73        return emptyString();
     74    }
     75
     76    static ColorMatrixType fromString(const String& value)
     77    {
     78        if (value == "matrix")
     79            return FECOLORMATRIX_TYPE_MATRIX;
     80        if (value == "saturate")
     81            return FECOLORMATRIX_TYPE_SATURATE;
     82        if (value == "hueRotate")
     83            return FECOLORMATRIX_TYPE_HUEROTATE;
     84        if (value == "luminanceToAlpha")
     85            return FECOLORMATRIX_TYPE_LUMINANCETOALPHA;
     86        return FECOLORMATRIX_TYPE_UNKNOWN;
     87    }
    5188};
    5289
  • trunk/Source/WebCore/svg/SVGFECompositeElement.cpp

    r86050 r86765  
    3434DEFINE_ANIMATED_STRING(SVGFECompositeElement, SVGNames::inAttr, In1, in1)
    3535DEFINE_ANIMATED_STRING(SVGFECompositeElement, SVGNames::in2Attr, In2, in2)
    36 DEFINE_ANIMATED_ENUMERATION(SVGFECompositeElement, SVGNames::operatorAttr, _operator, _operator)
     36DEFINE_ANIMATED_ENUMERATION(SVGFECompositeElement, SVGNames::operatorAttr, _operator, _operator, CompositeOperationType)
    3737DEFINE_ANIMATED_NUMBER(SVGFECompositeElement, SVGNames::k1Attr, K1, k1)
    3838DEFINE_ANIMATED_NUMBER(SVGFECompositeElement, SVGNames::k2Attr, K2, k2)
     
    5656    const String& value = attr->value();
    5757    if (attr->name() == SVGNames::operatorAttr) {
    58         if (value == "over")
    59             set_operatorBaseValue(FECOMPOSITE_OPERATOR_OVER);
    60         else if (value == "in")
    61             set_operatorBaseValue(FECOMPOSITE_OPERATOR_IN);
    62         else if (value == "out")
    63             set_operatorBaseValue(FECOMPOSITE_OPERATOR_OUT);
    64         else if (value == "atop")
    65             set_operatorBaseValue(FECOMPOSITE_OPERATOR_ATOP);
    66         else if (value == "xor")
    67             set_operatorBaseValue(FECOMPOSITE_OPERATOR_XOR);
    68         else if (value == "arithmetic")
    69             set_operatorBaseValue(FECOMPOSITE_OPERATOR_ARITHMETIC);
     58        CompositeOperationType propertyValue = SVGPropertyTraits<CompositeOperationType>::fromString(value);
     59        if (propertyValue > 0)
     60            set_operatorBaseValue(propertyValue);
    7061    } else if (attr->name() == SVGNames::inAttr)
    7162        setIn1BaseValue(value);
     
    8879    FEComposite* composite = static_cast<FEComposite*>(effect);
    8980    if (attrName == SVGNames::operatorAttr)
    90         return composite->setOperation(static_cast<CompositeOperationType>(_operator()));
     81        return composite->setOperation(_operator());
    9182    if (attrName == SVGNames::k1Attr)
    9283        return composite->setK1(k1());
     
    178169        return 0;
    179170
    180     RefPtr<FilterEffect> effect = FEComposite::create(filter, static_cast<CompositeOperationType>(_operator()),
    181                                                           k1(), k2(), k3(), k4());
     171    RefPtr<FilterEffect> effect = FEComposite::create(filter, _operator(), k1(), k2(), k3(), k4());
    182172    FilterEffectVector& inputEffects = effect->inputEffects();
    183173    inputEffects.reserveCapacity(2);
  • trunk/Source/WebCore/svg/SVGFECompositeElement.h

    r79856 r86765  
    4848    DECLARE_ANIMATED_STRING(In1, in1)
    4949    DECLARE_ANIMATED_STRING(In2, in2)
    50     DECLARE_ANIMATED_ENUMERATION(_operator, _operator)
     50    DECLARE_ANIMATED_ENUMERATION(_operator, _operator, CompositeOperationType)
    5151    DECLARE_ANIMATED_NUMBER(K1, k1)
    5252    DECLARE_ANIMATED_NUMBER(K2, k2)
     
    5555};
    5656
     57template<>
     58struct SVGPropertyTraits<CompositeOperationType> {
     59    static CompositeOperationType highestEnumValue() { return FECOMPOSITE_OPERATOR_ARITHMETIC; }
     60
     61    static String toString(CompositeOperationType type)
     62    {
     63        switch (type) {
     64        case FECOMPOSITE_OPERATOR_UNKNOWN:
     65            return emptyString();
     66        case FECOMPOSITE_OPERATOR_OVER:
     67            return "over";
     68        case FECOMPOSITE_OPERATOR_IN:
     69            return "in";
     70        case FECOMPOSITE_OPERATOR_OUT:
     71            return "out";
     72        case FECOMPOSITE_OPERATOR_ATOP:
     73            return "atop";
     74        case FECOMPOSITE_OPERATOR_XOR:
     75            return "xor";
     76        case FECOMPOSITE_OPERATOR_ARITHMETIC:
     77            return "arithmetic";
     78        }
     79
     80        ASSERT_NOT_REACHED();
     81        return emptyString();
     82    }
     83
     84    static CompositeOperationType fromString(const String& value)
     85    {
     86        if (value == "over")
     87            return FECOMPOSITE_OPERATOR_OVER;
     88        if (value == "in")
     89            return FECOMPOSITE_OPERATOR_IN;
     90        if (value == "out")
     91            return FECOMPOSITE_OPERATOR_OUT;
     92        if (value == "atop")
     93            return FECOMPOSITE_OPERATOR_ATOP;
     94        if (value == "xor")
     95            return FECOMPOSITE_OPERATOR_XOR;
     96        if (value == "arithmetic")
     97            return FECOMPOSITE_OPERATOR_ARITHMETIC;
     98        return FECOMPOSITE_OPERATOR_UNKNOWN;
     99    }
     100};
     101
    57102} // namespace WebCore
    58103
  • trunk/Source/WebCore/svg/SVGFEConvolveMatrixElement.cpp

    r86050 r86765  
    4343DEFINE_ANIMATED_INTEGER(SVGFEConvolveMatrixElement, SVGNames::targetXAttr, TargetX, targetX)
    4444DEFINE_ANIMATED_INTEGER(SVGFEConvolveMatrixElement, SVGNames::targetYAttr, TargetY, targetY)
    45 DEFINE_ANIMATED_ENUMERATION(SVGFEConvolveMatrixElement, SVGNames::operatorAttr, EdgeMode, edgeMode)
     45DEFINE_ANIMATED_ENUMERATION(SVGFEConvolveMatrixElement, SVGNames::edgeModeAttr, EdgeMode, edgeMode, EdgeModeType)
    4646DEFINE_ANIMATED_NUMBER_MULTIPLE_WRAPPERS(SVGFEConvolveMatrixElement, SVGNames::kernelUnitLengthAttr, kernelUnitLengthXIdentifier(), KernelUnitLengthX, kernelUnitLengthX)
    4747DEFINE_ANIMATED_NUMBER_MULTIPLE_WRAPPERS(SVGFEConvolveMatrixElement, SVGNames::kernelUnitLengthAttr, kernelUnitLengthYIdentifier(), KernelUnitLengthY, kernelUnitLengthY)
     
    9696        }
    9797    } else if (attr->name() == SVGNames::edgeModeAttr) {
    98         if (value == "duplicate")
    99             setEdgeModeBaseValue(EDGEMODE_DUPLICATE);
    100         else if (value == "wrap")
    101             setEdgeModeBaseValue(EDGEMODE_WRAP);
    102         else if (value == "none")
    103             setEdgeModeBaseValue(EDGEMODE_NONE);
     98        EdgeModeType propertyValue = SVGPropertyTraits<EdgeModeType>::fromString(attr->value());
     99        if (propertyValue > 0)
     100            setEdgeModeBaseValue(propertyValue);
    104101    } else if (attr->name() == SVGNames::kernelMatrixAttr) {
    105102        SVGNumberList newList;
     
    134131    FEConvolveMatrix* convolveMatrix = static_cast<FEConvolveMatrix*>(effect);
    135132    if (attrName == SVGNames::edgeModeAttr)
    136         return convolveMatrix->setEdgeMode(static_cast<EdgeModeType>(edgeMode()));
     133        return convolveMatrix->setEdgeMode(edgeMode());
    137134    if (attrName == SVGNames::divisorAttr)
    138135        return convolveMatrix->setDivisor(divisor());
     
    185182}
    186183
     184void SVGFEConvolveMatrixElement::synchronizeProperty(const QualifiedName& attrName)
     185{
     186    SVGFilterPrimitiveStandardAttributes::synchronizeProperty(attrName);
     187
     188    if (attrName == anyQName()) {
     189        synchronizeEdgeMode();
     190        synchronizeDivisor();
     191        synchronizeBias();
     192        synchronizeTargetX();
     193        synchronizeTargetY();
     194        synchronizeKernelUnitLengthX();
     195        synchronizeKernelUnitLengthY();
     196        synchronizePreserveAlpha();
     197        return;
     198    }
     199
     200    if (attrName == SVGNames::edgeModeAttr)
     201        synchronizeEdgeMode();
     202    else if (attrName == SVGNames::divisorAttr)
     203        synchronizeDivisor();
     204    else if (attrName == SVGNames::biasAttr)
     205        synchronizeBias();
     206    else if (attrName == SVGNames::targetXAttr)
     207        synchronizeTargetX();
     208    else if (attrName == SVGNames::targetYAttr)
     209        synchronizeTargetY();
     210    else if (attrName == SVGNames::kernelUnitLengthAttr) {
     211        synchronizeKernelUnitLengthX();
     212        synchronizeKernelUnitLengthY();
     213    } else if (attrName == SVGNames::preserveAlphaAttr)
     214        synchronizePreserveAlpha();
     215}
     216
    187217AttributeToPropertyTypeMap& SVGFEConvolveMatrixElement::attributeToPropertyTypeMap()
    188218{
     
    252282    RefPtr<FilterEffect> effect = FEConvolveMatrix::create(filter,
    253283                    IntSize(orderXValue, orderYValue), divisorValue,
    254                     bias(), IntPoint(targetXValue, targetYValue), static_cast<EdgeModeType>(edgeMode()),
     284                    bias(), IntPoint(targetXValue, targetYValue), edgeMode(),
    255285                    FloatPoint(kernelUnitLengthX(), kernelUnitLengthX()), preserveAlpha(), kernelMatrix);
    256286    effect->inputEffects().append(input1);
  • trunk/Source/WebCore/svg/SVGFEConvolveMatrixElement.h

    r79474 r86765  
    4545    virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&);
    4646    virtual void svgAttributeChanged(const QualifiedName&);
     47    virtual void synchronizeProperty(const QualifiedName&);
    4748    virtual void fillAttributeToPropertyTypeMap();
    4849    virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
     
    6364    DECLARE_ANIMATED_INTEGER(TargetX, targetX)
    6465    DECLARE_ANIMATED_INTEGER(TargetY, targetY)
    65     DECLARE_ANIMATED_ENUMERATION(EdgeMode, edgeMode)
     66    DECLARE_ANIMATED_ENUMERATION(EdgeMode, edgeMode, EdgeModeType)
    6667    DECLARE_ANIMATED_NUMBER(KernelUnitLengthX, kernelUnitLengthX)
    6768    DECLARE_ANIMATED_NUMBER(KernelUnitLengthY, kernelUnitLengthY)
    6869    DECLARE_ANIMATED_BOOLEAN(PreserveAlpha, preserveAlpha)
     70};
     71
     72template<>
     73struct SVGPropertyTraits<EdgeModeType> {
     74    static EdgeModeType highestEnumValue() { return EDGEMODE_NONE; }
     75
     76    static String toString(EdgeModeType type)
     77    {
     78        switch (type) {
     79        case EDGEMODE_UNKNOWN:
     80            return emptyString();
     81        case EDGEMODE_DUPLICATE:
     82            return "duplicate";
     83        case EDGEMODE_WRAP:
     84            return "wrap";
     85        case EDGEMODE_NONE:
     86            return "none";
     87        }
     88
     89        ASSERT_NOT_REACHED();
     90        return emptyString();
     91    }
     92
     93    static EdgeModeType fromString(const String& value)
     94    {
     95        if (value == "duplicate")
     96            return EDGEMODE_DUPLICATE;
     97        if (value == "wrap")
     98            return EDGEMODE_WRAP;
     99        if (value == "none")
     100            return EDGEMODE_NONE;
     101        return EDGEMODE_UNKNOWN;
     102    }
    69103};
    70104
  • trunk/Source/WebCore/svg/SVGFEDisplacementMapElement.cpp

    r86050 r86765  
    3333DEFINE_ANIMATED_STRING(SVGFEDisplacementMapElement, SVGNames::inAttr, In1, in1)
    3434DEFINE_ANIMATED_STRING(SVGFEDisplacementMapElement, SVGNames::in2Attr, In2, in2)
    35 DEFINE_ANIMATED_ENUMERATION(SVGFEDisplacementMapElement, SVGNames::xChannelSelectorAttr, XChannelSelector, xChannelSelector)
    36 DEFINE_ANIMATED_ENUMERATION(SVGFEDisplacementMapElement, SVGNames::yChannelSelectorAttr, YChannelSelector, yChannelSelector)   
     35DEFINE_ANIMATED_ENUMERATION(SVGFEDisplacementMapElement, SVGNames::xChannelSelectorAttr, XChannelSelector, xChannelSelector, ChannelSelectorType)
     36DEFINE_ANIMATED_ENUMERATION(SVGFEDisplacementMapElement, SVGNames::yChannelSelectorAttr, YChannelSelector, yChannelSelector, ChannelSelectorType)
    3737DEFINE_ANIMATED_NUMBER(SVGFEDisplacementMapElement, SVGNames::scaleAttr, Scale, scale)
    3838
     
    5050}
    5151
    52 ChannelSelectorType SVGFEDisplacementMapElement::stringToChannel(const String& key)
    53 {
    54     if (key == "R")
    55         return CHANNEL_R;
    56     if (key == "G")
    57         return CHANNEL_G;
    58     if (key == "B")
    59         return CHANNEL_B;
    60     if (key == "A")
    61         return CHANNEL_A;
    62 
    63     return CHANNEL_UNKNOWN;
    64 }
    65 
    6652void SVGFEDisplacementMapElement::parseMappedAttribute(Attribute* attr)
    6753{
    6854    const String& value = attr->value();
    69     if (attr->name() == SVGNames::xChannelSelectorAttr)
    70         setXChannelSelectorBaseValue(stringToChannel(value));
    71     else if (attr->name() == SVGNames::yChannelSelectorAttr)
    72         setYChannelSelectorBaseValue(stringToChannel(value));
    73     else if (attr->name() == SVGNames::inAttr)
     55    if (attr->name() == SVGNames::xChannelSelectorAttr) {
     56        ChannelSelectorType propertyValue = SVGPropertyTraits<ChannelSelectorType>::fromString(value);
     57        if (propertyValue > 0)
     58            setXChannelSelectorBaseValue(propertyValue);
     59    } else if (attr->name() == SVGNames::yChannelSelectorAttr) {
     60        ChannelSelectorType propertyValue = SVGPropertyTraits<ChannelSelectorType>::fromString(value);
     61        if (propertyValue > 0)
     62            setYChannelSelectorBaseValue(propertyValue);
     63    } else if (attr->name() == SVGNames::inAttr)
    7464        setIn1BaseValue(value);
    7565    else if (attr->name() == SVGNames::in2Attr)
     
    8575    FEDisplacementMap* displacementMap = static_cast<FEDisplacementMap*>(effect);
    8676    if (attrName == SVGNames::xChannelSelectorAttr)
    87         return displacementMap->setXChannelSelector(static_cast<ChannelSelectorType>(xChannelSelector()));
     77        return displacementMap->setXChannelSelector(xChannelSelector());
    8878    if (attrName == SVGNames::yChannelSelectorAttr)
    89         return displacementMap->setYChannelSelector(static_cast<ChannelSelectorType>(yChannelSelector()));
     79        return displacementMap->setYChannelSelector(yChannelSelector());
    9080    if (attrName == SVGNames::scaleAttr)
    9181        return displacementMap->setScale(scale());
     
    9989    SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName);
    10090
    101     if (attrName == SVGNames::xChannelSelectorAttr) {
    102         ChannelSelectorType selector = static_cast<ChannelSelectorType>(xChannelSelector());
    103         if (CHANNEL_UNKNOWN > selector || selector > CHANNEL_A)
    104             setXChannelSelectorBaseValue(CHANNEL_UNKNOWN);
    105         primitiveAttributeChanged(attrName);
    106     } else if (attrName == SVGNames::yChannelSelectorAttr) {
    107         ChannelSelectorType selector = static_cast<ChannelSelectorType>(yChannelSelector());
    108         if (CHANNEL_UNKNOWN > selector || selector > CHANNEL_A)
    109             setYChannelSelectorBaseValue(CHANNEL_UNKNOWN);
    110         primitiveAttributeChanged(attrName);
    111     } else if (attrName == SVGNames::scaleAttr)
     91    if (attrName == SVGNames::xChannelSelectorAttr || attrName == SVGNames::yChannelSelectorAttr || attrName == SVGNames::scaleAttr)
    11292        primitiveAttributeChanged(attrName);
    11393    else if (attrName == SVGNames::inAttr || attrName == SVGNames::in2Attr)
     
    166146        return 0;
    167147
    168     RefPtr<FilterEffect> effect = FEDisplacementMap::create(filter, static_cast<ChannelSelectorType>(xChannelSelector()),
    169                                                                 static_cast<ChannelSelectorType>(yChannelSelector()), scale());
     148    RefPtr<FilterEffect> effect = FEDisplacementMap::create(filter, xChannelSelector(), yChannelSelector(), scale());
    170149    FilterEffectVector& inputEffects = effect->inputEffects();
    171150    inputEffects.reserveCapacity(2);
     
    178157
    179158#endif // ENABLE(SVG)
    180 
    181 // vim:ts=4:noet
  • trunk/Source/WebCore/svg/SVGFEDisplacementMapElement.h

    r80022 r86765  
    4949    DECLARE_ANIMATED_STRING(In1, in1)
    5050    DECLARE_ANIMATED_STRING(In2, in2)
    51     DECLARE_ANIMATED_ENUMERATION(XChannelSelector, xChannelSelector)
    52     DECLARE_ANIMATED_ENUMERATION(YChannelSelector, yChannelSelector)
     51    DECLARE_ANIMATED_ENUMERATION(XChannelSelector, xChannelSelector, ChannelSelectorType)
     52    DECLARE_ANIMATED_ENUMERATION(YChannelSelector, yChannelSelector, ChannelSelectorType)
    5353    DECLARE_ANIMATED_NUMBER(Scale, scale)
     54};
     55
     56template<>
     57struct SVGPropertyTraits<ChannelSelectorType> {
     58    static ChannelSelectorType highestEnumValue() { return CHANNEL_A; }
     59
     60    static String toString(ChannelSelectorType type)
     61    {
     62        switch (type) {
     63        case CHANNEL_UNKNOWN:
     64            return emptyString();
     65        case CHANNEL_R:
     66            return "R";
     67        case CHANNEL_G:
     68            return "G";
     69        case CHANNEL_B:
     70            return "B";
     71        case CHANNEL_A:
     72            return "A";
     73        }
     74
     75        ASSERT_NOT_REACHED();
     76        return emptyString();
     77    }
     78
     79    static ChannelSelectorType fromString(const String& value)
     80    {
     81        if (value == "R")
     82            return CHANNEL_R;
     83        if (value == "G")
     84            return CHANNEL_G;
     85        if (value == "B")
     86            return CHANNEL_B;
     87        if (value == "A")
     88            return CHANNEL_A;
     89        return CHANNEL_UNKNOWN;
     90    }
    5491};
    5592
  • trunk/Source/WebCore/svg/SVGFEMorphologyElement.cpp

    r86050 r86765  
    3333// Animated property definitions
    3434DEFINE_ANIMATED_STRING(SVGFEMorphologyElement, SVGNames::inAttr, In1, in1)
    35 DEFINE_ANIMATED_ENUMERATION(SVGFEMorphologyElement, SVGNames::operatorAttr, _operator, _operator)
     35DEFINE_ANIMATED_ENUMERATION(SVGFEMorphologyElement, SVGNames::operatorAttr, _operator, _operator, MorphologyOperatorType)
    3636DEFINE_ANIMATED_NUMBER_MULTIPLE_WRAPPERS(SVGFEMorphologyElement, SVGNames::radiusAttr, radiusXIdentifier(), RadiusX, radiusX)
    3737DEFINE_ANIMATED_NUMBER_MULTIPLE_WRAPPERS(SVGFEMorphologyElement, SVGNames::radiusAttr, radiusYIdentifier(), RadiusY, radiusY)
     
    7272    const String& value = attr->value();
    7373    if (attr->name() == SVGNames::operatorAttr) {
    74         if (value == "erode")
    75             set_operatorBaseValue(FEMORPHOLOGY_OPERATOR_ERODE);
    76         else if (value == "dilate")
    77             set_operatorBaseValue(FEMORPHOLOGY_OPERATOR_DILATE);
     74        MorphologyOperatorType propertyValue = SVGPropertyTraits<MorphologyOperatorType>::fromString(value);
     75        if (propertyValue > 0)
     76            set_operatorBaseValue(propertyValue);
    7877    } else if (attr->name() == SVGNames::inAttr)
    7978        setIn1BaseValue(value);
     
    9291    FEMorphology* morphology = static_cast<FEMorphology*>(effect);
    9392    if (attrName == SVGNames::operatorAttr)
    94         return morphology->setMorphologyOperator(static_cast<MorphologyOperatorType>(_operator()));
     93        return morphology->setMorphologyOperator(_operator());
    9594    if (attrName == SVGNames::radiusAttr)
    9695        return (morphology->setRadiusX(radiusX()) || morphology->setRadiusY(radiusY()));
     
    162161        return 0;
    163162
    164     RefPtr<FilterEffect> effect = FEMorphology::create(filter, static_cast<MorphologyOperatorType>(_operator()), xRadius, yRadius);
     163    RefPtr<FilterEffect> effect = FEMorphology::create(filter, _operator(), xRadius, yRadius);
    165164    effect->inputEffects().append(input1);
    166165    return effect.release();
  • trunk/Source/WebCore/svg/SVGFEMorphologyElement.h

    r80099 r86765  
    5151    // Animated property declarations
    5252    DECLARE_ANIMATED_STRING(In1, in1)
    53     DECLARE_ANIMATED_ENUMERATION(_operator, _operator)
     53    DECLARE_ANIMATED_ENUMERATION(_operator, _operator, MorphologyOperatorType)
    5454    DECLARE_ANIMATED_NUMBER(RadiusX, radiusX)
    5555    DECLARE_ANIMATED_NUMBER(RadiusY, radiusY)
     56};
     57
     58template<>
     59struct SVGPropertyTraits<MorphologyOperatorType> {
     60    static MorphologyOperatorType highestEnumValue() { return FEMORPHOLOGY_OPERATOR_DILATE; }
     61
     62    static String toString(MorphologyOperatorType type)
     63    {
     64        switch (type) {
     65        case FEMORPHOLOGY_OPERATOR_UNKNOWN:
     66            return emptyString();
     67        case FEMORPHOLOGY_OPERATOR_ERODE:
     68            return "erode";
     69        case FEMORPHOLOGY_OPERATOR_DILATE:
     70            return "dilate";
     71        }
     72
     73        ASSERT_NOT_REACHED();
     74        return emptyString();
     75    }
     76
     77    static MorphologyOperatorType fromString(const String& value)
     78    {
     79        if (value == "erode")
     80            return FEMORPHOLOGY_OPERATOR_ERODE;
     81        if (value == "dilate")
     82            return FEMORPHOLOGY_OPERATOR_DILATE;
     83        return FEMORPHOLOGY_OPERATOR_UNKNOWN;
     84    }
    5685};
    5786
  • trunk/Source/WebCore/svg/SVGFETurbulenceElement.cpp

    r86050 r86765  
    3535DEFINE_ANIMATED_INTEGER(SVGFETurbulenceElement, SVGNames::numOctavesAttr, NumOctaves, numOctaves)
    3636DEFINE_ANIMATED_NUMBER(SVGFETurbulenceElement, SVGNames::seedAttr, Seed, seed)
    37 DEFINE_ANIMATED_ENUMERATION(SVGFETurbulenceElement, SVGNames::stitchTilesAttr, StitchTiles, stitchTiles)
    38 DEFINE_ANIMATED_ENUMERATION(SVGFETurbulenceElement, SVGNames::typeAttr, Type, type)
     37DEFINE_ANIMATED_ENUMERATION(SVGFETurbulenceElement, SVGNames::stitchTilesAttr, StitchTiles, stitchTiles, SVGStitchOptions)
     38DEFINE_ANIMATED_ENUMERATION(SVGFETurbulenceElement, SVGNames::typeAttr, Type, type, TurbulenceType)
    3939
    4040inline SVGFETurbulenceElement::SVGFETurbulenceElement(const QualifiedName& tagName, Document* document)
     
    6868    const String& value = attr->value();
    6969    if (attr->name() == SVGNames::typeAttr) {
    70         if (value == "fractalNoise")
    71             setTypeBaseValue(FETURBULENCE_TYPE_FRACTALNOISE);
    72         else if (value == "turbulence")
    73             setTypeBaseValue(FETURBULENCE_TYPE_TURBULENCE);
     70        TurbulenceType propertyValue = SVGPropertyTraits<TurbulenceType>::fromString(value);
     71        if (propertyValue > 0)
     72            setTypeBaseValue(propertyValue);
    7473    } else if (attr->name() == SVGNames::stitchTilesAttr) {
    75         if (value == "stitch")
    76             setStitchTilesBaseValue(SVG_STITCHTYPE_STITCH);
    77         else if (value == "noStitch")
    78             setStitchTilesBaseValue(SVG_STITCHTYPE_NOSTITCH);
     74        SVGStitchOptions propertyValue = SVGPropertyTraits<SVGStitchOptions>::fromString(value);
     75        if (propertyValue > 0)
     76            setStitchTilesBaseValue(propertyValue);
    7977    } else if (attr->name() == SVGNames::baseFrequencyAttr) {
    8078        float x, y;
     
    9593    FETurbulence* turbulence = static_cast<FETurbulence*>(effect);
    9694    if (attrName == SVGNames::typeAttr)
    97         return turbulence->setType(static_cast<TurbulenceType>(type()));
     95        return turbulence->setType(type());
    9896    if (attrName == SVGNames::stitchTilesAttr)
    9997        return turbulence->setStitchTiles(stitchTiles());
     
    170168    if (baseFrequencyX() < 0 || baseFrequencyY() < 0)
    171169        return 0;
    172 
    173     return FETurbulence::create(filter, static_cast<TurbulenceType>(type()), baseFrequencyX(),
    174                 baseFrequencyY(), numOctaves(), seed(), stitchTiles() == SVG_STITCHTYPE_STITCH);
     170    return FETurbulence::create(filter, type(), baseFrequencyX(), baseFrequencyY(), numOctaves(), seed(), stitchTiles() == SVG_STITCHTYPE_STITCH);
    175171}
    176172
  • trunk/Source/WebCore/svg/SVGFETurbulenceElement.h

    r79851 r86765  
    6060    DECLARE_ANIMATED_INTEGER(NumOctaves, numOctaves)
    6161    DECLARE_ANIMATED_NUMBER(Seed, seed)
    62     DECLARE_ANIMATED_ENUMERATION(StitchTiles, stitchTiles)
    63     DECLARE_ANIMATED_ENUMERATION(Type, type)
     62    DECLARE_ANIMATED_ENUMERATION(StitchTiles, stitchTiles, SVGStitchOptions)
     63    DECLARE_ANIMATED_ENUMERATION(Type, type, TurbulenceType)
     64};
     65
     66template<>
     67struct SVGPropertyTraits<SVGStitchOptions> {
     68    static SVGStitchOptions highestEnumValue() { return SVG_STITCHTYPE_NOSTITCH; }
     69
     70    static String toString(SVGStitchOptions type)
     71    {
     72        switch (type) {
     73        case SVG_STITCHTYPE_UNKNOWN:
     74            return emptyString();
     75        case SVG_STITCHTYPE_STITCH:
     76            return "stitch";
     77        case SVG_STITCHTYPE_NOSTITCH:
     78            return "noStitch";
     79        }
     80
     81        ASSERT_NOT_REACHED();
     82        return emptyString();
     83    }
     84
     85    static SVGStitchOptions fromString(const String& value)
     86    {
     87        if (value == "stitch")
     88            return SVG_STITCHTYPE_STITCH;
     89        if (value == "noStitch")
     90            return SVG_STITCHTYPE_NOSTITCH;
     91        return SVG_STITCHTYPE_UNKNOWN;
     92    }
     93};
     94
     95template<>
     96struct SVGPropertyTraits<TurbulenceType> {
     97    static TurbulenceType highestEnumValue() { return FETURBULENCE_TYPE_TURBULENCE; }
     98
     99    static String toString(TurbulenceType type)
     100    {
     101        switch (type) {
     102        case FETURBULENCE_TYPE_UNKNOWN:
     103            return emptyString();
     104        case FETURBULENCE_TYPE_FRACTALNOISE:
     105            return "fractalNoise";
     106        case FETURBULENCE_TYPE_TURBULENCE:
     107            return "turbulence";
     108        }
     109
     110        ASSERT_NOT_REACHED();
     111        return emptyString();
     112    }
     113
     114    static TurbulenceType fromString(const String& value)
     115    {
     116        if (value == "fractalNoise")
     117            return FETURBULENCE_TYPE_FRACTALNOISE;
     118        if (value == "turbulence")
     119            return FETURBULENCE_TYPE_TURBULENCE;
     120        return FETURBULENCE_TYPE_UNKNOWN;
     121    }
    64122};
    65123
  • trunk/Source/WebCore/svg/SVGFilterElement.cpp

    r86050 r86765  
    3333#include "SVGNames.h"
    3434#include "SVGParserUtilities.h"
    35 #include "SVGUnitTypes.h"
    3635
    3736namespace WebCore {
    3837
    3938// Animated property definitions
    40 DEFINE_ANIMATED_ENUMERATION(SVGFilterElement, SVGNames::filterUnitsAttr, FilterUnits, filterUnits)
    41 DEFINE_ANIMATED_ENUMERATION(SVGFilterElement, SVGNames::primitiveUnitsAttr, PrimitiveUnits, primitiveUnits)
     39DEFINE_ANIMATED_ENUMERATION(SVGFilterElement, SVGNames::filterUnitsAttr, FilterUnits, filterUnits, SVGUnitTypes::SVGUnitType)
     40DEFINE_ANIMATED_ENUMERATION(SVGFilterElement, SVGNames::primitiveUnitsAttr, PrimitiveUnits, primitiveUnits, SVGUnitTypes::SVGUnitType)
    4241DEFINE_ANIMATED_LENGTH(SVGFilterElement, SVGNames::xAttr, X, x)
    4342DEFINE_ANIMATED_LENGTH(SVGFilterElement, SVGNames::yAttr, Y, y)
     
    9695    const String& value = attr->value();
    9796    if (attr->name() == SVGNames::filterUnitsAttr) {
    98         if (value == "userSpaceOnUse")
    99             setFilterUnitsBaseValue(SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE);
    100         else if (value == "objectBoundingBox")
    101             setFilterUnitsBaseValue(SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX);
     97        SVGUnitTypes::SVGUnitType propertyValue = SVGPropertyTraits<SVGUnitTypes::SVGUnitType>::fromString(value);
     98        if (propertyValue > 0)
     99            setFilterUnitsBaseValue(propertyValue);
    102100    } else if (attr->name() == SVGNames::primitiveUnitsAttr) {
    103         if (value == "userSpaceOnUse")
    104             setPrimitiveUnitsBaseValue(SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE);
    105         else if (value == "objectBoundingBox")
    106             setPrimitiveUnitsBaseValue(SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX);
     101        SVGUnitTypes::SVGUnitType propertyValue = SVGPropertyTraits<SVGUnitTypes::SVGUnitType>::fromString(value);
     102        if (propertyValue > 0)
     103            setPrimitiveUnitsBaseValue(propertyValue);
    107104    } else if (attr->name() == SVGNames::xAttr)
    108105        setXBaseValue(SVGLength(LengthModeWidth, value));
  • trunk/Source/WebCore/svg/SVGFilterElement.h

    r78249 r86765  
    3333#include "SVGStyledElement.h"
    3434#include "SVGURIReference.h"
     35#include "SVGUnitTypes.h"
    3536
    3637namespace WebCore {
     
    6667
    6768    // Animated property declarations
    68     DECLARE_ANIMATED_ENUMERATION(FilterUnits, filterUnits)
    69     DECLARE_ANIMATED_ENUMERATION(PrimitiveUnits, primitiveUnits)
     69    DECLARE_ANIMATED_ENUMERATION(FilterUnits, filterUnits, SVGUnitTypes::SVGUnitType)
     70    DECLARE_ANIMATED_ENUMERATION(PrimitiveUnits, primitiveUnits, SVGUnitTypes::SVGUnitType)
    7071    DECLARE_ANIMATED_LENGTH(X, x)
    7172    DECLARE_ANIMATED_LENGTH(Y, y)
  • trunk/Source/WebCore/svg/SVGGradientElement.cpp

    r78345 r86765  
    3535#include "SVGTransformList.h"
    3636#include "SVGTransformable.h"
    37 #include "SVGUnitTypes.h"
    3837
    3938namespace WebCore {
    4039
    4140// Animated property definitions
    42 DEFINE_ANIMATED_ENUMERATION(SVGGradientElement, SVGNames::spreadMethodAttr, SpreadMethod, spreadMethod)
    43 DEFINE_ANIMATED_ENUMERATION(SVGGradientElement, SVGNames::gradientUnitsAttr, GradientUnits, gradientUnits)
     41DEFINE_ANIMATED_ENUMERATION(SVGGradientElement, SVGNames::spreadMethodAttr, SpreadMethod, spreadMethod, SVGGradientElement::SVGSpreadMethodType)
     42DEFINE_ANIMATED_ENUMERATION(SVGGradientElement, SVGNames::gradientUnitsAttr, GradientUnits, gradientUnits, SVGUnitTypes::SVGUnitType)
    4443DEFINE_ANIMATED_TRANSFORM_LIST(SVGGradientElement, SVGNames::gradientTransformAttr, GradientTransform, gradientTransform)
    4544DEFINE_ANIMATED_STRING(SVGGradientElement, XLinkNames::hrefAttr, Href, href)
     
    4847SVGGradientElement::SVGGradientElement(const QualifiedName& tagName, Document* document)
    4948    : SVGStyledElement(tagName, document)
     49    , m_spreadMethod(SVG_SPREADMETHOD_PAD)
    5050    , m_gradientUnits(SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX)
    5151{
     
    5555{
    5656    if (attr->name() == SVGNames::gradientUnitsAttr) {
    57         if (attr->value() == "userSpaceOnUse")
    58             setGradientUnitsBaseValue(SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE);
    59         else if (attr->value() == "objectBoundingBox")
    60             setGradientUnitsBaseValue(SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX);
     57        SVGUnitTypes::SVGUnitType propertyValue = SVGPropertyTraits<SVGUnitTypes::SVGUnitType>::fromString(attr->value());
     58        if (propertyValue > 0)
     59            setGradientUnitsBaseValue(propertyValue);
    6160    } else if (attr->name() == SVGNames::gradientTransformAttr) {
    6261        SVGTransformList newList;
     
    6766        setGradientTransformBaseValue(newList);
    6867    } else if (attr->name() == SVGNames::spreadMethodAttr) {
    69         if (attr->value() == "reflect")
    70             setSpreadMethodBaseValue(SpreadMethodReflect);
    71         else if (attr->value() == "repeat")
    72             setSpreadMethodBaseValue(SpreadMethodRepeat);
    73         else if (attr->value() == "pad")
    74             setSpreadMethodBaseValue(SpreadMethodPad);
     68        SVGSpreadMethodType propertyValue = SVGPropertyTraits<SVGSpreadMethodType>::fromString(attr->value());
     69        if (propertyValue > 0)
     70            setSpreadMethodBaseValue(propertyValue);
    7571    } else {
    7672        if (SVGURIReference::parseMappedAttribute(attr))
  • trunk/Source/WebCore/svg/SVGGradientElement.h

    r78345 r86765  
    3030#include "SVGStyledElement.h"
    3131#include "SVGURIReference.h"
     32#include "SVGUnitTypes.h"
    3233
    3334namespace WebCore {
     
    3738                           public SVGExternalResourcesRequired {
    3839public:
     40    enum SVGSpreadMethodType {
     41        SVG_SPREADMETHOD_UNKNOWN = 0,
     42        SVG_SPREADMETHOD_PAD     = 1,
     43        SVG_SPREADMETHOD_REFLECT = 2,
     44        SVG_SPREADMETHOD_REPEAT  = 3
     45    };
     46
    3947    Vector<Gradient::ColorStop> buildStops();
    4048 
     
    5361
    5462    // Animated property declarations
    55     DECLARE_ANIMATED_ENUMERATION(SpreadMethod, spreadMethod)
    56     DECLARE_ANIMATED_ENUMERATION(GradientUnits, gradientUnits)
     63    DECLARE_ANIMATED_ENUMERATION(SpreadMethod, spreadMethod, SVGSpreadMethodType)
     64    DECLARE_ANIMATED_ENUMERATION(GradientUnits, gradientUnits, SVGUnitTypes::SVGUnitType)
    5765    DECLARE_ANIMATED_TRANSFORM_LIST(GradientTransform, gradientTransform)
    5866
     
    6472};
    6573
     74template<>
     75struct SVGPropertyTraits<SVGGradientElement::SVGSpreadMethodType> {
     76    static SVGGradientElement::SVGSpreadMethodType highestEnumValue() { return SVGGradientElement::SVG_SPREADMETHOD_REPEAT; }
     77
     78    static String toString(SVGGradientElement::SVGSpreadMethodType type)
     79    {
     80        switch (type) {
     81        case SVGGradientElement::SVG_SPREADMETHOD_UNKNOWN:
     82            return emptyString();
     83        case SVGGradientElement::SVG_SPREADMETHOD_PAD:
     84            return "pad";
     85        case SVGGradientElement::SVG_SPREADMETHOD_REFLECT:
     86            return "reflect";
     87        case SVGGradientElement::SVG_SPREADMETHOD_REPEAT:
     88            return "repeat";
     89        }
     90
     91        ASSERT_NOT_REACHED();
     92        return emptyString();
     93    }
     94
     95    static SVGGradientElement::SVGSpreadMethodType fromString(const String& value)
     96    {
     97        if (value == "pad")
     98            return SVGGradientElement::SVG_SPREADMETHOD_PAD;
     99        if (value == "reflect")
     100            return SVGGradientElement::SVG_SPREADMETHOD_REFLECT;
     101        if (value == "repeat")
     102            return SVGGradientElement::SVG_SPREADMETHOD_REPEAT;
     103        return SVGGradientElement::SVG_SPREADMETHOD_UNKNOWN;
     104    }
     105};
     106
    66107} // namespace WebCore
    67108
  • trunk/Source/WebCore/svg/SVGLinearGradientElement.cpp

    r86050 r86765  
    147147    while (current) {
    148148        if (!attributes.hasSpreadMethod() && current->hasAttribute(SVGNames::spreadMethodAttr))
    149             attributes.setSpreadMethod((GradientSpreadMethod) current->spreadMethod());
     149            attributes.setSpreadMethod(current->spreadMethod());
    150150
    151151        if (!attributes.hasBoundingBoxMode() && current->hasAttribute(SVGNames::gradientUnitsAttr))
  • trunk/Source/WebCore/svg/SVGMarkerElement.cpp

    r86050 r86765  
    3838DEFINE_ANIMATED_LENGTH(SVGMarkerElement, SVGNames::markerWidthAttr, MarkerWidth, markerWidth)
    3939DEFINE_ANIMATED_LENGTH(SVGMarkerElement, SVGNames::markerHeightAttr, MarkerHeight, markerHeight)
    40 DEFINE_ANIMATED_ENUMERATION(SVGMarkerElement, SVGNames::markerUnitsAttr, MarkerUnits, markerUnits)
    41 DEFINE_ANIMATED_ENUMERATION_MULTIPLE_WRAPPERS(SVGMarkerElement, SVGNames::orientAttr, orientTypeIdentifier(), OrientType, orientType)
     40DEFINE_ANIMATED_ENUMERATION(SVGMarkerElement, SVGNames::markerUnitsAttr, MarkerUnits, markerUnits, SVGMarkerElement::SVGMarkerUnitsType)
    4241DEFINE_ANIMATED_ANGLE_MULTIPLE_WRAPPERS(SVGMarkerElement, SVGNames::orientAttr, orientAngleIdentifier(), OrientAngle, orientAngle)
    4342DEFINE_ANIMATED_BOOLEAN(SVGMarkerElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
     
    8281void SVGMarkerElement::parseMappedAttribute(Attribute* attr)
    8382{
     83    const String& value = attr->value();
    8484    if (attr->name() == SVGNames::markerUnitsAttr) {
    85         if (attr->value() == "userSpaceOnUse")
    86             setMarkerUnitsBaseValue(SVG_MARKERUNITS_USERSPACEONUSE);
    87         else if (attr->value() == "strokeWidth")
    88             setMarkerUnitsBaseValue(SVG_MARKERUNITS_STROKEWIDTH);
     85        SVGMarkerUnitsType propertyValue = SVGPropertyTraits<SVGMarkerUnitsType>::fromString(value);
     86        if (propertyValue > 0)
     87            setMarkerUnitsBaseValue(propertyValue);
    8988    } else if (attr->name() == SVGNames::refXAttr)
    90         setRefXBaseValue(SVGLength(LengthModeWidth, attr->value()));
     89        setRefXBaseValue(SVGLength(LengthModeWidth, value));
    9190    else if (attr->name() == SVGNames::refYAttr)
    92         setRefYBaseValue(SVGLength(LengthModeHeight, attr->value()));
     91        setRefYBaseValue(SVGLength(LengthModeHeight, value));
    9392    else if (attr->name() == SVGNames::markerWidthAttr)
    94         setMarkerWidthBaseValue(SVGLength(LengthModeWidth, attr->value()));
     93        setMarkerWidthBaseValue(SVGLength(LengthModeWidth, value));
    9594    else if (attr->name() == SVGNames::markerHeightAttr)
    96         setMarkerHeightBaseValue(SVGLength(LengthModeHeight, attr->value()));
     95        setMarkerHeightBaseValue(SVGLength(LengthModeHeight, value));
    9796    else if (attr->name() == SVGNames::orientAttr) {
    9897        SVGAngle angle;
    99 
    100         if (attr->value() == "auto")
    101             setOrientTypeBaseValue(SVG_MARKER_ORIENT_AUTO);
    102         else {
    103             ExceptionCode ec = 0;
    104             angle.setValueAsString(attr->value(), ec);
    105             setOrientTypeBaseValue(SVG_MARKER_ORIENT_ANGLE);
    106         }
    107 
    108         setOrientAngleBaseValue(angle);
     98        SVGMarkerOrientType orientType = SVGPropertyTraits<SVGMarkerOrientType>::fromString(value, angle);
     99        if (orientType > 0)
     100            setOrientTypeBaseValue(orientType);
     101        if (orientType == SVG_MARKER_ORIENT_ANGLE)
     102            setOrientAngleBaseValue(angle);
    109103    } else {
    110104        if (SVGLangSpace::parseMappedAttribute(attr))
     
    247241}
    248242
     243void SVGMarkerElement::synchronizeOrientType()
     244{
     245    if (!m_orientType.shouldSynchronize)
     246        return;
     247   
     248    AtomicString value;
     249    if (m_orientType.value == SVG_MARKER_ORIENT_AUTO)
     250        value = "auto";
     251    else if (m_orientType.value == SVG_MARKER_ORIENT_ANGLE)
     252        value = orientAngle().valueAsString();
     253
     254    SVGAnimatedPropertySynchronizer<true>::synchronize(this, SVGNames::orientAttr, value);
     255}
     256
     257PassRefPtr<SVGAnimatedEnumerationPropertyTearOff<SVGMarkerElement::SVGMarkerOrientType> > SVGMarkerElement::orientTypeAnimated()
     258{
     259    m_orientType.shouldSynchronize = true;
     260    return SVGAnimatedProperty::lookupOrCreateWrapper<SVGAnimatedEnumerationPropertyTearOff<SVGMarkerOrientType>, SVGMarkerOrientType>(this, SVGNames::orientAttr, orientTypeIdentifier(), m_orientType.value);
     261}
     262
    249263}
    250264
  • trunk/Source/WebCore/svg/SVGMarkerElement.h

    r78249 r86765  
    8484    DECLARE_ANIMATED_LENGTH(MarkerWidth, markerWidth)
    8585    DECLARE_ANIMATED_LENGTH(MarkerHeight, markerHeight)
    86     DECLARE_ANIMATED_ENUMERATION(MarkerUnits, markerUnits)
    87     DECLARE_ANIMATED_ENUMERATION(OrientType, orientType)
     86    DECLARE_ANIMATED_ENUMERATION(MarkerUnits, markerUnits, SVGMarkerUnitsType)
    8887    DECLARE_ANIMATED_ANGLE(OrientAngle, orientAngle)
    8988
     
    9493    DECLARE_ANIMATED_RECT(ViewBox, viewBox)
    9594    DECLARE_ANIMATED_PRESERVEASPECTRATIO(PreserveAspectRatio, preserveAspectRatio)
     95
     96public:
     97    // Custom animated property: orientType
     98    SVGMarkerOrientType& orientType() const { return m_orientType.value; }
     99    SVGMarkerOrientType& orientTypeBaseValue() const { return m_orientType.value; }
     100    void setOrientTypeBaseValue(const SVGMarkerOrientType& type) { m_orientType.value = type; }
     101    PassRefPtr<SVGAnimatedEnumerationPropertyTearOff<SVGMarkerOrientType> > orientTypeAnimated();
     102
     103private:
     104    void synchronizeOrientType();
     105    mutable SVGSynchronizableAnimatedProperty<SVGMarkerOrientType> m_orientType;
     106};
     107
     108template<>
     109struct SVGPropertyTraits<SVGMarkerElement::SVGMarkerUnitsType> {
     110    static SVGMarkerElement::SVGMarkerUnitsType highestEnumValue() { return SVGMarkerElement::SVG_MARKERUNITS_STROKEWIDTH; }
     111
     112    static String toString(SVGMarkerElement::SVGMarkerUnitsType type)
     113    {
     114        switch (type) {
     115        case SVGMarkerElement::SVG_MARKERUNITS_UNKNOWN:
     116            return emptyString();
     117        case SVGMarkerElement::SVG_MARKERUNITS_USERSPACEONUSE:
     118            return "userSpaceOnUse";
     119        case SVGMarkerElement::SVG_MARKERUNITS_STROKEWIDTH:
     120            return "strokeWidth";
     121        }
     122
     123        ASSERT_NOT_REACHED();
     124        return emptyString();
     125    }
     126
     127    static SVGMarkerElement::SVGMarkerUnitsType fromString(const String& value)
     128    {
     129        if (value == "userSpaceOnUse")
     130            return SVGMarkerElement::SVG_MARKERUNITS_USERSPACEONUSE;
     131        if (value == "strokeWidth")
     132            return SVGMarkerElement::SVG_MARKERUNITS_STROKEWIDTH;
     133        return SVGMarkerElement::SVG_MARKERUNITS_UNKNOWN;
     134    }
     135};
     136
     137template<>
     138struct SVGPropertyTraits<SVGMarkerElement::SVGMarkerOrientType> {
     139    static SVGMarkerElement::SVGMarkerOrientType highestEnumValue() { return SVGMarkerElement::SVG_MARKER_ORIENT_ANGLE; }
     140
     141    // toString is not needed, synchronizeOrientType() handles this on its own.
     142
     143    static SVGMarkerElement::SVGMarkerOrientType fromString(const String& value, SVGAngle& angle)
     144    {
     145        if (value == "auto")
     146            return SVGMarkerElement::SVG_MARKER_ORIENT_AUTO;
     147
     148        ExceptionCode ec = 0;
     149        angle.setValueAsString(value, ec);
     150        if (!ec)
     151            return SVGMarkerElement::SVG_MARKER_ORIENT_ANGLE;
     152        return SVGMarkerElement::SVG_MARKER_ORIENT_UNKNOWN;
     153    }
    96154};
    97155
  • trunk/Source/WebCore/svg/SVGMaskElement.cpp

    r86050 r86765  
    3737
    3838// Animated property definitions
    39 DEFINE_ANIMATED_ENUMERATION(SVGMaskElement, SVGNames::maskUnitsAttr, MaskUnits, maskUnits)
    40 DEFINE_ANIMATED_ENUMERATION(SVGMaskElement, SVGNames::maskContentUnitsAttr, MaskContentUnits, maskContentUnits)
     39DEFINE_ANIMATED_ENUMERATION(SVGMaskElement, SVGNames::maskUnitsAttr, MaskUnits, maskUnits, SVGUnitTypes::SVGUnitType)
     40DEFINE_ANIMATED_ENUMERATION(SVGMaskElement, SVGNames::maskContentUnitsAttr, MaskContentUnits, maskContentUnits, SVGUnitTypes::SVGUnitType)
    4141DEFINE_ANIMATED_LENGTH(SVGMaskElement, SVGNames::xAttr, X, x)
    4242DEFINE_ANIMATED_LENGTH(SVGMaskElement, SVGNames::yAttr, Y, y)
     
    6767{
    6868    if (attr->name() == SVGNames::maskUnitsAttr) {
    69         if (attr->value() == "userSpaceOnUse")
    70             setMaskUnitsBaseValue(SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE);
    71         else if (attr->value() == "objectBoundingBox")
    72             setMaskUnitsBaseValue(SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX);
     69        SVGUnitTypes::SVGUnitType propertyValue = SVGPropertyTraits<SVGUnitTypes::SVGUnitType>::fromString(attr->value());
     70        if (propertyValue > 0)
     71            setMaskUnitsBaseValue(propertyValue);
    7372    } else if (attr->name() == SVGNames::maskContentUnitsAttr) {
    74         if (attr->value() == "userSpaceOnUse")
    75             setMaskContentUnitsBaseValue(SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE);
    76         else if (attr->value() == "objectBoundingBox")
    77             setMaskContentUnitsBaseValue(SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX);
     73        SVGUnitTypes::SVGUnitType propertyValue = SVGPropertyTraits<SVGUnitTypes::SVGUnitType>::fromString(attr->value());
     74        if (propertyValue > 0)
     75            setMaskContentUnitsBaseValue(propertyValue);
    7876    } else if (attr->name() == SVGNames::xAttr)
    7977        setXBaseValue(SVGLength(LengthModeWidth, attr->value()));
  • trunk/Source/WebCore/svg/SVGMaskElement.h

    r78249 r86765  
    2929#include "SVGStyledLocatableElement.h"
    3030#include "SVGTests.h"
     31#include "SVGUnitTypes.h"
    3132
    3233namespace WebCore {
     
    5960
    6061    // Animated property declarations
    61     DECLARE_ANIMATED_ENUMERATION(MaskUnits, maskUnits)
    62     DECLARE_ANIMATED_ENUMERATION(MaskContentUnits, maskContentUnits)
     62    DECLARE_ANIMATED_ENUMERATION(MaskUnits, maskUnits, SVGUnitTypes::SVGUnitType)
     63    DECLARE_ANIMATED_ENUMERATION(MaskContentUnits, maskContentUnits, SVGUnitTypes::SVGUnitType)
    6364    DECLARE_ANIMATED_LENGTH(X, x)
    6465    DECLARE_ANIMATED_LENGTH(Y, y)
  • trunk/Source/WebCore/svg/SVGPatternElement.cpp

    r86050 r86765  
    3939#include "SVGStyledTransformableElement.h"
    4040#include "SVGTransformable.h"
    41 #include "SVGUnitTypes.h"
    4241
    4342namespace WebCore {
     
    4847DEFINE_ANIMATED_LENGTH(SVGPatternElement, SVGNames::widthAttr, Width, width)
    4948DEFINE_ANIMATED_LENGTH(SVGPatternElement, SVGNames::heightAttr, Height, height)
    50 DEFINE_ANIMATED_ENUMERATION(SVGPatternElement, SVGNames::patternUnitsAttr, PatternUnits, patternUnits)
    51 DEFINE_ANIMATED_ENUMERATION(SVGPatternElement, SVGNames::patternContentUnitsAttr, PatternContentUnits, patternContentUnits)
     49DEFINE_ANIMATED_ENUMERATION(SVGPatternElement, SVGNames::patternUnitsAttr, PatternUnits, patternUnits, SVGUnitTypes::SVGUnitType)
     50DEFINE_ANIMATED_ENUMERATION(SVGPatternElement, SVGNames::patternContentUnitsAttr, PatternContentUnits, patternContentUnits, SVGUnitTypes::SVGUnitType)
    5251DEFINE_ANIMATED_TRANSFORM_LIST(SVGPatternElement, SVGNames::patternTransformAttr, PatternTransform, patternTransform)
    5352DEFINE_ANIMATED_STRING(SVGPatternElement, XLinkNames::hrefAttr, Href, href)
     
    7675{
    7776    if (attr->name() == SVGNames::patternUnitsAttr) {
    78         if (attr->value() == "userSpaceOnUse")
    79             setPatternUnitsBaseValue(SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE);
    80         else if (attr->value() == "objectBoundingBox")
    81             setPatternUnitsBaseValue(SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX);
     77        SVGUnitTypes::SVGUnitType propertyValue = SVGPropertyTraits<SVGUnitTypes::SVGUnitType>::fromString(attr->value());
     78        if (propertyValue > 0)
     79            setPatternUnitsBaseValue(propertyValue);
    8280    } else if (attr->name() == SVGNames::patternContentUnitsAttr) {
    83         if (attr->value() == "userSpaceOnUse")
    84             setPatternContentUnitsBaseValue(SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE);
    85         else if (attr->value() == "objectBoundingBox")
    86             setPatternContentUnitsBaseValue(SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX);
     81        SVGUnitTypes::SVGUnitType propertyValue = SVGPropertyTraits<SVGUnitTypes::SVGUnitType>::fromString(attr->value());
     82        if (propertyValue > 0)
     83            setPatternContentUnitsBaseValue(propertyValue);
    8784    } else if (attr->name() == SVGNames::patternTransformAttr) {
    8885        SVGTransformList newList;
  • trunk/Source/WebCore/svg/SVGPatternElement.h

    r78249 r86765  
    3535#include "SVGTests.h"
    3636#include "SVGURIReference.h"
     37#include "SVGUnitTypes.h"
    3738
    3839namespace WebCore {
     
    7374    DECLARE_ANIMATED_LENGTH(Width, width)
    7475    DECLARE_ANIMATED_LENGTH(Height, height)
    75     DECLARE_ANIMATED_ENUMERATION(PatternUnits, patternUnits)
    76     DECLARE_ANIMATED_ENUMERATION(PatternContentUnits, patternContentUnits)
     76    DECLARE_ANIMATED_ENUMERATION(PatternUnits, patternUnits, SVGUnitTypes::SVGUnitType)
     77    DECLARE_ANIMATED_ENUMERATION(PatternContentUnits, patternContentUnits, SVGUnitTypes::SVGUnitType)
    7778    DECLARE_ANIMATED_TRANSFORM_LIST(PatternTransform, patternTransform)
    7879
  • trunk/Source/WebCore/svg/SVGRadialGradientElement.cpp

    r86050 r86765  
    158158    while (current) {
    159159        if (!attributes.hasSpreadMethod() && current->hasAttribute(SVGNames::spreadMethodAttr))
    160             attributes.setSpreadMethod((GradientSpreadMethod) current->spreadMethod());
     160            attributes.setSpreadMethod(current->spreadMethod());
    161161
    162162        if (!attributes.hasBoundingBoxMode() && current->hasAttribute(SVGNames::gradientUnitsAttr))
  • trunk/Source/WebCore/svg/SVGTextContentElement.cpp

    r85864 r86765  
    3838
    3939// Animated property definitions
    40 DEFINE_ANIMATED_ENUMERATION(SVGTextContentElement, SVGNames::lengthAdjustAttr, LengthAdjust, lengthAdjust)
     40DEFINE_ANIMATED_ENUMERATION(SVGTextContentElement, SVGNames::lengthAdjustAttr, LengthAdjust, lengthAdjust, SVGTextContentElement::SVGLengthAdjustType)
    4141DEFINE_ANIMATED_BOOLEAN(SVGTextContentElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
    4242
     
    183183{
    184184    if (attr->name() == SVGNames::lengthAdjustAttr) {
    185         if (attr->value() == "spacing")
    186             setLengthAdjustBaseValue(LENGTHADJUST_SPACING);
    187         else if (attr->value() == "spacingAndGlyphs")
    188             setLengthAdjustBaseValue(LENGTHADJUST_SPACINGANDGLYPHS);
     185        SVGLengthAdjustType propertyValue = SVGPropertyTraits<SVGLengthAdjustType>::fromString(attr->value());
     186        if (propertyValue > 0)
     187            setLengthAdjustBaseValue(propertyValue);
    189188    } else if (attr->name() == SVGNames::textLengthAttr) {
    190189        m_textLength.value = SVGLength(LengthModeOther, attr->value());
  • trunk/Source/WebCore/svg/SVGTextContentElement.h

    r83710 r86765  
    8080    SVGLength m_specifiedTextLength;
    8181    mutable SVGSynchronizableAnimatedProperty<SVGLength> m_textLength;
    82     DECLARE_ANIMATED_ENUMERATION(LengthAdjust, lengthAdjust)
     82    DECLARE_ANIMATED_ENUMERATION(LengthAdjust, lengthAdjust, SVGLengthAdjustType)
    8383
    8484    // SVGExternalResourcesRequired
    8585    DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
     86};
     87
     88template<>
     89struct SVGPropertyTraits<SVGTextContentElement::SVGLengthAdjustType> {
     90    static SVGTextContentElement::SVGLengthAdjustType highestEnumValue() { return SVGTextContentElement::LENGTHADJUST_SPACINGANDGLYPHS; }
     91
     92    static String toString(SVGTextContentElement::SVGLengthAdjustType type)
     93    {
     94        switch (type) {
     95        case SVGTextContentElement::LENGTHADJUST_UNKNOWN:
     96            return emptyString();
     97        case SVGTextContentElement::LENGTHADJUST_SPACING:
     98            return "spacing";
     99        case SVGTextContentElement::LENGTHADJUST_SPACINGANDGLYPHS:
     100            return "spacingAndGlyphs";
     101        }
     102
     103        ASSERT_NOT_REACHED();
     104        return emptyString();
     105    }
     106
     107    static SVGTextContentElement::SVGLengthAdjustType fromString(const String& value)
     108    {
     109        if (value == "spacingAndGlyphs")
     110            return SVGTextContentElement::LENGTHADJUST_SPACINGANDGLYPHS;
     111        if (value == "spacing")
     112            return SVGTextContentElement::LENGTHADJUST_SPACING;
     113        return SVGTextContentElement::LENGTHADJUST_UNKNOWN;
     114    }
    86115};
    87116
  • trunk/Source/WebCore/svg/SVGTextPathElement.cpp

    r86050 r86765  
    3333// Animated property definitions
    3434DEFINE_ANIMATED_LENGTH(SVGTextPathElement, SVGNames::startOffsetAttr, StartOffset, startOffset)
    35 DEFINE_ANIMATED_ENUMERATION(SVGTextPathElement, SVGNames::methodAttr, Method, method)
    36 DEFINE_ANIMATED_ENUMERATION(SVGTextPathElement, SVGNames::spacingAttr, Spacing, spacing)
     35DEFINE_ANIMATED_ENUMERATION(SVGTextPathElement, SVGNames::methodAttr, Method, method, SVGTextPathMethodType)
     36DEFINE_ANIMATED_ENUMERATION(SVGTextPathElement, SVGNames::spacingAttr, Spacing, spacing, SVGTextPathSpacingType)
    3737DEFINE_ANIMATED_STRING(SVGTextPathElement, XLinkNames::hrefAttr, Href, href)
    3838
     
    5454{
    5555    const String& value = attr->value();
    56 
    5756    if (attr->name() == SVGNames::startOffsetAttr)
    5857        setStartOffsetBaseValue(SVGLength(LengthModeOther, value));
    5958    else if (attr->name() == SVGNames::methodAttr) {
    60         if (value == "align")
    61             setSpacingBaseValue(SVG_TEXTPATH_METHODTYPE_ALIGN);
    62         else if (value == "stretch")
    63             setSpacingBaseValue(SVG_TEXTPATH_METHODTYPE_STRETCH);
     59        SVGTextPathMethodType propertyValue = SVGPropertyTraits<SVGTextPathMethodType>::fromString(value);
     60        if (propertyValue > 0)
     61            setMethodBaseValue(propertyValue);
    6462    } else if (attr->name() == SVGNames::spacingAttr) {
    65         if (value == "auto")
    66             setMethodBaseValue(SVG_TEXTPATH_SPACINGTYPE_AUTO);
    67         else if (value == "exact")
    68             setMethodBaseValue(SVG_TEXTPATH_SPACINGTYPE_EXACT);
     63        SVGTextPathSpacingType propertyValue = SVGPropertyTraits<SVGTextPathSpacingType>::fromString(value);
     64        if (propertyValue > 0)
     65            setSpacingBaseValue(propertyValue);
    6966    } else {
    7067        if (SVGURIReference::parseMappedAttribute(attr))
  • trunk/Source/WebCore/svg/SVGTextPathElement.h

    r78249 r86765  
    7474    // Animated property declarations
    7575    DECLARE_ANIMATED_LENGTH(StartOffset, startOffset)
    76     DECLARE_ANIMATED_ENUMERATION(Method, method)
    77     DECLARE_ANIMATED_ENUMERATION(Spacing, spacing)
     76    DECLARE_ANIMATED_ENUMERATION(Method, method, SVGTextPathMethodType)
     77    DECLARE_ANIMATED_ENUMERATION(Spacing, spacing, SVGTextPathSpacingType)
    7878
    7979    // SVGURIReference
    8080    DECLARE_ANIMATED_STRING(Href, href)
     81};
     82
     83template<>
     84struct SVGPropertyTraits<SVGTextPathMethodType> {
     85    static SVGTextPathMethodType highestEnumValue() { return SVG_TEXTPATH_METHODTYPE_STRETCH; }
     86
     87    static String toString(SVGTextPathMethodType type)
     88    {
     89        switch (type) {
     90        case SVG_TEXTPATH_METHODTYPE_UNKNOWN:
     91            return emptyString();
     92        case SVG_TEXTPATH_METHODTYPE_ALIGN:
     93            return "align";
     94        case SVG_TEXTPATH_METHODTYPE_STRETCH:
     95            return "stretch";
     96        }
     97   
     98        ASSERT_NOT_REACHED();
     99        return emptyString();
     100    }
     101
     102    static SVGTextPathMethodType fromString(const String& value)
     103    {
     104        if (value == "align")
     105            return SVG_TEXTPATH_METHODTYPE_ALIGN;
     106        if (value == "stretch")
     107            return SVG_TEXTPATH_METHODTYPE_STRETCH;
     108        return SVG_TEXTPATH_METHODTYPE_UNKNOWN;
     109    }
     110};
     111
     112template<>
     113struct SVGPropertyTraits<SVGTextPathSpacingType> {
     114    static SVGTextPathSpacingType highestEnumValue() { return SVG_TEXTPATH_SPACINGTYPE_EXACT; }
     115
     116    static String toString(SVGTextPathSpacingType type)
     117    {
     118        switch (type) {
     119        case SVG_TEXTPATH_SPACINGTYPE_UNKNOWN:
     120            return emptyString();
     121        case SVG_TEXTPATH_SPACINGTYPE_AUTO:
     122            return "auto";
     123        case SVG_TEXTPATH_SPACINGTYPE_EXACT:
     124            return "exact";
     125        }
     126
     127        ASSERT_NOT_REACHED();
     128        return emptyString();
     129    }
     130
     131    static SVGTextPathSpacingType fromString(const String& value)
     132    {
     133        if (value == "auto")
     134            return SVG_TEXTPATH_SPACINGTYPE_AUTO;
     135        if (value == "exact")
     136            return SVG_TEXTPATH_SPACINGTYPE_EXACT;
     137        return SVG_TEXTPATH_SPACINGTYPE_UNKNOWN;
     138    }
    81139};
    82140
  • trunk/Source/WebCore/svg/SVGUnitTypes.h

    r64579 r86765  
    2222
    2323#if ENABLE(SVG)
    24 
     24#include "SVGPropertyTraits.h"
    2525#include <wtf/RefCounted.h>
    2626
     
    3939};
    4040
    41 static inline SVGUnitTypes::SVGUnitType toUnitType(int type) { return static_cast<SVGUnitTypes::SVGUnitType>(type); }
     41template<>
     42struct SVGPropertyTraits<SVGUnitTypes::SVGUnitType> {
     43    static SVGUnitTypes::SVGUnitType highestEnumValue() { return SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX; }
     44
     45    static String toString(SVGUnitTypes::SVGUnitType type)
     46    {
     47        switch (type) {
     48        case SVGUnitTypes::SVG_UNIT_TYPE_UNKNOWN:
     49            return emptyString();
     50        case SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE:
     51            return "userSpaceOnUse";
     52        case SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX:
     53            return "objectBoundingBox";
     54        }
     55
     56        ASSERT_NOT_REACHED();
     57        return emptyString();
     58    }
     59
     60    static SVGUnitTypes::SVGUnitType fromString(const String& value)
     61    {
     62        if (value == "userSpaceOnUse")
     63            return SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE;
     64        if (value == "objectBoundingBox")
     65            return SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX;
     66        return SVGUnitTypes::SVG_UNIT_TYPE_UNKNOWN;
     67    }
     68};
    4269
    4370}
  • trunk/Source/WebCore/svg/properties/SVGAnimatedStaticPropertyTearOff.h

    r70857 r86765  
    4040    }
    4141
    42     void setBaseVal(const PropertyType& property)
     42    virtual void setBaseVal(const PropertyType& property, ExceptionCode&)
    4343    {
    4444        m_property = property;
     
    4949    void setAnimVal(const PropertyType&) { }
    5050
    51 private:
     51protected:
    5252    friend class SVGAnimatedProperty;
    5353
     
    6464    }
    6565
     66    virtual ~SVGAnimatedStaticPropertyTearOff() { }
     67
    6668private:
    6769    PropertyType& m_property;
Note: See TracChangeset for help on using the changeset viewer.