2010-11-22 Nikolas Zimmermann <nzimmermann@rim.com>
Reviewed by Dirk Schulze.
Fix various problems with the SVG*List code
https://bugs.webkit.org/show_bug.cgi?id=49880
Add tests for all SVG*List types, that were missing.
Add SVG 1.1 2nd edition testcase, types-dom-07-f.svg, testing that all animVal values are readonly.
* platform/mac-leopard/svg/custom/baseval-animval-equality-expected.checksum:
* platform/mac-leopard/svg/custom/baseval-animval-equality-expected.png:
* platform/mac-leopard/svg/dom/SVGLengthList-basics-expected.checksum:
* platform/mac-leopard/svg/dom/SVGLengthList-basics-expected.png:
* platform/mac/svg/W3C-SVG-1.1-SE/types-dom-07-f-expected.checksum: Added.
* platform/mac/svg/W3C-SVG-1.1-SE/types-dom-07-f-expected.png: Added.
* platform/mac/svg/W3C-SVG-1.1-SE/types-dom-07-f-expected.txt: Added.
* platform/mac/svg/custom/baseval-animval-equality-expected.txt:
* platform/mac/svg/dom/SVGNumberList-basics-expected.checksum: Added.
* platform/mac/svg/dom/SVGNumberList-basics-expected.png: Added.
* platform/mac/svg/dom/SVGPointList-basics-expected.checksum: Added.
* platform/mac/svg/dom/SVGPointList-basics-expected.png: Added.
* platform/mac/svg/dom/SVGStringList-basics-expected.checksum: Added.
* platform/mac/svg/dom/SVGStringList-basics-expected.png: Added.
* platform/mac/svg/dom/SVGTransformList-basics-expected.checksum: Added.
* platform/mac/svg/dom/SVGTransformList-basics-expected.png: Added.
* svg/W3C-SVG-1.1-SE/types-dom-07-f.svg: Added.
* svg/custom/baseval-animval-equality.svg: Fix wrong test.
* svg/custom/polyline-points-crash-expected.txt:
* svg/dom/SVGLengthList-basics-expected.txt:
* svg/dom/SVGLengthList-basics.xhtml: Extended test, synchronized with the other SVG*List tests.
* svg/dom/SVGNumberList-basics-expected.txt: Added.
* svg/dom/SVGNumberList-basics.xhtml: Added.
* svg/dom/SVGPointList-basics-expected.txt: Added.
* svg/dom/SVGPointList-basics.xhtml: Added.
* svg/dom/SVGStringList-basics-expected.txt: Added.
* svg/dom/SVGStringList-basics.xhtml: Added.
* svg/dom/SVGTransformList-basics-expected.txt: Added.
* svg/dom/SVGTransformList-basics.xhtml: Added.
* svg/dom/svglist-exception-on-out-bounds-error-expected.txt:
2010-11-22 Nikolas Zimmermann <nzimmermann@rim.com>
Reviewed by Dirk Schulze.
Fix various problems with the SVG*List code
https://bugs.webkit.org/show_bug.cgi?id=49880
Write tests for SVGNumberList/SVGPointList/SVGStringList/SVGTransformList and extend SVGLengthList tests.
SVG DOM <-> XML DOM synchronization is now tested for all these types, and works great. Unify the string format produced
by the various valueAsString() functions for maximum compatibility with Firefox / Opera.
* Build a real transform string for SVGTransformList, instead of dumping the elements of the concatted matrix.
* Add SVGStringList XML dom synchronization, only affects SVGTests requiredFeatures/requiredExtensions/systemLanguage.
* Make all animVal properties readonly, tested by types-dom-07-f.svg (from SVG 1.1 2nd edition).
* Enable StrictTypeChecking/RequiresAllArguments=Raise for all SVGList types.
Tests: svg/W3C-SVG-1.1-SE/types-dom-07-f.svg
svg/dom/SVGNumberList-basics.xhtml
svg/dom/SVGPointList-basics.xhtml
svg/dom/SVGStringList-basics.xhtml
svg/dom/SVGTransformList-basics.xhtml
* bindings/js/JSSVGLengthCustom.cpp:
(WebCore::JSSVGLength::setValue): Throw NO_MODIFICATION_ALLOWED_ERR when the SVGPropertyTearOffs role is AnimValRole.
(WebCore::JSSVGLength::convertToSpecifiedUnits): Ditto.
* bindings/scripts/CodeGeneratorJS.pm: Ditto.
* bindings/scripts/CodeGeneratorObjC.pm: Ditto.
* bindings/scripts/CodeGeneratorV8.pm: Ditto.
* bindings/v8/custom/V8SVGLengthCustom.cpp:
(WebCore::V8SVGLength::valueAccessorSetter): Ditto.
(WebCore::V8SVGLength::convertToSpecifiedUnitsCallback): Ditto.
* svg/SVGAElement.cpp:
(WebCore::SVGAElement::synchronizeProperty): Also synchronize the SVGTests SVGStringLists.
* svg/SVGAnimationElement.cpp:
(WebCore::SVGAnimationElement::synchronizeProperty): Ditto.
* svg/SVGCircleElement.cpp:
(WebCore::SVGCircleElement::synchronizeProperty): Ditto.
* svg/SVGClipPathElement.cpp:
(WebCore::SVGClipPathElement::synchronizeProperty): Ditto.
* svg/SVGCursorElement.cpp:
(WebCore::SVGCursorElement::synchronizeProperty): Ditto.
* svg/SVGDefsElement.cpp:
(WebCore::SVGDefsElement::synchronizeProperty): Ditto.
* svg/SVGEllipseElement.cpp:
(WebCore::SVGEllipseElement::synchronizeProperty): Ditto.
* svg/SVGForeignObjectElement.cpp:
(WebCore::SVGForeignObjectElement::synchronizeProperty): Ditto.
* svg/SVGGElement.cpp:
(WebCore::SVGGElement::synchronizeProperty): Ditto.
* svg/SVGImageElement.cpp:
(WebCore::SVGImageElement::synchronizeProperty): Ditto.
* svg/SVGLengthList.cpp:
(WebCore::SVGLengthList::valueAsString): Use ' ' instead of ',' as seperator.
* svg/SVGLengthList.idl: Enable StrictTypeChecking, RequiresAllArguments=Raise.
* svg/SVGLineElement.cpp:
(WebCore::SVGLineElement::synchronizeProperty): Also synchronize the SVGTests SVGStringLists.
* svg/SVGMaskElement.cpp:
(WebCore::SVGMaskElement::synchronizeProperty): Ditto.
* svg/SVGNumberList.cpp:
(WebCore::SVGNumberList::valueAsString): Use ' ' instead of ',' as seperator.
* svg/SVGNumberList.idl: Enable StrictTypeChecking, RequiresAllArguments=Raise.
* svg/SVGPathElement.cpp:
(WebCore::SVGPathElement::synchronizeProperty): Also synchronize the SVGTests SVGStringLists.
* svg/SVGPatternElement.cpp:
(WebCore::SVGPatternElement::synchronizeProperty): Ditto.
* svg/SVGPointList.idl: Enable StrictTypeChecking, RequiresAllArguments=Raise.
* svg/SVGPolyElement.cpp:
(WebCore::SVGPolyElement::synchronizeProperty): Also synchronize the SVGTests SVGStringLists.
* svg/SVGRectElement.cpp:
(WebCore::SVGRectElement::synchronizeProperty): Ditto.
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::synchronizeProperty): Ditto.
* svg/SVGStringList.cpp:
(WebCore::SVGStringList::valueAsString): Add valueAsString() implementation, necessary for SVG DOM <-> XML DOM synchronization.
* svg/SVGStringList.h:
* svg/SVGStringList.idl: Enable StrictTypeChecking, RequiresAllArguments=Raise.
* svg/SVGSwitchElement.cpp:
(WebCore::SVGSwitchElement::synchronizeProperty): Also synchronize the SVGTests SVGStringLists.
* svg/SVGTests.cpp: Rewrite, similar to SVGPolyElement, to synchronize the requiredFeatures/requiredExtension/systemLanguage SVGStringLists with their XML DOM attributes.
(WebCore::SVGTests::SVGTests):
(WebCore::SVGTests::isValid):
(WebCore::SVGTests::parseMappedAttribute):
(WebCore::SVGTests::isKnownAttribute):
(WebCore::SVGTests::handleAttributeChange):
(WebCore::SVGTests::synchronizeProperties): To be called by all classes inheriting from SVGTests, in their synchronizeProperty() methods.
(WebCore::SVGTests::synchronizeRequiredFeatures):
(WebCore::SVGTests::synchronizeRequiredExtensions):
(WebCore::SVGTests::synchronizeSystemLanguage):
(WebCore::SVGTests::requiredFeatures):
(WebCore::SVGTests::requiredExtensions):
(WebCore::SVGTests::systemLanguage):
* svg/SVGTests.h:
* svg/SVGTextContentElement.cpp:
(WebCore::SVGTextContentElement::synchronizeProperty): Also synchronize the SVGTests SVGStringLists.
* svg/SVGTransform.cpp:
(WebCore::SVGTransform::valueAsString): Added a proper way to serialize a SVGTransform into a String.
* svg/SVGTransform.h:
* svg/SVGTransformList.cpp:
(WebCore::SVGTransformList::valueAsString): Rewrite, to build a real transform list string, instead of dumping the concatted matrix.
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::synchronizeProperty): Also synchronize the SVGTests SVGStringLists.
* svg/properties/SVGListProperty.h: s/TYPE_MISMATCH_ERR/SVGException::SVG_WRONG_TYPE_ERR/ for compatibility with Firefox.
(WebCore::SVGListProperty::initializeValuesAndWrappers):
(WebCore::SVGListProperty::insertItemBeforeValuesAndWrappers):
(WebCore::SVGListProperty::replaceItemValues):
(WebCore::SVGListProperty::replaceItemValuesAndWrappers):
(WebCore::SVGListProperty::removeItemValuesAndWrappers): Handle corner case, the item passed to removeItem() was the only on in the list, list is empty now, nothing to replace.
(WebCore::SVGListProperty::appendItemValuesAndWrappers):
(WebCore::SVGListProperty::role): Expose the role of this list property.
* svg/properties/SVGPathSegListPropertyTearOff.h: s/TYPE_MISMATCH_ERR/SVGException::SVG_WRONG_TYPE_ERR/ for compatibility with Firefox.
(WebCore::SVGPathSegListPropertyTearOff::initialize):
(WebCore::SVGPathSegListPropertyTearOff::insertItemBefore):
(WebCore::SVGPathSegListPropertyTearOff::replaceItem):
(WebCore::SVGPathSegListPropertyTearOff::appendItem):
* svg/properties/SVGProperty.h: Add new virtual SVGPropertyRole role() accessor.
* svg/properties/SVGPropertyTearOff.h:
(WebCore::SVGPropertyTearOff::create): Store the passed in SVGProperyRole, instead of ignoring it.
(WebCore::SVGPropertyTearOff::role):
(WebCore::SVGPropertyTearOff::SVGPropertyTearOff):
* svg/properties/SVGStaticPropertyTearOff.h:
(WebCore::SVGStaticPropertyTearOff::SVGStaticPropertyTearOff): Pass UndefinedRole as default role to SVGPropertyTearOff.
* svg/properties/SVGStaticPropertyWithParentTearOff.h: Ditto.
(WebCore::SVGStaticPropertyWithParentTearOff::SVGStaticPropertyWithParentTearOff):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72518 268f45cc-cd09-0410-ab3c-d52691b4dbfc
76 files changed