[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
commit-queue at webkit.org
commit-queue at webkit.org
Wed Dec 22 16:20:16 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 7ab490e1688bc9827ea594430626bb4505803adf
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Nov 22 12:32:31 2010 +0000
2010-11-22 Nikolas Zimmermann <nzimmermann at 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 at 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
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 5172323..a1ac9fd 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,44 @@
+2010-11-22 Nikolas Zimmermann <nzimmermann at 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 Anton Muhin <antonm at chromium.org>
Not reviewed. Rebaselining fast/images/imagemap-focus-ring-zoom.html for Chromium on Win and Linux.
diff --git a/LayoutTests/platform/mac-leopard/svg/custom/baseval-animval-equality-expected.checksum b/LayoutTests/platform/mac-leopard/svg/custom/baseval-animval-equality-expected.checksum
index f83390a..490969d 100644
--- a/LayoutTests/platform/mac-leopard/svg/custom/baseval-animval-equality-expected.checksum
+++ b/LayoutTests/platform/mac-leopard/svg/custom/baseval-animval-equality-expected.checksum
@@ -1 +1 @@
-a0fb9733c67271fa33ad2b2da559f938
\ No newline at end of file
+f124b0e005ca0ef2d4419b301c49cbfd
\ No newline at end of file
diff --git a/LayoutTests/platform/mac-leopard/svg/custom/baseval-animval-equality-expected.png b/LayoutTests/platform/mac-leopard/svg/custom/baseval-animval-equality-expected.png
index 0fac0b5..ec570cd 100644
Binary files a/LayoutTests/platform/mac-leopard/svg/custom/baseval-animval-equality-expected.png and b/LayoutTests/platform/mac-leopard/svg/custom/baseval-animval-equality-expected.png differ
diff --git a/LayoutTests/platform/mac-leopard/svg/dom/SVGLengthList-basics-expected.checksum b/LayoutTests/platform/mac-leopard/svg/dom/SVGLengthList-basics-expected.checksum
index 29836cb..dce55d4 100644
--- a/LayoutTests/platform/mac-leopard/svg/dom/SVGLengthList-basics-expected.checksum
+++ b/LayoutTests/platform/mac-leopard/svg/dom/SVGLengthList-basics-expected.checksum
@@ -1 +1 @@
-1a4765a7d918b35950d26f55b12c506d
\ No newline at end of file
+b2e0d110e407751c53223d43a3f67883
\ No newline at end of file
diff --git a/LayoutTests/platform/mac-leopard/svg/dom/SVGLengthList-basics-expected.png b/LayoutTests/platform/mac-leopard/svg/dom/SVGLengthList-basics-expected.png
index 59a5c27..8648c79 100644
Binary files a/LayoutTests/platform/mac-leopard/svg/dom/SVGLengthList-basics-expected.png and b/LayoutTests/platform/mac-leopard/svg/dom/SVGLengthList-basics-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/W3C-SVG-1.1-SE/types-dom-07-f-expected.checksum b/LayoutTests/platform/mac/svg/W3C-SVG-1.1-SE/types-dom-07-f-expected.checksum
new file mode 100644
index 0000000..5d0e797
--- /dev/null
+++ b/LayoutTests/platform/mac/svg/W3C-SVG-1.1-SE/types-dom-07-f-expected.checksum
@@ -0,0 +1 @@
+87000dce41032ca4ffd065907eb21c13
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/W3C-SVG-1.1-SE/types-dom-07-f-expected.png b/LayoutTests/platform/mac/svg/W3C-SVG-1.1-SE/types-dom-07-f-expected.png
new file mode 100644
index 0000000..35c4a10
Binary files /dev/null and b/LayoutTests/platform/mac/svg/W3C-SVG-1.1-SE/types-dom-07-f-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/W3C-SVG-1.1-SE/types-dom-07-f-expected.txt b/LayoutTests/platform/mac/svg/W3C-SVG-1.1-SE/types-dom-07-f-expected.txt
new file mode 100644
index 0000000..e71937f
--- /dev/null
+++ b/LayoutTests/platform/mac/svg/W3C-SVG-1.1-SE/types-dom-07-f-expected.txt
@@ -0,0 +1,52 @@
+layer at (0,0) size 480x360
+ RenderView at (0,0) size 480x360
+layer at (0,0) size 480x360
+ RenderSVGRoot {svg} at (0,0) size 480x360
+ RenderSVGHiddenContainer {defs} at (0,0) size 0x0
+ RenderSVGContainer {g} at (43,38) size 397x254
+ RenderSVGText {text} at (43,38) size 167x21 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,0) size 167x21
+ chunk 1 (end anchor) text run 1 at (43.00,55.00) startOffset 0 endOffset 21 width 167.00: "animVal is read only:"
+ RenderSVGContainer {g} at (240,40) size 200x252 [transform={m=((0.00,1.00)(-1.00,0.00)) t=(500.00,0.00)}]
+ RenderSVGPath {rect} at (420,40) size 20x20 [fill={[type=SOLID] [color=#008000]}] [x=40.00] [y=60.00] [width=20.00] [height=20.00]
+ RenderSVGText {text} at (70,62) size 162x16 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,0) size 162x16
+ chunk 1 text run 1 at (70.00,75.00) startOffset 0 endOffset 21 width 162.00: "SVGAnimatedNumberList"
+ RenderSVGPath {rect} at (390,40) size 20x20 [fill={[type=SOLID] [color=#008000]}] [x=40.00] [y=90.00] [width=20.00] [height=20.00]
+ RenderSVGText {text} at (70,92) size 133x16 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,0) size 133x16
+ chunk 1 text run 1 at (70.00,105.00) startOffset 0 endOffset 17 width 133.00: "SVGAnimatedLength"
+ RenderSVGPath {rect} at (360,40) size 20x20 [fill={[type=SOLID] [color=#008000]}] [x=40.00] [y=120.00] [width=20.00] [height=20.00]
+ RenderSVGText {text} at (70,122) size 155x16 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,0) size 155x16
+ chunk 1 text run 1 at (70.00,135.00) startOffset 0 endOffset 21 width 155.00: "SVGAnimatedLengthList"
+ RenderSVGPath {rect} at (330,40) size 20x20 [fill={[type=SOLID] [color=#008000]}] [x=40.00] [y=150.00] [width=20.00] [height=20.00]
+ RenderSVGText {text} at (70,152) size 125x16 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,0) size 125x16
+ chunk 1 text run 1 at (70.00,165.00) startOffset 0 endOffset 16 width 125.00: "SVGAnimatedAngle"
+ RenderSVGPath {rect} at (300,40) size 20x20 [fill={[type=SOLID] [color=#008000]}] [x=40.00] [y=180.00] [width=20.00] [height=20.00]
+ RenderSVGText {text} at (70,182) size 118x16 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,0) size 118x16
+ chunk 1 text run 1 at (70.00,195.00) startOffset 0 endOffset 15 width 118.00: "SVGAnimatedRect"
+ RenderSVGPath {rect} at (270,40) size 20x20 [fill={[type=SOLID] [color=#008000]}] [x=40.00] [y=210.00] [width=20.00] [height=20.00]
+ RenderSVGText {text} at (70,212) size 177x16 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,0) size 177x16
+ chunk 1 text run 1 at (70.00,225.00) startOffset 0 endOffset 24 width 177.00: "SVGAnimatedTransformList"
+ RenderSVGPath {rect} at (240,40) size 20x20 [fill={[type=SOLID] [color=#008000]}] [x=40.00] [y=240.00] [width=20.00] [height=20.00]
+ RenderSVGText {text} at (70,242) size 222x16 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,0) size 222x16
+ chunk 1 text run 1 at (70.00,255.00) startOffset 0 endOffset 30 width 222.00: "SVGAnimatedPreserveAspectRatio"
+ RenderSVGHiddenContainer {g} at (0,0) size 0x0
+ RenderSVGText {text} at (0,-17) size 38x26 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,0) size 38x26
+ chunk 1 text run 1 at (0.00,0.00) startOffset 0 endOffset 1 width 10.00: "a"
+ chunk 1 text run 2 at (10.00,0.00) startOffset 1 endOffset 2 width 10.00: "b"
+ chunk 1 text run 3 at (20.00,0.00) startOffset 2 endOffset 3 width 9.00: "c"
+ RenderSVGPath {circle} at (0,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [cx=0.00] [cy=0.00] [r=50.00]
+ RenderSVGResourceMarker {marker} [id="marker"] [markerUnits=strokeWidth] [ref at (0,0)] [angle=90.00]
+ RenderSVGViewportContainer {svg} at (0,0) size 0x0
+ RenderSVGContainer {g} at (10,310) size 231x37
+ RenderSVGText {text} at (10,310) size 231x37 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,0) size 231x37
+ chunk 1 text run 1 at (10.00,340.00) startOffset 0 endOffset 16 width 231.00: "$Revision: 1.2 $"
+ RenderSVGPath {rect} at (0,0) size 480x360 [stroke={[type=SOLID] [color=#000000]}] [x=1.00] [y=1.00] [width=478.00] [height=358.00]
diff --git a/LayoutTests/platform/mac/svg/custom/baseval-animval-equality-expected.txt b/LayoutTests/platform/mac/svg/custom/baseval-animval-equality-expected.txt
index a846d2d..414a729 100644
--- a/LayoutTests/platform/mac/svg/custom/baseval-animval-equality-expected.txt
+++ b/LayoutTests/platform/mac/svg/custom/baseval-animval-equality-expected.txt
@@ -3,8 +3,8 @@ layer at (0,0) size 800x600
layer at (0,0) size 600x400
RenderSVGRoot {svg} at (0,0) size 600x400
RenderForeignObject {foreignObject} at (0,0) size 600x400
- RenderBlock {html} at (0,0) size 600x198
- RenderBlock {div} at (0,0) size 600x198
+ RenderBlock {html} at (0,0) size 600x216
+ RenderBlock {div} at (0,0) size 600x216
RenderBlock (anonymous) at (0,0) size 600x18
RenderText {#text} at (0,0) size 560x18
text run at (0,0) width 560: "This tests to make sure that baseVal and animVal are tied when animation is not enabled:"
@@ -30,11 +30,14 @@ layer at (0,0) size 600x400
RenderText {#text} at (0,0) size 200x18
text run at (0,0) width 200: "setting svg.x.animVal.value = 5"
RenderBlock {div} at (0,144) size 600x18
- RenderText {#text} at (0,0) size 152x18
- text run at (0,0) width 152: "svg.x.baseVal.value = 5"
+ RenderText {#text} at (0,0) size 521x18
+ text run at (0,0) width 521: "caught exception: NO_MODIFICATION_ALLOWED_ERR: DOM Exception 7"
RenderBlock {div} at (0,162) size 600x18
- RenderText {#text} at (0,0) size 155x18
- text run at (0,0) width 155: "svg.x.animVal.value = 5"
+ RenderText {#text} at (0,0) size 160x18
+ text run at (0,0) width 160: "svg.x.baseVal.value = 10"
RenderBlock {div} at (0,180) size 600x18
+ RenderText {#text} at (0,0) size 163x18
+ text run at (0,0) width 163: "svg.x.animVal.value = 10"
+ RenderBlock {div} at (0,198) size 600x18
RenderText {#text} at (0,0) size 122x18
text run at (0,0) width 122: "SUCCESS (2 of 2)"
diff --git a/LayoutTests/platform/mac/svg/dom/SVGNumberList-basics-expected.checksum b/LayoutTests/platform/mac/svg/dom/SVGNumberList-basics-expected.checksum
new file mode 100644
index 0000000..574ed7f
--- /dev/null
+++ b/LayoutTests/platform/mac/svg/dom/SVGNumberList-basics-expected.checksum
@@ -0,0 +1 @@
+92427a7765061435f1db9e1a4b3208b8
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/dom/SVGNumberList-basics-expected.png b/LayoutTests/platform/mac/svg/dom/SVGNumberList-basics-expected.png
new file mode 100644
index 0000000..334af28
Binary files /dev/null and b/LayoutTests/platform/mac/svg/dom/SVGNumberList-basics-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/dom/SVGPointList-basics-expected.checksum b/LayoutTests/platform/mac/svg/dom/SVGPointList-basics-expected.checksum
new file mode 100644
index 0000000..baa461c
--- /dev/null
+++ b/LayoutTests/platform/mac/svg/dom/SVGPointList-basics-expected.checksum
@@ -0,0 +1 @@
+bf3151f91d6fa9f24e164194c1908f8b
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/dom/SVGPointList-basics-expected.png b/LayoutTests/platform/mac/svg/dom/SVGPointList-basics-expected.png
new file mode 100644
index 0000000..58e6518
Binary files /dev/null and b/LayoutTests/platform/mac/svg/dom/SVGPointList-basics-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/dom/SVGStringList-basics-expected.checksum b/LayoutTests/platform/mac/svg/dom/SVGStringList-basics-expected.checksum
new file mode 100644
index 0000000..4e20fbc
--- /dev/null
+++ b/LayoutTests/platform/mac/svg/dom/SVGStringList-basics-expected.checksum
@@ -0,0 +1 @@
+3e6f4d460aee57b9158ab6f6ccbd60bb
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/dom/SVGStringList-basics-expected.png b/LayoutTests/platform/mac/svg/dom/SVGStringList-basics-expected.png
new file mode 100644
index 0000000..f644bc5
Binary files /dev/null and b/LayoutTests/platform/mac/svg/dom/SVGStringList-basics-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/dom/SVGTransformList-basics-expected.checksum b/LayoutTests/platform/mac/svg/dom/SVGTransformList-basics-expected.checksum
new file mode 100644
index 0000000..ef78243
--- /dev/null
+++ b/LayoutTests/platform/mac/svg/dom/SVGTransformList-basics-expected.checksum
@@ -0,0 +1 @@
+70eaf0026960af9c47c694d7f8ccbf3b
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/dom/SVGTransformList-basics-expected.png b/LayoutTests/platform/mac/svg/dom/SVGTransformList-basics-expected.png
new file mode 100644
index 0000000..9ad41a2
Binary files /dev/null and b/LayoutTests/platform/mac/svg/dom/SVGTransformList-basics-expected.png differ
diff --git a/LayoutTests/svg/W3C-SVG-1.1-SE/types-dom-07-f.svg b/LayoutTests/svg/W3C-SVG-1.1-SE/types-dom-07-f.svg
new file mode 100644
index 0000000..6abf6ca
--- /dev/null
+++ b/LayoutTests/svg/W3C-SVG-1.1-SE/types-dom-07-f.svg
@@ -0,0 +1,156 @@
+<svg id="svg-root" width="100%" height="100%"
+ viewBox="0 0 480 360" xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink">
+ <!--======================================================================-->
+ <!--= Copyright 2008 World Wide Web Consortium, (Massachusetts =-->
+ <!--= Institute of Technology, European Research Consortium for =-->
+ <!--= Informatics and Mathematics (ERCIM), Keio University). =-->
+ <!--= All Rights Reserved. =-->
+ <!--= See http://www.w3.org/Consortium/Legal/. =-->
+ <!--======================================================================-->
+ <d:SVGTestCase xmlns:d="http://www.w3.org/2000/02/svg/testsuite/description/"
+ template-version="1.3" reviewer="CL" author="CM" status="accepted"
+ version="$Revision: 1.2 $" testname="$RCSfile: types-dom-07-f.svg,v $">
+ <d:testDescription xmlns="http://www.w3.org/1999/xhtml" href="http://www.w3.org/TR/SVG11/types.html#BasicDOMInterfaces">
+ <p>
+ This tests that the contents of an animVal object are read only.
+ This is tested for interfaces SVGAnimatedNumberList, SVGAnimatedLength,
+ SVGAnimatedLengthList, SVGAnimatedAngle, SVGAnimatedRect,
+ SVGAnimatedTransformList and SVGAnimatedPreserveAspectRatio.
+ </p>
+ </d:testDescription>
+ <d:operatorScript xmlns="http://www.w3.org/1999/xhtml">
+ <p>
+ Run the test. No interaction required.
+ </p>
+ </d:operatorScript>
+ <d:passCriteria xmlns="http://www.w3.org/1999/xhtml">
+ <p>
+ Once loaded, the test shows 7 rectangles
+ representing seven sub-tests reflecting the result
+ of checking that an animVal object's contents is read
+ only.
+ Each rectangle will be either black to indicate that
+ the sub-test wasn't run, red to indicate that the
+ sub-test failed, and green to indicate that the
+ sub-test passed.
+ </p>
+ <p>
+ The test is passed if all 7 rectangles are green.
+ </p>
+ </d:passCriteria>
+ </d:SVGTestCase>
+ <title id="test-title">$RCSfile: types-dom-07-f.svg,v $</title>
+ <defs>
+ <font-face
+ font-family="SVGFreeSansASCII"
+ unicode-range="U+0-7F">
+ <font-face-src>
+ <font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/>
+ </font-face-src>
+ </font-face>
+ </defs>
+ <g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18">
+
+ <text x='210' y='55' text-anchor='end'>animVal is read only:</text>
+
+ <g font-size='14' transform='translate(500)rotate(90)'>
+ <rect id='r1a' x='40' y='60' width='20' height='20'/>
+ <text x='70' y='75'>SVGAnimatedNumberList</text>
+ <rect id='r2a' x='40' y='90' width='20' height='20'/>
+ <text x='70' y='105'>SVGAnimatedLength</text>
+ <rect id='r3a' x='40' y='120' width='20' height='20'/>
+ <text x='70' y='135'>SVGAnimatedLengthList</text>
+ <rect id='r4a' x='40' y='150' width='20' height='20'/>
+ <text x='70' y='165'>SVGAnimatedAngle</text>
+ <rect id='r5a' x='40' y='180' width='20' height='20'/>
+ <text x='70' y='195'>SVGAnimatedRect</text>
+ <rect id='r6a' x='40' y='210' width='20' height='20'/>
+ <text x='70' y='225'>SVGAnimatedTransformList</text>
+ <rect id='r7a' x='40' y='240' width='20' height='20'/>
+ <text x='70' y='255'>SVGAnimatedPreserveAspectRatio</text>
+ </g>
+
+ <g display='none'>
+ <text id='text' rotate='0 20 40'>abc</text>
+ <circle id='circle' r='50'/>
+ <marker id='marker' orient='1.5708rad'/>
+ <svg id='svg' viewBox='10 20 30 40'/>
+ </g>
+
+ <script><![CDATA[
+ function $(id) { return document.getElementById(id); }
+
+ var text = $('text'),
+ circle = $('circle'),
+ marker = $('marker'),
+ svg = $('svg');
+
+ function expect_exception(id, fn, code) {
+ try {
+ fn();
+ } catch (e) {
+ if (e.code == code) {
+ $(id).setAttribute('fill', 'green');
+ return;
+ }
+ }
+ $(id).setAttribute('fill', 'red');
+ }
+
+ // SVGAnimatedNumberList: rotate on text
+ expect_exception
+ ('r1a',
+ function() { text.rotate.animVal.clear(); },
+ 7 /* DOMException.NO_MODIFICATION_ALLOWED_ERR */);
+
+ // SVGAnimatedLength: r on circle
+ expect_exception
+ ('r2a',
+ function() { circle.r.animVal.value = 123; },
+ 7 /* DOMException.NO_MODIFICATION_ALLOWED_ERR */);
+
+ // SVGAnimatedLengthList: x on text
+ expect_exception
+ ('r3a',
+ function() { text.x.animVal.clear(); },
+ 7 /* DOMException.NO_MODIFICATION_ALLOWED_ERR */);
+
+ // SVGAnimatedAngle: orient on marker
+ expect_exception
+ ('r4a',
+ function() { marker.orientAngle.animVal.value = 123; },
+ 7 /* DOMException.NO_MODIFICATION_ALLOWED_ERR */);
+
+ // SVGAnimatedRect: viewBox on svg
+ expect_exception
+ ('r5a',
+ function() { svg.viewBox.animVal.x = 123; },
+ 7 /* DOMException.NO_MODIFICATION_ALLOWED_ERR */);
+
+ // SVGAnimatedTransformList: transform on circle
+ expect_exception
+ ('r6a',
+ function() { circle.transform.animVal.clear(); },
+ 7 /* DOMException.NO_MODIFICATION_ALLOWED_ERR */);
+
+ // SVGAnimatedPreserveAspectRatio: preserveAspectRatio on svg
+ expect_exception
+ ('r7a',
+ function() { svg.preserveAspectRatio.animVal.align = 1; },
+ 7 /* DOMException.NO_MODIFICATION_ALLOWED_ERR */);
+ ]]></script>
+
+ </g>
+ <g font-family="SVGFreeSansASCII,sans-serif" font-size="32">
+ <text id="revision" x="10" y="340" stroke="none"
+ fill="black">$Revision: 1.2 $</text>
+ </g>
+ <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000"/>
+ <!-- comment out this watermark once the test is approved --><!--
+ <g id="draft-watermark">
+ <rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/>
+ <text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240"
+ text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text>
+ </g>-->
+</svg>
diff --git a/LayoutTests/svg/custom/baseval-animval-equality.svg b/LayoutTests/svg/custom/baseval-animval-equality.svg
index 193548e..ddfcf54 100644
--- a/LayoutTests/svg/custom/baseval-animval-equality.svg
+++ b/LayoutTests/svg/custom/baseval-animval-equality.svg
@@ -28,10 +28,14 @@
else
log("FAILED");
log("setting svg.x.animVal.value = 5");
- svg.x.animVal.value = 5;
+ try {
+ svg.x.animVal.value = 5;
+ } catch(e) {
+ log("caught exception: " + e.message);
+ }
log("svg.x.baseVal.value = " + svg.x.baseVal.value);
log("svg.x.animVal.value = " + svg.x.animVal.value);
- if ((svg.x.baseVal.value == svg.x.animVal.value) && (svg.x.animVal.value == 5))
+ if ((svg.x.baseVal.value == svg.x.animVal.value) && (svg.x.animVal.value == 10))
log("SUCCESS (2 of 2)");
else
log("FAILED");
diff --git a/LayoutTests/svg/custom/polyline-points-crash-expected.txt b/LayoutTests/svg/custom/polyline-points-crash-expected.txt
index b08f058..a68253e 100644
--- a/LayoutTests/svg/custom/polyline-points-crash-expected.txt
+++ b/LayoutTests/svg/custom/polyline-points-crash-expected.txt
@@ -1,2 +1,2 @@
-Caught exception: Error: TYPE_MISMATCH_ERR: DOM Exception 17
+Caught exception: Error: SVG_WRONG_TYPE_ERR: DOM SVG Exception 0
PASSED -- WebKit did not crash!
diff --git a/LayoutTests/svg/dom/SVGLengthList-basics-expected.txt b/LayoutTests/svg/dom/SVGLengthList-basics-expected.txt
index 9dd6b5f..6a6ecd7 100644
--- a/LayoutTests/svg/dom/SVGLengthList-basics-expected.txt
+++ b/LayoutTests/svg/dom/SVGLengthList-basics-expected.txt
@@ -7,9 +7,118 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
PASS text1.x.baseVal != text1.x.animVal is true
PASS text1.x.baseVal.numberOfItems is 3
PASS text1.x.animVal.numberOfItems is 3
+PASS text1.x.baseVal.getItem(0).value is 500
+PASS text1.x.baseVal.getItem(1).value is 1000
+PASS text1.x.baseVal.getItem(2).value is 1500
+
+Test uncommon arguments for initialize()
+PASS text1.x.baseVal.initialize(30) threw exception TypeError: Type error.
+PASS text1.x.baseVal.initialize('aString') threw exception TypeError: Type error.
+PASS text1.x.baseVal.initialize(text1) threw exception TypeError: Type error.
+PASS text1.x.baseVal.initialize(null) threw exception Error: SVG_WRONG_TYPE_ERR: DOM SVG Exception 0.
+
+Test uncommon arguments for getItem()
+PASS text1.x.baseVal.getItem(30) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
+PASS text1.x.baseVal.getItem('aString') is text1.x.baseVal.getItem(0)
+PASS text1.x.baseVal.getItem(text1) is text1.x.baseVal.getItem(0)
+PASS text1.x.baseVal.getItem(null) is text1.x.baseVal.getItem(0)
+
+Test uncommon arguments for insertItemBefore()
+PASS text1.x.baseVal.insertItemBefore(30) threw exception SyntaxError: Not enough arguments.
+PASS text1.x.baseVal.insertItemBefore('aString') threw exception SyntaxError: Not enough arguments.
+PASS text1.x.baseVal.insertItemBefore(text1) threw exception SyntaxError: Not enough arguments.
+PASS text1.x.baseVal.insertItemBefore(null) threw exception SyntaxError: Not enough arguments.
+PASS text1.x.baseVal.insertItemBefore(text1.x.baseVal.getItem(1), 'aString') is text1.x.baseVal.getItem(0)
+PASS text1.x.baseVal.numberOfItems is 3
+PASS text1.x.baseVal.getItem(0).value is 1000
+PASS text1.x.baseVal.getItem(1).value is 500
+PASS text1.x.baseVal.getItem(2).value is 1500
+PASS text1.getAttribute('x') is "1000 500 1500"
+PASS text1.x.baseVal.insertItemBefore(text1.x.baseVal.getItem(1), text1) is text1.x.baseVal.getItem(0)
+PASS text1.x.baseVal.numberOfItems is 3
+PASS text1.x.baseVal.getItem(0).value is 500
+PASS text1.x.baseVal.getItem(1).value is 1000
+PASS text1.x.baseVal.getItem(2).value is 1500
+PASS text1.getAttribute('x') is "500 1000 1500"
+PASS text1.x.baseVal.insertItemBefore(text1.x.baseVal.getItem(1), null) is text1.x.baseVal.getItem(0)
+PASS text1.x.baseVal.numberOfItems is 3
+PASS text1.x.baseVal.getItem(0).value is 1000
+PASS text1.x.baseVal.getItem(1).value is 500
+PASS text1.x.baseVal.getItem(2).value is 1500
+PASS text1.getAttribute('x') is "1000 500 1500"
+PASS text1.x.baseVal.insertItemBefore(text1.x.baseVal.getItem(1), 0) is text1.x.baseVal.getItem(0)
+PASS text1.x.baseVal.numberOfItems is 3
+PASS text1.x.baseVal.getItem(0).value is 500
+PASS text1.x.baseVal.getItem(1).value is 1000
+PASS text1.x.baseVal.getItem(2).value is 1500
+PASS text1.getAttribute('x') is "500 1000 1500"
+PASS text1.x.baseVal.insertItemBefore(30, 0) threw exception TypeError: Type error.
+PASS text1.x.baseVal.insertItemBefore('aString', 0) threw exception TypeError: Type error.
+PASS text1.x.baseVal.insertItemBefore(text1, 0) threw exception TypeError: Type error.
+PASS text1.x.baseVal.insertItemBefore(null, 0) threw exception Error: SVG_WRONG_TYPE_ERR: DOM SVG Exception 0.
+
+Set x='1 2 3 4' for text1
+PASS text1.setAttribute('x', '1 2 3 4') is undefined.
+PASS text1.x.baseVal.numberOfItems is 4
+PASS text1.x.baseVal.getItem(0).value is 1
+PASS text1.x.baseVal.getItem(1).value is 2
+PASS text1.x.baseVal.getItem(2).value is 3
+PASS text1.x.baseVal.getItem(3).value is 4
+PASS text1.getAttribute('x') is "1 2 3 4"
+
+Test uncommon arguments for replaceItem()
+PASS text1.x.baseVal.replaceItem(30) threw exception SyntaxError: Not enough arguments.
+PASS text1.x.baseVal.replaceItem('aString') threw exception SyntaxError: Not enough arguments.
+PASS text1.x.baseVal.replaceItem(text1) threw exception SyntaxError: Not enough arguments.
+PASS text1.x.baseVal.replaceItem(null) threw exception SyntaxError: Not enough arguments.
+PASS text1.x.baseVal.replaceItem(30, 0) threw exception TypeError: Type error.
+PASS text1.x.baseVal.replaceItem('aString', 0) threw exception TypeError: Type error.
+PASS text1.x.baseVal.replaceItem(text1, 0) threw exception TypeError: Type error.
+PASS text1.x.baseVal.replaceItem(null, 0) threw exception Error: SVG_WRONG_TYPE_ERR: DOM SVG Exception 0.
+PASS text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(0), 0) is text1.x.baseVal.getItem(0)
+PASS text1.x.baseVal.numberOfItems is 3
+PASS text1.x.baseVal.getItem(0).value is 1
+PASS text1.x.baseVal.getItem(1).value is 3
+PASS text1.x.baseVal.getItem(2).value is 4
+PASS text1.getAttribute('x') is "1 3 4"
+PASS text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(0), 'aString') is text1.x.baseVal.getItem(0)
+PASS text1.x.baseVal.numberOfItems is 2
+PASS text1.x.baseVal.getItem(0).value is 1
+PASS text1.x.baseVal.getItem(1).value is 4
+PASS text1.getAttribute('x') is "1 4"
+PASS text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(0), text1) is text1.x.baseVal.getItem(0)
+PASS text1.x.baseVal.numberOfItems is 1
+PASS text1.getAttribute('x') is "1"
+PASS text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(0), null) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
+PASS text1.x.baseVal.numberOfItems is 0
+PASS text1.getAttribute('x') is ""
+
+Set x='1 2 3 4' for text1
+PASS text1.setAttribute('x', '1 2 3 4') is undefined.
+
+Test uncommon arguments for removeItem()
+PASS text1.x.baseVal.removeItem(30) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
+PASS text1.x.baseVal.removeItem(0).value is 1
+PASS text1.x.baseVal.numberOfItems is 3
+PASS text1.x.baseVal.getItem(0).value is 2
+PASS text1.x.baseVal.getItem(1).value is 3
+PASS text1.x.baseVal.getItem(2).value is 4
+PASS text1.getAttribute('x') is "2 3 4"
+PASS text1.x.baseVal.removeItem(text1).value is 2
+PASS text1.x.baseVal.numberOfItems is 2
+PASS text1.x.baseVal.getItem(0).value is 3
+PASS text1.x.baseVal.getItem(1).value is 4
+PASS text1.getAttribute('x') is "3 4"
+
+Test uncommon arguments for appendItem()
+PASS text1.x.baseVal.appendItem(30) threw exception TypeError: Type error.
+PASS text1.x.baseVal.appendItem('aString') threw exception TypeError: Type error.
+PASS text1.x.baseVal.appendItem(text1) threw exception TypeError: Type error.
+PASS text1.x.baseVal.appendItem(null) threw exception Error: SVG_WRONG_TYPE_ERR: DOM SVG Exception 0.
+
+Testing animVal clear throws
PASS text1.x.animVal.clear() threw exception Error: NO_MODIFICATION_ALLOWED_ERR: DOM Exception 7.
PASS text1.x.baseVal.clear() is undefined.
-PASS text1.x.baseVal.initialize(30) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
PASS successfullyParsed is true
TEST COMPLETE
diff --git a/LayoutTests/svg/dom/SVGLengthList-basics.xhtml b/LayoutTests/svg/dom/SVGLengthList-basics.xhtml
index 7b9527e..fad2c8f 100644
--- a/LayoutTests/svg/dom/SVGLengthList-basics.xhtml
+++ b/LayoutTests/svg/dom/SVGLengthList-basics.xhtml
@@ -22,15 +22,139 @@
shouldBe("text1.x.baseVal.numberOfItems", "3");
shouldBe("text1.x.animVal.numberOfItems", "3");
+ shouldBe("text1.x.baseVal.getItem(0).value", "500");
+ shouldBe("text1.x.baseVal.getItem(1).value", "1000");
+ shouldBe("text1.x.baseVal.getItem(2).value", "1500");
- // Spec: SVGAnimatedLengthList::animVal(): "A read only SVGLengthList representing the current animated value of the given attribute"
- // Spec: SVGLengthList: "An SVGLengthList object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown, as described below."
- shouldThrow("text1.x.animVal.clear()");
- shouldBeUndefined("text1.x.baseVal.clear()");
-
- // Following Mozilla here, this should throw, when given a non SVGLength argument.
+ debug("");
+ debug("Test uncommon arguments for initialize()");
shouldThrow("text1.x.baseVal.initialize(30)");
+ shouldThrow("text1.x.baseVal.initialize('aString')");
+ shouldThrow("text1.x.baseVal.initialize(text1)");
+ shouldThrow("text1.x.baseVal.initialize(null)");
+
+ debug("");
+ debug("Test uncommon arguments for getItem()");
+ shouldThrow("text1.x.baseVal.getItem(30)");
+ shouldBe("text1.x.baseVal.getItem('aString')", "text1.x.baseVal.getItem(0)");
+ shouldBe("text1.x.baseVal.getItem(text1)", "text1.x.baseVal.getItem(0)");
+ shouldBe("text1.x.baseVal.getItem(null)", "text1.x.baseVal.getItem(0)");
+
+ debug("");
+ debug("Test uncommon arguments for insertItemBefore()");
+ shouldThrow("text1.x.baseVal.insertItemBefore(30)");
+ shouldThrow("text1.x.baseVal.insertItemBefore('aString')");
+ shouldThrow("text1.x.baseVal.insertItemBefore(text1)");
+ shouldThrow("text1.x.baseVal.insertItemBefore(null)");
+
+ shouldBe("text1.x.baseVal.insertItemBefore(text1.x.baseVal.getItem(1), 'aString')", "text1.x.baseVal.getItem(0)");
+ shouldBe("text1.x.baseVal.numberOfItems", "3");
+ shouldBe("text1.x.baseVal.getItem(0).value", "1000");
+ shouldBe("text1.x.baseVal.getItem(1).value", "500");
+ shouldBe("text1.x.baseVal.getItem(2).value", "1500");
+ shouldBeEqualToString("text1.getAttribute('x')", "1000 500 1500");
+
+ shouldBe("text1.x.baseVal.insertItemBefore(text1.x.baseVal.getItem(1), text1)", "text1.x.baseVal.getItem(0)");
+ shouldBe("text1.x.baseVal.numberOfItems", "3");
+ shouldBe("text1.x.baseVal.getItem(0).value", "500");
+ shouldBe("text1.x.baseVal.getItem(1).value", "1000");
+ shouldBe("text1.x.baseVal.getItem(2).value", "1500");
+ shouldBeEqualToString("text1.getAttribute('x')", "500 1000 1500");
+
+ shouldBe("text1.x.baseVal.insertItemBefore(text1.x.baseVal.getItem(1), null)", "text1.x.baseVal.getItem(0)");
+ shouldBe("text1.x.baseVal.numberOfItems", "3");
+ shouldBe("text1.x.baseVal.getItem(0).value", "1000");
+ shouldBe("text1.x.baseVal.getItem(1).value", "500");
+ shouldBe("text1.x.baseVal.getItem(2).value", "1500");
+ shouldBeEqualToString("text1.getAttribute('x')", "1000 500 1500");
+
+ shouldBe("text1.x.baseVal.insertItemBefore(text1.x.baseVal.getItem(1), 0)", "text1.x.baseVal.getItem(0)");
+ shouldBe("text1.x.baseVal.numberOfItems", "3");
+ shouldBe("text1.x.baseVal.getItem(0).value", "500");
+ shouldBe("text1.x.baseVal.getItem(1).value", "1000");
+ shouldBe("text1.x.baseVal.getItem(2).value", "1500");
+ shouldBeEqualToString("text1.getAttribute('x')", "500 1000 1500");
+
+ shouldThrow("text1.x.baseVal.insertItemBefore(30, 0)");
+ shouldThrow("text1.x.baseVal.insertItemBefore('aString', 0)");
+ shouldThrow("text1.x.baseVal.insertItemBefore(text1, 0)");
+ shouldThrow("text1.x.baseVal.insertItemBefore(null, 0)");
+
+ debug("");
+ debug("Set x='1 2 3 4' for text1");
+ shouldBeUndefined("text1.setAttribute('x', '1 2 3 4')");
+ shouldBe("text1.x.baseVal.numberOfItems", "4");
+ shouldBe("text1.x.baseVal.getItem(0).value", "1");
+ shouldBe("text1.x.baseVal.getItem(1).value", "2");
+ shouldBe("text1.x.baseVal.getItem(2).value", "3");
+ shouldBe("text1.x.baseVal.getItem(3).value", "4");
+ shouldBeEqualToString("text1.getAttribute('x')", "1 2 3 4");
+ debug("");
+ debug("Test uncommon arguments for replaceItem()");
+ shouldThrow("text1.x.baseVal.replaceItem(30)");
+ shouldThrow("text1.x.baseVal.replaceItem('aString')");
+ shouldThrow("text1.x.baseVal.replaceItem(text1)");
+ shouldThrow("text1.x.baseVal.replaceItem(null)");
+ shouldThrow("text1.x.baseVal.replaceItem(30, 0)");
+ shouldThrow("text1.x.baseVal.replaceItem('aString', 0)");
+ shouldThrow("text1.x.baseVal.replaceItem(text1, 0)");
+ shouldThrow("text1.x.baseVal.replaceItem(null, 0)");
+
+ shouldBe("text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(0), 0)", "text1.x.baseVal.getItem(0)");
+ shouldBe("text1.x.baseVal.numberOfItems", "3");
+ shouldBe("text1.x.baseVal.getItem(0).value", "1");
+ shouldBe("text1.x.baseVal.getItem(1).value", "3");
+ shouldBe("text1.x.baseVal.getItem(2).value", "4");
+ shouldBeEqualToString("text1.getAttribute('x')", "1 3 4");
+
+ shouldBe("text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(0), 'aString')", "text1.x.baseVal.getItem(0)");
+ shouldBe("text1.x.baseVal.numberOfItems", "2");
+ shouldBe("text1.x.baseVal.getItem(0).value", "1");
+ shouldBe("text1.x.baseVal.getItem(1).value", "4");
+ shouldBeEqualToString("text1.getAttribute('x')", "1 4");
+
+ shouldBe("text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(0), text1)", "text1.x.baseVal.getItem(0)");
+ shouldBe("text1.x.baseVal.numberOfItems", "1");
+ shouldBeEqualToString("text1.getAttribute('x')", "1");
+
+ shouldThrow("text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(0), null)");
+ shouldBe("text1.x.baseVal.numberOfItems", "0");
+ shouldBeEqualToString("text1.getAttribute('x')", "");
+
+ debug("");
+ debug("Set x='1 2 3 4' for text1");
+ shouldBeUndefined("text1.setAttribute('x', '1 2 3 4')");
+
+ debug("");
+ debug("Test uncommon arguments for removeItem()");
+ shouldThrow("text1.x.baseVal.removeItem(30)");
+
+ shouldBe("text1.x.baseVal.removeItem(0).value", "1");
+ shouldBe("text1.x.baseVal.numberOfItems", "3");
+ shouldBe("text1.x.baseVal.getItem(0).value", "2");
+ shouldBe("text1.x.baseVal.getItem(1).value", "3");
+ shouldBe("text1.x.baseVal.getItem(2).value", "4");
+ shouldBeEqualToString("text1.getAttribute('x')", "2 3 4");
+
+ shouldBe("text1.x.baseVal.removeItem(text1).value", "2");
+ shouldBe("text1.x.baseVal.numberOfItems", "2");
+ shouldBe("text1.x.baseVal.getItem(0).value", "3");
+ shouldBe("text1.x.baseVal.getItem(1).value", "4");
+ shouldBeEqualToString("text1.getAttribute('x')", "3 4");
+
+ debug("");
+ debug("Test uncommon arguments for appendItem()");
+ shouldThrow("text1.x.baseVal.appendItem(30)");
+ shouldThrow("text1.x.baseVal.appendItem('aString')");
+ shouldThrow("text1.x.baseVal.appendItem(text1)");
+ shouldThrow("text1.x.baseVal.appendItem(null)");
+
+ debug("");
+ debug("Testing animVal clear throws");
+ shouldThrow("text1.x.animVal.clear()");
+ shouldBeUndefined("text1.x.baseVal.clear()");
+
successfullyParsed = true;
]]>
</script>
diff --git a/LayoutTests/svg/dom/SVGNumberList-basics-expected.txt b/LayoutTests/svg/dom/SVGNumberList-basics-expected.txt
new file mode 100644
index 0000000..714da38
--- /dev/null
+++ b/LayoutTests/svg/dom/SVGNumberList-basics-expected.txt
@@ -0,0 +1,126 @@
+ABC
+This is a test of the simple SVGNumberList API parts.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS text1.rotate.baseVal != text1.rotate.animVal is true
+PASS text1.rotate.baseVal.numberOfItems is 3
+PASS text1.rotate.animVal.numberOfItems is 3
+
+Test uncommon arguments for initialize()
+PASS text1.rotate.baseVal.initialize(30) threw exception TypeError: Type error.
+PASS text1.rotate.baseVal.initialize('aString') threw exception TypeError: Type error.
+PASS text1.rotate.baseVal.initialize(text1) threw exception TypeError: Type error.
+PASS text1.rotate.baseVal.initialize(null) threw exception Error: SVG_WRONG_TYPE_ERR: DOM SVG Exception 0.
+
+Test uncommon arguments for getItem()
+PASS text1.rotate.baseVal.getItem(30) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
+PASS text1.rotate.baseVal.getItem('aString') is text1.rotate.baseVal.getItem(0)
+PASS text1.rotate.baseVal.getItem(text1) is text1.rotate.baseVal.getItem(0)
+PASS text1.rotate.baseVal.getItem(null) is text1.rotate.baseVal.getItem(0)
+
+Test uncommon arguments for insertItemBefore()
+PASS text1.rotate.baseVal.insertItemBefore(30) threw exception SyntaxError: Not enough arguments.
+PASS text1.rotate.baseVal.insertItemBefore('aString') threw exception SyntaxError: Not enough arguments.
+PASS text1.rotate.baseVal.insertItemBefore(text1) threw exception SyntaxError: Not enough arguments.
+PASS text1.rotate.baseVal.insertItemBefore(null) threw exception SyntaxError: Not enough arguments.
+PASS text1.rotate.baseVal.insertItemBefore(text1.rotate.baseVal.getItem(1), 'aString') is text1.rotate.baseVal.getItem(0)
+PASS text1.rotate.baseVal.numberOfItems is 3
+PASS text1.rotate.baseVal.getItem(0).value is 180
+PASS text1.rotate.baseVal.getItem(1).value is 90
+PASS text1.rotate.baseVal.getItem(2).value is 270
+PASS text1.getAttribute('rotate') is "180 90 270"
+PASS text1.rotate.baseVal.insertItemBefore(text1.rotate.baseVal.getItem(1), text1) is text1.rotate.baseVal.getItem(0)
+PASS text1.rotate.baseVal.numberOfItems is 3
+PASS text1.rotate.baseVal.getItem(0).value is 90
+PASS text1.rotate.baseVal.getItem(1).value is 180
+PASS text1.rotate.baseVal.getItem(2).value is 270
+PASS text1.getAttribute('rotate') is "90 180 270"
+PASS text1.rotate.baseVal.insertItemBefore(text1.rotate.baseVal.getItem(1), null) is text1.rotate.baseVal.getItem(0)
+PASS text1.rotate.baseVal.numberOfItems is 3
+PASS text1.rotate.baseVal.getItem(0).value is 180
+PASS text1.rotate.baseVal.getItem(1).value is 90
+PASS text1.rotate.baseVal.getItem(2).value is 270
+PASS text1.getAttribute('rotate') is "180 90 270"
+PASS text1.rotate.baseVal.insertItemBefore(text1.rotate.baseVal.getItem(1), 0) is text1.rotate.baseVal.getItem(0)
+PASS text1.rotate.baseVal.numberOfItems is 3
+PASS text1.rotate.baseVal.getItem(0).value is 90
+PASS text1.rotate.baseVal.getItem(1).value is 180
+PASS text1.rotate.baseVal.getItem(2).value is 270
+PASS text1.getAttribute('rotate') is "90 180 270"
+PASS text1.rotate.baseVal.insertItemBefore(30, 0) threw exception TypeError: Type error.
+PASS text1.rotate.baseVal.insertItemBefore('aString', 0) threw exception TypeError: Type error.
+PASS text1.rotate.baseVal.insertItemBefore(text1, 0) threw exception TypeError: Type error.
+PASS text1.rotate.baseVal.insertItemBefore(null, 0) threw exception Error: SVG_WRONG_TYPE_ERR: DOM SVG Exception 0.
+
+Set rotate='1 2 3 4' for text1
+PASS text1.setAttribute('rotate', '1 2 3 4') is undefined.
+PASS text1.rotate.baseVal.numberOfItems is 4
+PASS text1.rotate.baseVal.getItem(0).value is 1
+PASS text1.rotate.baseVal.getItem(1).value is 2
+PASS text1.rotate.baseVal.getItem(2).value is 3
+PASS text1.rotate.baseVal.getItem(3).value is 4
+PASS text1.getAttribute('rotate') is "1 2 3 4"
+
+Test uncommon arguments for replaceItem()
+PASS text1.rotate.baseVal.replaceItem(30) threw exception SyntaxError: Not enough arguments.
+PASS text1.rotate.baseVal.replaceItem('aString') threw exception SyntaxError: Not enough arguments.
+PASS text1.rotate.baseVal.replaceItem(text1) threw exception SyntaxError: Not enough arguments.
+PASS text1.rotate.baseVal.replaceItem(null) threw exception SyntaxError: Not enough arguments.
+PASS text1.rotate.baseVal.replaceItem(30, 0) threw exception TypeError: Type error.
+PASS text1.rotate.baseVal.replaceItem('aString', 0) threw exception TypeError: Type error.
+PASS text1.rotate.baseVal.replaceItem(text1, 0) threw exception TypeError: Type error.
+PASS text1.rotate.baseVal.replaceItem(null, 0) threw exception Error: SVG_WRONG_TYPE_ERR: DOM SVG Exception 0.
+PASS text1.rotate.baseVal.replaceItem(text1.rotate.baseVal.getItem(0), 0) is text1.rotate.baseVal.getItem(0)
+PASS text1.rotate.baseVal.numberOfItems is 3
+PASS text1.rotate.baseVal.getItem(0).value is 1
+PASS text1.rotate.baseVal.getItem(1).value is 3
+PASS text1.rotate.baseVal.getItem(2).value is 4
+PASS text1.getAttribute('rotate') is "1 3 4"
+PASS text1.rotate.baseVal.replaceItem(text1.rotate.baseVal.getItem(0), 'aString') is text1.rotate.baseVal.getItem(0)
+PASS text1.rotate.baseVal.numberOfItems is 2
+PASS text1.rotate.baseVal.getItem(0).value is 1
+PASS text1.rotate.baseVal.getItem(1).value is 4
+PASS text1.getAttribute('rotate') is "1 4"
+PASS text1.rotate.baseVal.replaceItem(text1.rotate.baseVal.getItem(0), text1) is text1.rotate.baseVal.getItem(0)
+PASS text1.rotate.baseVal.numberOfItems is 1
+PASS text1.getAttribute('rotate') is "1"
+PASS text1.rotate.baseVal.replaceItem(text1.rotate.baseVal.getItem(0), null) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
+PASS text1.rotate.baseVal.numberOfItems is 0
+PASS text1.getAttribute('rotate') is ""
+
+Set rotate='1 2 3 4' for text1
+PASS text1.setAttribute('rotate', '1 2 3 4') is undefined.
+
+Test uncommon arguents for removeItem()
+PASS text1.rotate.baseVal.removeItem(30) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
+PASS text1.rotate.baseVal.removeItem('aString').value is 1
+PASS text1.rotate.baseVal.numberOfItems is 3
+PASS text1.rotate.baseVal.getItem(0).value is 2
+PASS text1.rotate.baseVal.getItem(1).value is 3
+PASS text1.rotate.baseVal.getItem(2).value is 4
+PASS text1.getAttribute('rotate') is "2 3 4"
+PASS text1.rotate.baseVal.removeItem(text1).value is 2
+PASS text1.rotate.baseVal.numberOfItems is 2
+PASS text1.rotate.baseVal.getItem(0).value is 3
+PASS text1.rotate.baseVal.getItem(1).value is 4
+PASS text1.getAttribute('rotate') is "3 4"
+PASS text1.rotate.baseVal.removeItem(null).value is 3
+PASS text1.rotate.baseVal.numberOfItems is 1
+PASS text1.rotate.baseVal.getItem(0).value is 4
+PASS text1.getAttribute('rotate') is "4"
+
+Test uncommon arguments for appendItem()
+PASS text1.rotate.baseVal.appendItem(30) threw exception TypeError: Type error.
+PASS text1.rotate.baseVal.appendItem('aString') threw exception TypeError: Type error.
+PASS text1.rotate.baseVal.appendItem(text1) threw exception TypeError: Type error.
+PASS text1.rotate.baseVal.appendItem(null) threw exception Error: SVG_WRONG_TYPE_ERR: DOM SVG Exception 0.
+
+Testing animVal clear throws
+PASS text1.rotate.animVal.clear() threw exception Error: NO_MODIFICATION_ALLOWED_ERR: DOM Exception 7.
+PASS text1.rotate.baseVal.clear() is undefined.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/svg/dom/SVGNumberList-basics.xhtml b/LayoutTests/svg/dom/SVGNumberList-basics.xhtml
new file mode 100644
index 0000000..67425dc
--- /dev/null
+++ b/LayoutTests/svg/dom/SVGNumberList-basics.xhtml
@@ -0,0 +1,165 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css"/>
+<script>window.enablePixelTesting = true;</script>
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<svg id="svg" xmlns="http://www.w3.org/2000/svg" width="200" height="200">
+ <text id="text1" x="50" y="50" rotate="90 180 270">ABC</text>
+</svg>
+
+<p id="description"></p>
+<div id="console"></div>
+<script type="text/javascript">
+<![CDATA[
+ description("This is a test of the simple SVGNumberList API parts.");
+
+ var text1 = document.getElementById("text1");
+
+ // Spec: The object referenced by animVal will always be distinct from the one referenced by baseVal, even when the attribute is not animated.
+ shouldBeTrue("text1.rotate.baseVal != text1.rotate.animVal");
+
+ shouldBe("text1.rotate.baseVal.numberOfItems", "3");
+ shouldBe("text1.rotate.animVal.numberOfItems", "3");
+
+ debug("");
+ debug("Test uncommon arguments for initialize()");
+ shouldThrow("text1.rotate.baseVal.initialize(30)");
+ shouldThrow("text1.rotate.baseVal.initialize('aString')");
+ shouldThrow("text1.rotate.baseVal.initialize(text1)");
+ shouldThrow("text1.rotate.baseVal.initialize(null)");
+
+ debug("");
+ debug("Test uncommon arguments for getItem()");
+ shouldThrow("text1.rotate.baseVal.getItem(30)");
+ shouldBe("text1.rotate.baseVal.getItem('aString')", "text1.rotate.baseVal.getItem(0)");
+ shouldBe("text1.rotate.baseVal.getItem(text1)", "text1.rotate.baseVal.getItem(0)");
+ shouldBe("text1.rotate.baseVal.getItem(null)", "text1.rotate.baseVal.getItem(0)");
+
+ debug("");
+ debug("Test uncommon arguments for insertItemBefore()");
+ shouldThrow("text1.rotate.baseVal.insertItemBefore(30)");
+ shouldThrow("text1.rotate.baseVal.insertItemBefore('aString')");
+ shouldThrow("text1.rotate.baseVal.insertItemBefore(text1)");
+ shouldThrow("text1.rotate.baseVal.insertItemBefore(null)");
+
+ shouldBe("text1.rotate.baseVal.insertItemBefore(text1.rotate.baseVal.getItem(1), 'aString')", "text1.rotate.baseVal.getItem(0)");
+ shouldBe("text1.rotate.baseVal.numberOfItems", "3");
+ shouldBe("text1.rotate.baseVal.getItem(0).value", "180");
+ shouldBe("text1.rotate.baseVal.getItem(1).value", "90");
+ shouldBe("text1.rotate.baseVal.getItem(2).value", "270");
+ shouldBeEqualToString("text1.getAttribute('rotate')", "180 90 270");
+
+ shouldBe("text1.rotate.baseVal.insertItemBefore(text1.rotate.baseVal.getItem(1), text1)", "text1.rotate.baseVal.getItem(0)");
+ shouldBe("text1.rotate.baseVal.numberOfItems", "3");
+ shouldBe("text1.rotate.baseVal.getItem(0).value", "90");
+ shouldBe("text1.rotate.baseVal.getItem(1).value", "180");
+ shouldBe("text1.rotate.baseVal.getItem(2).value", "270");
+ shouldBeEqualToString("text1.getAttribute('rotate')", "90 180 270");
+
+ shouldBe("text1.rotate.baseVal.insertItemBefore(text1.rotate.baseVal.getItem(1), null)", "text1.rotate.baseVal.getItem(0)");
+ shouldBe("text1.rotate.baseVal.numberOfItems", "3");
+ shouldBe("text1.rotate.baseVal.getItem(0).value", "180");
+ shouldBe("text1.rotate.baseVal.getItem(1).value", "90");
+ shouldBe("text1.rotate.baseVal.getItem(2).value", "270");
+ shouldBeEqualToString("text1.getAttribute('rotate')", "180 90 270");
+
+ shouldBe("text1.rotate.baseVal.insertItemBefore(text1.rotate.baseVal.getItem(1), 0)", "text1.rotate.baseVal.getItem(0)");
+ shouldBe("text1.rotate.baseVal.numberOfItems", "3");
+ shouldBe("text1.rotate.baseVal.getItem(0).value", "90");
+ shouldBe("text1.rotate.baseVal.getItem(1).value", "180");
+ shouldBe("text1.rotate.baseVal.getItem(2).value", "270");
+ shouldBeEqualToString("text1.getAttribute('rotate')", "90 180 270");
+
+ shouldThrow("text1.rotate.baseVal.insertItemBefore(30, 0)");
+ shouldThrow("text1.rotate.baseVal.insertItemBefore('aString', 0)");
+ shouldThrow("text1.rotate.baseVal.insertItemBefore(text1, 0)");
+ shouldThrow("text1.rotate.baseVal.insertItemBefore(null, 0)");
+
+ debug("");
+ debug("Set rotate='1 2 3 4' for text1");
+ shouldBeUndefined("text1.setAttribute('rotate', '1 2 3 4')");
+ shouldBe("text1.rotate.baseVal.numberOfItems", "4");
+ shouldBe("text1.rotate.baseVal.getItem(0).value", "1");
+ shouldBe("text1.rotate.baseVal.getItem(1).value", "2");
+ shouldBe("text1.rotate.baseVal.getItem(2).value", "3");
+ shouldBe("text1.rotate.baseVal.getItem(3).value", "4");
+ shouldBeEqualToString("text1.getAttribute('rotate')", "1 2 3 4");
+
+ debug("");
+ debug("Test uncommon arguments for replaceItem()");
+ shouldThrow("text1.rotate.baseVal.replaceItem(30)");
+ shouldThrow("text1.rotate.baseVal.replaceItem('aString')");
+ shouldThrow("text1.rotate.baseVal.replaceItem(text1)");
+ shouldThrow("text1.rotate.baseVal.replaceItem(null)");
+ shouldThrow("text1.rotate.baseVal.replaceItem(30, 0)");
+ shouldThrow("text1.rotate.baseVal.replaceItem('aString', 0)");
+ shouldThrow("text1.rotate.baseVal.replaceItem(text1, 0)");
+ shouldThrow("text1.rotate.baseVal.replaceItem(null, 0)");
+
+ shouldBe("text1.rotate.baseVal.replaceItem(text1.rotate.baseVal.getItem(0), 0)", "text1.rotate.baseVal.getItem(0)");
+ shouldBe("text1.rotate.baseVal.numberOfItems", "3");
+ shouldBe("text1.rotate.baseVal.getItem(0).value", "1");
+ shouldBe("text1.rotate.baseVal.getItem(1).value", "3");
+ shouldBe("text1.rotate.baseVal.getItem(2).value", "4");
+ shouldBeEqualToString("text1.getAttribute('rotate')", "1 3 4");
+
+ shouldBe("text1.rotate.baseVal.replaceItem(text1.rotate.baseVal.getItem(0), 'aString')", "text1.rotate.baseVal.getItem(0)");
+ shouldBe("text1.rotate.baseVal.numberOfItems", "2");
+ shouldBe("text1.rotate.baseVal.getItem(0).value", "1");
+ shouldBe("text1.rotate.baseVal.getItem(1).value", "4");
+ shouldBeEqualToString("text1.getAttribute('rotate')", "1 4");
+
+ shouldBe("text1.rotate.baseVal.replaceItem(text1.rotate.baseVal.getItem(0), text1)", "text1.rotate.baseVal.getItem(0)");
+ shouldBe("text1.rotate.baseVal.numberOfItems", "1");
+ shouldBeEqualToString("text1.getAttribute('rotate')", "1");
+
+ shouldThrow("text1.rotate.baseVal.replaceItem(text1.rotate.baseVal.getItem(0), null)");
+ shouldBe("text1.rotate.baseVal.numberOfItems", "0");
+ shouldBeEqualToString("text1.getAttribute('rotate')", "");
+
+ debug("");
+ debug("Set rotate='1 2 3 4' for text1");
+ shouldBeUndefined("text1.setAttribute('rotate', '1 2 3 4')");
+
+ debug("");
+ debug("Test uncommon arguents for removeItem()");
+ shouldThrow("text1.rotate.baseVal.removeItem(30)");
+
+ shouldBe("text1.rotate.baseVal.removeItem('aString').value", "1");
+ shouldBe("text1.rotate.baseVal.numberOfItems", "3");
+ shouldBe("text1.rotate.baseVal.getItem(0).value", "2");
+ shouldBe("text1.rotate.baseVal.getItem(1).value", "3");
+ shouldBe("text1.rotate.baseVal.getItem(2).value", "4");
+ shouldBeEqualToString("text1.getAttribute('rotate')", "2 3 4");
+
+ shouldBe("text1.rotate.baseVal.removeItem(text1).value", "2");
+ shouldBe("text1.rotate.baseVal.numberOfItems", "2");
+ shouldBe("text1.rotate.baseVal.getItem(0).value", "3");
+ shouldBe("text1.rotate.baseVal.getItem(1).value", "4");
+ shouldBeEqualToString("text1.getAttribute('rotate')", "3 4");
+
+ shouldBe("text1.rotate.baseVal.removeItem(null).value", "3");
+ shouldBe("text1.rotate.baseVal.numberOfItems", "1");
+ shouldBe("text1.rotate.baseVal.getItem(0).value", "4");
+ shouldBeEqualToString("text1.getAttribute('rotate')", "4");
+
+ debug("");
+ debug("Test uncommon arguments for appendItem()");
+ shouldThrow("text1.rotate.baseVal.appendItem(30)");
+ shouldThrow("text1.rotate.baseVal.appendItem('aString')");
+ shouldThrow("text1.rotate.baseVal.appendItem(text1)");
+ shouldThrow("text1.rotate.baseVal.appendItem(null)");
+
+ debug("");
+ debug("Testing animVal clear throws");
+ shouldThrow("text1.rotate.animVal.clear()");
+ shouldBeUndefined("text1.rotate.baseVal.clear()");
+
+ successfullyParsed = true;
+]]>
+</script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/svg/dom/SVGPointList-basics-expected.txt b/LayoutTests/svg/dom/SVGPointList-basics-expected.txt
new file mode 100644
index 0000000..4edb981
--- /dev/null
+++ b/LayoutTests/svg/dom/SVGPointList-basics-expected.txt
@@ -0,0 +1,148 @@
+This is a test of the simple SVGPointList API parts.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS poly1.points.numberOfItems is 4
+PASS dumpPoint(poly1.points.getItem(0)) is "x=0 y=0"
+PASS dumpPoint(poly1.points.getItem(1)) is "x=100 y=0"
+PASS dumpPoint(poly1.points.getItem(2)) is "x=100 y=100"
+PASS dumpPoint(poly1.points.getItem(3)) is "x=0 y=100"
+PASS poly1.getAttribute('points').formatPointsAttribute() is "0 0 100 0 100 100 0 100"
+
+Creating point x=200 y=100
+PASS (point = svg.createSVGPoint()).toString() is "[object SVGPoint]"
+PASS point.x = 200 is 200
+PASS point.y = 100 is 100
+
+Test uncommon arguments for initialize()
+PASS poly1.points.initialize(point) is point
+PASS poly1.points.numberOfItems is 1
+PASS dumpPoint(poly1.points.getItem(0)) is "x=200 y=100"
+PASS poly1.getAttribute('points').formatPointsAttribute() is "200 100"
+PASS poly1.points.initialize(poly1) threw exception TypeError: Type error.
+PASS poly1.points.initialize(0) threw exception TypeError: Type error.
+PASS poly1.points.initialize('aString') threw exception TypeError: Type error.
+
+Reset points attribute to 0 0 100 0 100 100 0 100
+PASS poly1.setAttribute('points', '0 0 100 0 100 100 0 100') is undefined.
+PASS poly1.points.numberOfItems is 4
+PASS dumpPoint(poly1.points.getItem(0)) is "x=0 y=0"
+PASS dumpPoint(poly1.points.getItem(1)) is "x=100 y=0"
+PASS dumpPoint(poly1.points.getItem(2)) is "x=100 y=100"
+PASS dumpPoint(poly1.points.getItem(3)) is "x=0 y=100"
+PASS poly1.getAttribute('points').formatPointsAttribute() is "0 0 100 0 100 100 0 100"
+
+Test uncommon arguments for getItem()
+PASS poly1.points.getItem(30) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
+PASS poly1.points.getItem('aString') is poly1.points.getItem(0)
+PASS poly1.points.getItem(poly1) is poly1.points.getItem(0)
+PASS poly1.points.getItem(null) is poly1.points.getItem(0)
+
+Test uncommon arguments for insertItemBefore()
+PASS poly1.points.insertItemBefore(30) threw exception SyntaxError: Not enough arguments.
+PASS poly1.points.insertItemBefore('aString') threw exception SyntaxError: Not enough arguments.
+PASS poly1.points.insertItemBefore(poly1) threw exception SyntaxError: Not enough arguments.
+PASS poly1.points.insertItemBefore(null) threw exception SyntaxError: Not enough arguments.
+PASS dumpPoint(poly1.points.insertItemBefore(poly1.points.getItem(1), 'aString')) is "x=100 y=0"
+PASS poly1.points.numberOfItems is 4
+PASS dumpPoint(poly1.points.getItem(0)) is "x=100 y=0"
+PASS dumpPoint(poly1.points.getItem(1)) is "x=0 y=0"
+PASS dumpPoint(poly1.points.getItem(2)) is "x=100 y=100"
+PASS dumpPoint(poly1.points.getItem(3)) is "x=0 y=100"
+PASS poly1.getAttribute('points').formatPointsAttribute() is "100 0 0 0 100 100 0 100"
+PASS dumpPoint(poly1.points.insertItemBefore(poly1.points.getItem(1), poly1)) is "x=0 y=0"
+PASS poly1.points.numberOfItems is 4
+PASS dumpPoint(poly1.points.getItem(0)) is "x=0 y=0"
+PASS dumpPoint(poly1.points.getItem(1)) is "x=100 y=0"
+PASS dumpPoint(poly1.points.getItem(2)) is "x=100 y=100"
+PASS dumpPoint(poly1.points.getItem(3)) is "x=0 y=100"
+PASS poly1.getAttribute('points').formatPointsAttribute() is "0 0 100 0 100 100 0 100"
+PASS dumpPoint(poly1.points.insertItemBefore(poly1.points.getItem(1), null)) is "x=100 y=0"
+PASS poly1.points.numberOfItems is 4
+PASS dumpPoint(poly1.points.getItem(0)) is "x=100 y=0"
+PASS dumpPoint(poly1.points.getItem(1)) is "x=0 y=0"
+PASS dumpPoint(poly1.points.getItem(2)) is "x=100 y=100"
+PASS poly1.getAttribute('points').formatPointsAttribute() is "100 0 0 0 100 100 0 100"
+PASS dumpPoint(poly1.points.insertItemBefore(poly1.points.getItem(1), 0)) is "x=0 y=0"
+PASS poly1.points.numberOfItems is 4
+PASS dumpPoint(poly1.points.getItem(0)) is "x=0 y=0"
+PASS dumpPoint(poly1.points.getItem(1)) is "x=100 y=0"
+PASS dumpPoint(poly1.points.getItem(2)) is "x=100 y=100"
+PASS dumpPoint(poly1.points.getItem(3)) is "x=0 y=100"
+PASS poly1.getAttribute('points').formatPointsAttribute() is "0 0 100 0 100 100 0 100"
+PASS poly1.points.insertItemBefore(30, 0) threw exception TypeError: Type error.
+PASS poly1.points.insertItemBefore('aString', 0) threw exception TypeError: Type error.
+PASS poly1.points.insertItemBefore(poly1, 0) threw exception TypeError: Type error.
+PASS poly1.points.insertItemBefore(null, 0) threw exception Error: SVG_WRONG_TYPE_ERR: DOM SVG Exception 0.
+
+Test uncommon arguments for replaceItem()
+PASS poly1.points.replaceItem(30) threw exception SyntaxError: Not enough arguments.
+PASS poly1.points.replaceItem('aString') threw exception SyntaxError: Not enough arguments.
+PASS poly1.points.replaceItem(poly1) threw exception SyntaxError: Not enough arguments.
+PASS poly1.points.replaceItem(null, 0) threw exception Error: SVG_WRONG_TYPE_ERR: DOM SVG Exception 0.
+PASS poly1.points.replaceItem('aString', 0) threw exception TypeError: Type error.
+PASS poly1.points.replaceItem(poly1, 0) threw exception TypeError: Type error.
+PASS poly1.points.replaceItem(1, 0) threw exception TypeError: Type error.
+
+Test uncommon arguments for replaceItem() and xml-dom synchronization
+PASS poly1.points.numberOfItems is 4
+PASS dumpPoint(poly1.points.getItem(0)) is "x=0 y=0"
+PASS dumpPoint(poly1.points.getItem(1)) is "x=100 y=0"
+PASS dumpPoint(poly1.points.getItem(2)) is "x=100 y=100"
+PASS dumpPoint(poly1.points.getItem(3)) is "x=0 y=100"
+PASS poly1.getAttribute('points').formatPointsAttribute() is "0 0 100 0 100 100 0 100"
+PASS dumpPoint(poly1.points.replaceItem(poly1.points.getItem(0), 0)) is "x=0 y=0"
+PASS poly1.points.numberOfItems is 3
+PASS dumpPoint(poly1.points.getItem(0)) is "x=0 y=0"
+PASS dumpPoint(poly1.points.getItem(1)) is "x=100 y=100"
+PASS dumpPoint(poly1.points.getItem(2)) is "x=0 y=100"
+PASS poly1.getAttribute('points').formatPointsAttribute() is "0 0 100 100 0 100"
+PASS dumpPoint(poly1.points.replaceItem(poly1.points.getItem(0), 'aString')) is "x=0 y=0"
+PASS poly1.points.numberOfItems is 2
+PASS dumpPoint(poly1.points.getItem(0)) is "x=0 y=0"
+PASS dumpPoint(poly1.points.getItem(1)) is "x=0 y=100"
+PASS poly1.getAttribute('points').formatPointsAttribute() is "0 0 0 100"
+PASS dumpPoint(poly1.points.replaceItem(poly1.points.getItem(0), poly1)) is "x=0 y=0"
+PASS poly1.points.numberOfItems is 1
+PASS dumpPoint(poly1.points.getItem(0)) is "x=0 y=0"
+PASS poly1.getAttribute('points').formatPointsAttribute() is "0 0"
+PASS poly1.points.replaceItem(poly1.points.getItem(0), null) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
+PASS poly1.points.numberOfItems is 0
+PASS poly1.getAttribute('points') is ""
+
+Reset points attribute to 0 0 100 0 100 100 0 100
+PASS poly1.setAttribute('points', '0 0 100 0 100 100 0 100') is undefined.
+
+Test uncommon arguments for removeItem()
+PASS poly1.points.removeItem(30) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
+PASS dumpPoint(poly1.points.removeItem('aString')) is "x=0 y=0"
+PASS poly1.points.numberOfItems is 3
+PASS dumpPoint(poly1.points.getItem(0)) is "x=100 y=0"
+PASS dumpPoint(poly1.points.getItem(1)) is "x=100 y=100"
+PASS dumpPoint(poly1.points.getItem(0)) is "x=100 y=0"
+PASS poly1.getAttribute('points').formatPointsAttribute() is "100 0 100 100 0 100"
+PASS dumpPoint(poly1.points.removeItem(poly1)) is "x=100 y=0"
+PASS poly1.points.numberOfItems is 2
+PASS dumpPoint(poly1.points.getItem(0)) is "x=100 y=100"
+PASS dumpPoint(poly1.points.getItem(1)) is "x=0 y=100"
+PASS poly1.getAttribute('points').formatPointsAttribute() is "100 100 0 100"
+PASS dumpPoint(poly1.points.removeItem(null)) is "x=100 y=100"
+PASS poly1.points.numberOfItems is 1
+PASS dumpPoint(poly1.points.getItem(0)) is "x=0 y=100"
+PASS poly1.getAttribute('points').formatPointsAttribute() is "0 100"
+
+Test uncommon arguments for appendItem()
+PASS poly1.points.appendItem(30) threw exception TypeError: Type error.
+PASS poly1.points.appendItem('aString') threw exception TypeError: Type error.
+PASS poly1.points.appendItem(poly1) threw exception TypeError: Type error.
+PASS poly1.points.appendItem(null) threw exception Error: SVG_WRONG_TYPE_ERR: DOM SVG Exception 0.
+PASS dumpPoint(poly1.points.appendItem(point)) is "x=200 y=100"
+PASS poly1.points.numberOfItems is 2
+PASS dumpPoint(poly1.points.getItem(0)) is "x=0 y=100"
+PASS dumpPoint(poly1.points.getItem(1)) is "x=200 y=100"
+PASS poly1.getAttribute('points').formatPointsAttribute() is "0 100 200 100"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/svg/dom/SVGPointList-basics.xhtml b/LayoutTests/svg/dom/SVGPointList-basics.xhtml
new file mode 100644
index 0000000..77f5c53
--- /dev/null
+++ b/LayoutTests/svg/dom/SVGPointList-basics.xhtml
@@ -0,0 +1,198 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css"/>
+<script>window.enablePixelTesting = true;</script>
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<svg id="svg" xmlns="http://www.w3.org/2000/svg" width="200" height="200">
+ <polyline id="poly1" stroke="green" points="0 0 100 0 100 100 0 100"/>
+</svg>
+
+<p id="description"></p>
+<div id="console"></div>
+<script type="text/javascript">
+<![CDATA[
+ description("This is a test of the simple SVGPointList API parts.");
+
+ // Extend String prototype, to offer a function, that formats the points attribute in the same way across browsers
+ String.prototype.formatPointsAttribute = function() {
+ return this.replace(/,/g, " "); // Remove Firefox commas
+ }
+
+ function dumpPoint(point) {
+ return "x=" + point.x.toFixed(0) + " y=" + point.y.toFixed(0);
+ }
+
+ var svg = document.getElementById("svg");
+ var poly1 = document.getElementById("poly1");
+ shouldBe("poly1.points.numberOfItems", "4");
+ shouldBeEqualToString("dumpPoint(poly1.points.getItem(0))", "x=0 y=0");
+ shouldBeEqualToString("dumpPoint(poly1.points.getItem(1))", "x=100 y=0");
+ shouldBeEqualToString("dumpPoint(poly1.points.getItem(2))", "x=100 y=100");
+ shouldBeEqualToString("dumpPoint(poly1.points.getItem(3))", "x=0 y=100");
+ shouldBeEqualToString("poly1.getAttribute('points').formatPointsAttribute()", "0 0 100 0 100 100 0 100");
+
+ var point;
+ debug("");
+ debug("Creating point x=200 y=100");
+ shouldBeEqualToString("(point = svg.createSVGPoint()).toString()", "[object SVGPoint]");
+ shouldBe("point.x = 200", "200");
+ shouldBe("point.y = 100", "100");
+
+ debug("");
+ debug("Test uncommon arguments for initialize()");
+ shouldBe("poly1.points.initialize(point)", "point");
+ shouldBe("poly1.points.numberOfItems", "1");
+ shouldBeEqualToString("dumpPoint(poly1.points.getItem(0))", "x=200 y=100");
+ shouldBeEqualToString("poly1.getAttribute('points').formatPointsAttribute()", "200 100");
+ shouldThrow("poly1.points.initialize(poly1)");
+ shouldThrow("poly1.points.initialize(0)");
+ shouldThrow("poly1.points.initialize('aString')");
+
+ debug("");
+ debug("Reset points attribute to 0 0 100 0 100 100 0 100");
+ shouldBeUndefined("poly1.setAttribute('points', '0 0 100 0 100 100 0 100')");
+ shouldBe("poly1.points.numberOfItems", "4");
+ shouldBeEqualToString("dumpPoint(poly1.points.getItem(0))", "x=0 y=0");
+ shouldBeEqualToString("dumpPoint(poly1.points.getItem(1))", "x=100 y=0");
+ shouldBeEqualToString("dumpPoint(poly1.points.getItem(2))", "x=100 y=100");
+ shouldBeEqualToString("dumpPoint(poly1.points.getItem(3))", "x=0 y=100");
+ shouldBeEqualToString("poly1.getAttribute('points').formatPointsAttribute()", "0 0 100 0 100 100 0 100");
+
+ debug("");
+ debug("Test uncommon arguments for getItem()");
+ shouldThrow("poly1.points.getItem(30)");
+ shouldBe("poly1.points.getItem('aString')", "poly1.points.getItem(0)");
+ shouldBe("poly1.points.getItem(poly1)", "poly1.points.getItem(0)");
+ shouldBe("poly1.points.getItem(null)", "poly1.points.getItem(0)");
+
+ debug("");
+ debug("Test uncommon arguments for insertItemBefore()");
+ shouldThrow("poly1.points.insertItemBefore(30)");
+ shouldThrow("poly1.points.insertItemBefore('aString')");
+ shouldThrow("poly1.points.insertItemBefore(poly1)");
+ shouldThrow("poly1.points.insertItemBefore(null)");
+
+ shouldBeEqualToString("dumpPoint(poly1.points.insertItemBefore(poly1.points.getItem(1), 'aString'))", "x=100 y=0");
+ shouldBe("poly1.points.numberOfItems", "4");
+ shouldBeEqualToString("dumpPoint(poly1.points.getItem(0))", "x=100 y=0");
+ shouldBeEqualToString("dumpPoint(poly1.points.getItem(1))", "x=0 y=0");
+ shouldBeEqualToString("dumpPoint(poly1.points.getItem(2))", "x=100 y=100");
+ shouldBeEqualToString("dumpPoint(poly1.points.getItem(3))", "x=0 y=100");
+ shouldBeEqualToString("poly1.getAttribute('points').formatPointsAttribute()", "100 0 0 0 100 100 0 100");
+
+ shouldBeEqualToString("dumpPoint(poly1.points.insertItemBefore(poly1.points.getItem(1), poly1))", "x=0 y=0");
+ shouldBe("poly1.points.numberOfItems", "4");
+ shouldBeEqualToString("dumpPoint(poly1.points.getItem(0))", "x=0 y=0");
+ shouldBeEqualToString("dumpPoint(poly1.points.getItem(1))", "x=100 y=0");
+ shouldBeEqualToString("dumpPoint(poly1.points.getItem(2))", "x=100 y=100");
+ shouldBeEqualToString("dumpPoint(poly1.points.getItem(3))", "x=0 y=100");
+ shouldBeEqualToString("poly1.getAttribute('points').formatPointsAttribute()", "0 0 100 0 100 100 0 100");
+
+ shouldBeEqualToString("dumpPoint(poly1.points.insertItemBefore(poly1.points.getItem(1), null))", "x=100 y=0");
+ shouldBe("poly1.points.numberOfItems", "4");
+ shouldBeEqualToString("dumpPoint(poly1.points.getItem(0))", "x=100 y=0");
+ shouldBeEqualToString("dumpPoint(poly1.points.getItem(1))", "x=0 y=0");
+ shouldBeEqualToString("dumpPoint(poly1.points.getItem(2))", "x=100 y=100");
+ shouldBeEqualToString("poly1.getAttribute('points').formatPointsAttribute()", "100 0 0 0 100 100 0 100");
+
+ shouldBeEqualToString("dumpPoint(poly1.points.insertItemBefore(poly1.points.getItem(1), 0))", "x=0 y=0");
+ shouldBe("poly1.points.numberOfItems", "4");
+ shouldBeEqualToString("dumpPoint(poly1.points.getItem(0))", "x=0 y=0");
+ shouldBeEqualToString("dumpPoint(poly1.points.getItem(1))", "x=100 y=0");
+ shouldBeEqualToString("dumpPoint(poly1.points.getItem(2))", "x=100 y=100");
+ shouldBeEqualToString("dumpPoint(poly1.points.getItem(3))", "x=0 y=100");
+ shouldBeEqualToString("poly1.getAttribute('points').formatPointsAttribute()", "0 0 100 0 100 100 0 100");
+
+ shouldThrow("poly1.points.insertItemBefore(30, 0)");
+ shouldThrow("poly1.points.insertItemBefore('aString', 0)");
+ shouldThrow("poly1.points.insertItemBefore(poly1, 0)");
+ shouldThrow("poly1.points.insertItemBefore(null, 0)");
+
+ debug("");
+ debug("Test uncommon arguments for replaceItem()");
+ shouldThrow("poly1.points.replaceItem(30)");
+ shouldThrow("poly1.points.replaceItem('aString')");
+ shouldThrow("poly1.points.replaceItem(poly1)");
+ shouldThrow("poly1.points.replaceItem(null, 0)");
+ shouldThrow("poly1.points.replaceItem('aString', 0)");
+ shouldThrow("poly1.points.replaceItem(poly1, 0)");
+ shouldThrow("poly1.points.replaceItem(1, 0)");
+
+ debug("");
+ debug("Test uncommon arguments for replaceItem() and xml-dom synchronization");
+ shouldBe("poly1.points.numberOfItems", "4");
+ shouldBeEqualToString("dumpPoint(poly1.points.getItem(0))", "x=0 y=0");
+ shouldBeEqualToString("dumpPoint(poly1.points.getItem(1))", "x=100 y=0");
+ shouldBeEqualToString("dumpPoint(poly1.points.getItem(2))", "x=100 y=100");
+ shouldBeEqualToString("dumpPoint(poly1.points.getItem(3))", "x=0 y=100");
+ shouldBeEqualToString("poly1.getAttribute('points').formatPointsAttribute()", "0 0 100 0 100 100 0 100");
+
+ shouldBeEqualToString("dumpPoint(poly1.points.replaceItem(poly1.points.getItem(0), 0))", "x=0 y=0");
+ shouldBe("poly1.points.numberOfItems", "3");
+ shouldBeEqualToString("dumpPoint(poly1.points.getItem(0))", "x=0 y=0");
+ shouldBeEqualToString("dumpPoint(poly1.points.getItem(1))", "x=100 y=100");
+ shouldBeEqualToString("dumpPoint(poly1.points.getItem(2))", "x=0 y=100");
+ shouldBeEqualToString("poly1.getAttribute('points').formatPointsAttribute()", "0 0 100 100 0 100");
+
+ shouldBeEqualToString("dumpPoint(poly1.points.replaceItem(poly1.points.getItem(0), 'aString'))", "x=0 y=0");
+ shouldBe("poly1.points.numberOfItems", "2");
+ shouldBeEqualToString("dumpPoint(poly1.points.getItem(0))", "x=0 y=0");
+ shouldBeEqualToString("dumpPoint(poly1.points.getItem(1))", "x=0 y=100");
+ shouldBeEqualToString("poly1.getAttribute('points').formatPointsAttribute()", "0 0 0 100");
+
+ shouldBeEqualToString("dumpPoint(poly1.points.replaceItem(poly1.points.getItem(0), poly1))", "x=0 y=0");
+ shouldBe("poly1.points.numberOfItems", "1");
+ shouldBeEqualToString("dumpPoint(poly1.points.getItem(0))", "x=0 y=0");
+ shouldBeEqualToString("poly1.getAttribute('points').formatPointsAttribute()", "0 0");
+
+ shouldThrow("poly1.points.replaceItem(poly1.points.getItem(0), null)");
+ shouldBe("poly1.points.numberOfItems", "0");
+ shouldBeEqualToString("poly1.getAttribute('points')", "");
+
+ debug("");
+ debug("Reset points attribute to 0 0 100 0 100 100 0 100");
+ shouldBeUndefined("poly1.setAttribute('points', '0 0 100 0 100 100 0 100')");
+
+ debug("");
+ debug("Test uncommon arguments for removeItem()");
+ shouldThrow("poly1.points.removeItem(30)");
+
+ shouldBeEqualToString("dumpPoint(poly1.points.removeItem('aString'))", "x=0 y=0");
+ shouldBe("poly1.points.numberOfItems", "3");
+ shouldBeEqualToString("dumpPoint(poly1.points.getItem(0))", "x=100 y=0");
+ shouldBeEqualToString("dumpPoint(poly1.points.getItem(1))", "x=100 y=100");
+ shouldBeEqualToString("dumpPoint(poly1.points.getItem(0))", "x=100 y=0");
+ shouldBeEqualToString("poly1.getAttribute('points').formatPointsAttribute()", "100 0 100 100 0 100");
+
+ shouldBeEqualToString("dumpPoint(poly1.points.removeItem(poly1))", "x=100 y=0");
+ shouldBe("poly1.points.numberOfItems", "2");
+ shouldBeEqualToString("dumpPoint(poly1.points.getItem(0))", "x=100 y=100");
+ shouldBeEqualToString("dumpPoint(poly1.points.getItem(1))", "x=0 y=100");
+ shouldBeEqualToString("poly1.getAttribute('points').formatPointsAttribute()", "100 100 0 100");
+
+ shouldBeEqualToString("dumpPoint(poly1.points.removeItem(null))", "x=100 y=100");
+ shouldBe("poly1.points.numberOfItems", "1");
+ shouldBeEqualToString("dumpPoint(poly1.points.getItem(0))", "x=0 y=100");
+ shouldBeEqualToString("poly1.getAttribute('points').formatPointsAttribute()", "0 100");
+
+ debug("");
+ debug("Test uncommon arguments for appendItem()");
+ shouldThrow("poly1.points.appendItem(30)");
+ shouldThrow("poly1.points.appendItem('aString')");
+ shouldThrow("poly1.points.appendItem(poly1)");
+ shouldThrow("poly1.points.appendItem(null)");
+
+ shouldBeEqualToString("dumpPoint(poly1.points.appendItem(point))", "x=200 y=100");
+ shouldBe("poly1.points.numberOfItems", "2");
+ shouldBeEqualToString("dumpPoint(poly1.points.getItem(0))", "x=0 y=100");
+ shouldBeEqualToString("dumpPoint(poly1.points.getItem(1))", "x=200 y=100");
+ shouldBeEqualToString("poly1.getAttribute('points').formatPointsAttribute()", "0 100 200 100");
+
+ successfullyParsed = true;
+]]>
+</script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/svg/dom/SVGStringList-basics-expected.txt b/LayoutTests/svg/dom/SVGStringList-basics-expected.txt
new file mode 100644
index 0000000..16bd979
--- /dev/null
+++ b/LayoutTests/svg/dom/SVGStringList-basics-expected.txt
@@ -0,0 +1,198 @@
+ABC
+This is a test of the simple SVGStringList API parts.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS text1.requiredFeatures.numberOfItems is 3
+
+Test uncommon arguments for initialize()
+PASS text1.requiredFeatures.initialize('30') is "30"
+PASS text1.requiredFeatures.numberOfItems is 1
+PASS text1.requiredFeatures.getItem(0) is "30"
+PASS text1.getAttribute('requiredFeatures') is "30"
+PASS text1.requiredFeatures.initialize(text1) is "[object SVGTextElement]"
+PASS text1.requiredFeatures.numberOfItems is 1
+PASS text1.requiredFeatures.getItem(0) is "[object SVGTextElement]"
+PASS text1.getAttribute('requiredFeatures') is "[object SVGTextElement]"
+PASS text1.requiredFeatures.initialize(0) is "0"
+PASS text1.requiredFeatures.numberOfItems is 1
+PASS text1.requiredFeatures.getItem(0) is "0"
+PASS text1.getAttribute('requiredFeatures') is "0"
+PASS text1.requiredFeatures.initialize('aString') is "aString"
+PASS text1.requiredFeatures.numberOfItems is 1
+PASS text1.requiredFeatures.getItem(0) is "aString"
+PASS text1.getAttribute('requiredFeatures') is "aString"
+
+Test uncommon arguments for getItem()
+PASS text1.requiredFeatures.getItem(30) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
+PASS text1.requiredFeatures.getItem('aString') is text1.requiredFeatures.getItem(0)
+PASS text1.requiredFeatures.getItem(text1) is text1.requiredFeatures.getItem(0)
+PASS text1.requiredFeatures.getItem(null) is text1.requiredFeatures.getItem(0)
+
+Test uncommon arguments for insertItemBefore()
+PASS text1.requiredFeatures.insertItemBefore(30) threw exception SyntaxError: Not enough arguments.
+PASS text1.requiredFeatures.insertItemBefore('aString') threw exception SyntaxError: Not enough arguments.
+PASS text1.requiredFeatures.insertItemBefore(text1) threw exception SyntaxError: Not enough arguments.
+PASS text1.requiredFeatures.insertItemBefore(null) threw exception SyntaxError: Not enough arguments.
+PASS text1.requiredFeatures.insertItemBefore(text1.requiredFeatures.getItem(1), 'aString') threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
+PASS text1.requiredFeatures.insertItemBefore(text1.requiredFeatures.getItem(1), text1) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
+PASS text1.requiredFeatures.insertItemBefore(text1.requiredFeatures.getItem(1), null) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
+PASS text1.requiredFeatures.insertItemBefore(text1.requiredFeatures.getItem(1), 0) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
+PASS text1.requiredFeatures.insertItemBefore(30, 0) is "30"
+PASS text1.requiredFeatures.numberOfItems is 2
+PASS text1.requiredFeatures.getItem(0) is "30"
+PASS text1.requiredFeatures.getItem(1) is "aString"
+PASS text1.getAttribute('requiredFeatures') is "30 aString"
+PASS text1.requiredFeatures.insertItemBefore('aString', 0) is "aString"
+PASS text1.requiredFeatures.numberOfItems is 3
+PASS text1.requiredFeatures.getItem(0) is "aString"
+PASS text1.requiredFeatures.getItem(1) is "30"
+PASS text1.requiredFeatures.getItem(2) is "aString"
+PASS text1.getAttribute('requiredFeatures') is "aString 30 aString"
+PASS text1.requiredFeatures.insertItemBefore(text1, 0) is "[object SVGTextElement]"
+PASS text1.requiredFeatures.numberOfItems is 4
+PASS text1.requiredFeatures.getItem(0) is "[object SVGTextElement]"
+PASS text1.requiredFeatures.getItem(1) is "aString"
+PASS text1.requiredFeatures.getItem(2) is "30"
+PASS text1.requiredFeatures.getItem(3) is "aString"
+PASS text1.getAttribute('requiredFeatures') is "[object SVGTextElement] aString 30 aString"
+PASS text1.requiredFeatures.insertItemBefore(null, 0) is "null"
+PASS text1.requiredFeatures.numberOfItems is 5
+PASS text1.requiredFeatures.getItem(0) is "null"
+PASS text1.requiredFeatures.getItem(1) is "[object SVGTextElement]"
+PASS text1.requiredFeatures.getItem(2) is "aString"
+PASS text1.requiredFeatures.getItem(3) is "30"
+PASS text1.requiredFeatures.getItem(4) is "aString"
+PASS text1.getAttribute('requiredFeatures') is "null [object SVGTextElement] aString 30 aString"
+
+Set requiredFeatures='1 2 3 4' for text1
+PASS text1.setAttribute('requiredFeatures', '1 2 3 4') is undefined.
+PASS text1.requiredFeatures.numberOfItems is 4
+PASS text1.requiredFeatures.getItem(0) is "1"
+PASS text1.requiredFeatures.getItem(1) is "2"
+PASS text1.requiredFeatures.getItem(2) is "3"
+PASS text1.requiredFeatures.getItem(3) is "4"
+PASS text1.getAttribute('requiredFeatures') is "1 2 3 4"
+
+Test uncommon arguments for replaceItem() - part 1
+PASS text1.requiredFeatures.replaceItem(30) threw exception SyntaxError: Not enough arguments.
+PASS text1.requiredFeatures.replaceItem('aString') threw exception SyntaxError: Not enough arguments.
+PASS text1.requiredFeatures.replaceItem(text1) threw exception SyntaxError: Not enough arguments.
+PASS text1.requiredFeatures.replaceItem(null, 0) is "null"
+PASS text1.requiredFeatures.numberOfItems is 4
+PASS text1.requiredFeatures.getItem(0) is "null"
+PASS text1.requiredFeatures.getItem(1) is "2"
+PASS text1.requiredFeatures.getItem(2) is "3"
+PASS text1.requiredFeatures.getItem(3) is "4"
+PASS text1.getAttribute('requiredFeatures') is "null 2 3 4"
+PASS text1.requiredFeatures.replaceItem('aString', 3) is "aString"
+PASS text1.requiredFeatures.numberOfItems is 4
+PASS text1.requiredFeatures.getItem(0) is "null"
+PASS text1.requiredFeatures.getItem(1) is "2"
+PASS text1.requiredFeatures.getItem(2) is "3"
+PASS text1.requiredFeatures.getItem(3) is "aString"
+PASS text1.getAttribute('requiredFeatures') is "null 2 3 aString"
+PASS text1.requiredFeatures.replaceItem(text1, 2) is "[object SVGTextElement]"
+PASS text1.requiredFeatures.numberOfItems is 4
+PASS text1.requiredFeatures.getItem(0) is "null"
+PASS text1.requiredFeatures.getItem(1) is "2"
+PASS text1.requiredFeatures.getItem(2) is "[object SVGTextElement]"
+PASS text1.requiredFeatures.getItem(3) is "aString"
+PASS text1.getAttribute('requiredFeatures') is "null 2 [object SVGTextElement] aString"
+PASS text1.requiredFeatures.replaceItem(1, 1) is "1"
+PASS text1.requiredFeatures.numberOfItems is 4
+PASS text1.requiredFeatures.getItem(0) is "null"
+PASS text1.requiredFeatures.getItem(1) is "1"
+PASS text1.requiredFeatures.getItem(2) is "[object SVGTextElement]"
+PASS text1.requiredFeatures.getItem(3) is "aString"
+PASS text1.getAttribute('requiredFeatures') is "null 1 [object SVGTextElement] aString"
+
+Set requiredFeatures='1 2 3 4' for text1
+PASS text1.setAttribute('requiredFeatures', '1 2 3 4') is undefined.
+PASS text1.requiredFeatures.numberOfItems is 4
+PASS text1.requiredFeatures.getItem(0) is "1"
+PASS text1.requiredFeatures.getItem(1) is "2"
+PASS text1.requiredFeatures.getItem(2) is "3"
+PASS text1.requiredFeatures.getItem(3) is "4"
+PASS text1.getAttribute('requiredFeatures') is "1 2 3 4"
+
+Test uncommon arguments for replaceItem() - part 2
+PASS text1.requiredFeatures.replaceItem(text1.requiredFeatures.getItem(0), 0) is "1"
+PASS text1.requiredFeatures.numberOfItems is 4
+PASS text1.requiredFeatures.getItem(0) is "1"
+PASS text1.requiredFeatures.getItem(1) is "2"
+PASS text1.requiredFeatures.getItem(2) is "3"
+PASS text1.requiredFeatures.getItem(3) is "4"
+PASS text1.getAttribute('requiredFeatures') is "1 2 3 4"
+PASS text1.requiredFeatures.replaceItem(text1.requiredFeatures.getItem(0), 'aString') is "1"
+PASS text1.requiredFeatures.numberOfItems is 4
+PASS text1.requiredFeatures.getItem(0) is "1"
+PASS text1.requiredFeatures.getItem(1) is "2"
+PASS text1.requiredFeatures.getItem(2) is "3"
+PASS text1.requiredFeatures.getItem(3) is "4"
+PASS text1.getAttribute('requiredFeatures') is "1 2 3 4"
+PASS text1.requiredFeatures.replaceItem(text1.requiredFeatures.getItem(0), text1) is "1"
+PASS text1.requiredFeatures.numberOfItems is 4
+PASS text1.requiredFeatures.getItem(0) is "1"
+PASS text1.requiredFeatures.getItem(1) is "2"
+PASS text1.requiredFeatures.getItem(2) is "3"
+PASS text1.requiredFeatures.getItem(3) is "4"
+PASS text1.getAttribute('requiredFeatures') is "1 2 3 4"
+PASS text1.requiredFeatures.replaceItem(text1.requiredFeatures.getItem(0), null) is "1"
+PASS text1.requiredFeatures.numberOfItems is 4
+PASS text1.requiredFeatures.getItem(0) is "1"
+PASS text1.requiredFeatures.getItem(1) is "2"
+PASS text1.requiredFeatures.getItem(2) is "3"
+PASS text1.requiredFeatures.getItem(3) is "4"
+PASS text1.getAttribute('requiredFeatures') is "1 2 3 4"
+
+Test uncommon arguments for removeItem()
+PASS text1.requiredFeatures.removeItem(30) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
+PASS text1.requiredFeatures.removeItem('aString') is "1"
+PASS text1.requiredFeatures.numberOfItems is 3
+PASS text1.getAttribute('requiredFeatures') is "2 3 4"
+PASS text1.requiredFeatures.removeItem(text1) is "2"
+PASS text1.requiredFeatures.numberOfItems is 2
+PASS text1.requiredFeatures.getItem(0) is "3"
+PASS text1.requiredFeatures.getItem(1) is "4"
+PASS text1.getAttribute('requiredFeatures') is "3 4"
+PASS text1.requiredFeatures.removeItem(null) is "3"
+PASS text1.requiredFeatures.numberOfItems is 1
+PASS text1.getAttribute('requiredFeatures') is "4"
+PASS text1.requiredFeatures.getItem(0) is "4"
+
+Test uncommon arguments for appendItem()
+PASS text1.requiredFeatures.appendItem(30) is "30"
+PASS text1.requiredFeatures.numberOfItems is 2
+PASS text1.requiredFeatures.getItem(0) is "4"
+PASS text1.requiredFeatures.getItem(1) is "30"
+PASS text1.getAttribute('requiredFeatures') is "4 30"
+PASS text1.requiredFeatures.appendItem('aString') is "aString"
+PASS text1.requiredFeatures.numberOfItems is 3
+PASS text1.requiredFeatures.getItem(0) is "4"
+PASS text1.requiredFeatures.getItem(1) is "30"
+PASS text1.requiredFeatures.getItem(2) is "aString"
+PASS text1.getAttribute('requiredFeatures') is "4 30 aString"
+PASS text1.requiredFeatures.appendItem(text1) is "[object SVGTextElement]"
+PASS text1.requiredFeatures.numberOfItems is 4
+PASS text1.requiredFeatures.getItem(0) is "4"
+PASS text1.requiredFeatures.getItem(1) is "30"
+PASS text1.requiredFeatures.getItem(2) is "aString"
+PASS text1.requiredFeatures.getItem(3) is "[object SVGTextElement]"
+PASS text1.getAttribute('requiredFeatures') is "4 30 aString [object SVGTextElement]"
+PASS text1.requiredFeatures.appendItem(null) is "null"
+PASS text1.requiredFeatures.numberOfItems is 5
+PASS text1.requiredFeatures.getItem(0) is "4"
+PASS text1.requiredFeatures.getItem(1) is "30"
+PASS text1.requiredFeatures.getItem(2) is "aString"
+PASS text1.requiredFeatures.getItem(3) is "[object SVGTextElement]"
+PASS text1.requiredFeatures.getItem(4) is "null"
+PASS text1.getAttribute('requiredFeatures') is "4 30 aString [object SVGTextElement] null"
+
+clear() requiredFeatures list so text on top shows up
+PASS text1.requiredFeatures.clear() is undefined.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/svg/dom/SVGStringList-basics.xhtml b/LayoutTests/svg/dom/SVGStringList-basics.xhtml
new file mode 100644
index 0000000..66be879
--- /dev/null
+++ b/LayoutTests/svg/dom/SVGStringList-basics.xhtml
@@ -0,0 +1,243 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css"/>
+<script>window.enablePixelTesting = true;</script>
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<svg id="svg" xmlns="http://www.w3.org/2000/svg" width="200" height="200">
+ <text id="text1" x="50" y="50" requiredFeatures="1 2 3">ABC</text>
+</svg>
+
+<p id="description"></p>
+<div id="console"></div>
+<script type="text/javascript">
+<![CDATA[
+ description("This is a test of the simple SVGStringList API parts.");
+
+ var text1 = document.getElementById("text1");
+ shouldBe("text1.requiredFeatures.numberOfItems", "3");
+
+ debug("");
+ debug("Test uncommon arguments for initialize()");
+ shouldBeEqualToString("text1.requiredFeatures.initialize('30')", "30");
+ shouldBe("text1.requiredFeatures.numberOfItems", "1");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(0)", "30");
+ shouldBeEqualToString("text1.getAttribute('requiredFeatures')", "30");
+
+ shouldBeEqualToString("text1.requiredFeatures.initialize(text1)", "[object SVGTextElement]");
+ shouldBe("text1.requiredFeatures.numberOfItems", "1");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(0)", "[object SVGTextElement]");
+ shouldBeEqualToString("text1.getAttribute('requiredFeatures')", "[object SVGTextElement]");
+
+ shouldBeEqualToString("text1.requiredFeatures.initialize(0)", "0");
+ shouldBe("text1.requiredFeatures.numberOfItems", "1");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(0)", "0");
+ shouldBeEqualToString("text1.getAttribute('requiredFeatures')", "0");
+
+ shouldBeEqualToString("text1.requiredFeatures.initialize('aString')", "aString");
+ shouldBe("text1.requiredFeatures.numberOfItems", "1");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(0)", "aString");
+ shouldBeEqualToString("text1.getAttribute('requiredFeatures')", "aString");
+
+ debug("");
+ debug("Test uncommon arguments for getItem()");
+ shouldThrow("text1.requiredFeatures.getItem(30)");
+ shouldBe("text1.requiredFeatures.getItem('aString')", "text1.requiredFeatures.getItem(0)");
+ shouldBe("text1.requiredFeatures.getItem(text1)", "text1.requiredFeatures.getItem(0)");
+ shouldBe("text1.requiredFeatures.getItem(null)", "text1.requiredFeatures.getItem(0)");
+
+ debug("");
+ debug("Test uncommon arguments for insertItemBefore()");
+ shouldThrow("text1.requiredFeatures.insertItemBefore(30)");
+ shouldThrow("text1.requiredFeatures.insertItemBefore('aString')");
+ shouldThrow("text1.requiredFeatures.insertItemBefore(text1)");
+ shouldThrow("text1.requiredFeatures.insertItemBefore(null)");
+ shouldThrow("text1.requiredFeatures.insertItemBefore(text1.requiredFeatures.getItem(1), 'aString')");
+ shouldThrow("text1.requiredFeatures.insertItemBefore(text1.requiredFeatures.getItem(1), text1)");
+ shouldThrow("text1.requiredFeatures.insertItemBefore(text1.requiredFeatures.getItem(1), null)");
+ shouldThrow("text1.requiredFeatures.insertItemBefore(text1.requiredFeatures.getItem(1), 0)");
+
+ shouldBeEqualToString("text1.requiredFeatures.insertItemBefore(30, 0)", "30");
+ shouldBe("text1.requiredFeatures.numberOfItems", "2");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(0)", "30");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(1)", "aString");
+ shouldBeEqualToString("text1.getAttribute('requiredFeatures')", "30 aString");
+
+ shouldBeEqualToString("text1.requiredFeatures.insertItemBefore('aString', 0)", "aString");
+ shouldBe("text1.requiredFeatures.numberOfItems", "3");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(0)", "aString");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(1)", "30");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(2)", "aString");
+ shouldBeEqualToString("text1.getAttribute('requiredFeatures')", "aString 30 aString");
+
+ shouldBeEqualToString("text1.requiredFeatures.insertItemBefore(text1, 0)", "[object SVGTextElement]");
+ shouldBe("text1.requiredFeatures.numberOfItems", "4");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(0)", "[object SVGTextElement]");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(1)", "aString");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(2)", "30");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(3)", "aString");
+ shouldBeEqualToString("text1.getAttribute('requiredFeatures')", "[object SVGTextElement] aString 30 aString");
+
+ shouldBeEqualToString("text1.requiredFeatures.insertItemBefore(null, 0)", "null");
+ shouldBe("text1.requiredFeatures.numberOfItems", "5");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(0)", "null");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(1)", "[object SVGTextElement]");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(2)", "aString");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(3)", "30");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(4)", "aString");
+ shouldBeEqualToString("text1.getAttribute('requiredFeatures')", "null [object SVGTextElement] aString 30 aString");
+
+ debug("");
+ debug("Set requiredFeatures='1 2 3 4' for text1");
+ shouldBeUndefined("text1.setAttribute('requiredFeatures', '1 2 3 4')");
+ shouldBe("text1.requiredFeatures.numberOfItems", "4");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(0)", "1");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(1)", "2");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(2)", "3");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(3)", "4");
+ shouldBeEqualToString("text1.getAttribute('requiredFeatures')", "1 2 3 4");
+
+ debug("");
+ debug("Test uncommon arguments for replaceItem() - part 1");
+ shouldThrow("text1.requiredFeatures.replaceItem(30)");
+ shouldThrow("text1.requiredFeatures.replaceItem('aString')");
+ shouldThrow("text1.requiredFeatures.replaceItem(text1)");
+
+ shouldBeEqualToString("text1.requiredFeatures.replaceItem(null, 0)", "null");
+ shouldBe("text1.requiredFeatures.numberOfItems", "4");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(0)", "null");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(1)", "2");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(2)", "3");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(3)", "4");
+ shouldBeEqualToString("text1.getAttribute('requiredFeatures')", "null 2 3 4");
+
+ shouldBeEqualToString("text1.requiredFeatures.replaceItem('aString', 3)", "aString");
+ shouldBe("text1.requiredFeatures.numberOfItems", "4");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(0)", "null");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(1)", "2");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(2)", "3");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(3)", "aString");
+ shouldBeEqualToString("text1.getAttribute('requiredFeatures')", "null 2 3 aString");
+
+ shouldBeEqualToString("text1.requiredFeatures.replaceItem(text1, 2)", "[object SVGTextElement]");
+ shouldBe("text1.requiredFeatures.numberOfItems", "4");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(0)", "null");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(1)", "2");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(2)", "[object SVGTextElement]");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(3)", "aString");
+ shouldBeEqualToString("text1.getAttribute('requiredFeatures')", "null 2 [object SVGTextElement] aString");
+
+ shouldBeEqualToString("text1.requiredFeatures.replaceItem(1, 1)", "1");
+ shouldBe("text1.requiredFeatures.numberOfItems", "4");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(0)", "null");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(1)", "1");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(2)", "[object SVGTextElement]");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(3)", "aString");
+ shouldBeEqualToString("text1.getAttribute('requiredFeatures')", "null 1 [object SVGTextElement] aString");
+
+ debug("");
+ debug("Set requiredFeatures='1 2 3 4' for text1");
+ shouldBeUndefined("text1.setAttribute('requiredFeatures', '1 2 3 4')");
+ shouldBe("text1.requiredFeatures.numberOfItems", "4");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(0)", "1");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(1)", "2");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(2)", "3");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(3)", "4");
+ shouldBeEqualToString("text1.getAttribute('requiredFeatures')", "1 2 3 4");
+
+ debug("");
+ debug("Test uncommon arguments for replaceItem() - part 2");
+ shouldBeEqualToString("text1.requiredFeatures.replaceItem(text1.requiredFeatures.getItem(0), 0)", "1");
+ shouldBe("text1.requiredFeatures.numberOfItems", "4");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(0)", "1");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(1)", "2");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(2)", "3");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(3)", "4");
+ shouldBeEqualToString("text1.getAttribute('requiredFeatures')", "1 2 3 4");
+
+ shouldBeEqualToString("text1.requiredFeatures.replaceItem(text1.requiredFeatures.getItem(0), 'aString')", "1");
+ shouldBe("text1.requiredFeatures.numberOfItems", "4");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(0)", "1");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(1)", "2");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(2)", "3");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(3)", "4");
+ shouldBeEqualToString("text1.getAttribute('requiredFeatures')", "1 2 3 4");
+
+ shouldBeEqualToString("text1.requiredFeatures.replaceItem(text1.requiredFeatures.getItem(0), text1)", "1");
+ shouldBe("text1.requiredFeatures.numberOfItems", "4");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(0)", "1");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(1)", "2");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(2)", "3");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(3)", "4");
+ shouldBeEqualToString("text1.getAttribute('requiredFeatures')", "1 2 3 4");
+
+ shouldBeEqualToString("text1.requiredFeatures.replaceItem(text1.requiredFeatures.getItem(0), null)", "1");
+ shouldBe("text1.requiredFeatures.numberOfItems", "4");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(0)", "1");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(1)", "2");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(2)", "3");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(3)", "4");
+ shouldBeEqualToString("text1.getAttribute('requiredFeatures')", "1 2 3 4");
+
+ debug("");
+ debug("Test uncommon arguments for removeItem()");
+ shouldThrow("text1.requiredFeatures.removeItem(30)");
+
+ shouldBeEqualToString("text1.requiredFeatures.removeItem('aString')", "1");
+ shouldBe("text1.requiredFeatures.numberOfItems", "3");
+ shouldBeEqualToString("text1.getAttribute('requiredFeatures')", "2 3 4");
+
+ shouldBeEqualToString("text1.requiredFeatures.removeItem(text1)", "2");
+ shouldBe("text1.requiredFeatures.numberOfItems", "2");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(0)", "3");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(1)", "4");
+ shouldBeEqualToString("text1.getAttribute('requiredFeatures')", "3 4");
+
+ shouldBeEqualToString("text1.requiredFeatures.removeItem(null)", "3");
+ shouldBe("text1.requiredFeatures.numberOfItems", "1");
+ shouldBeEqualToString("text1.getAttribute('requiredFeatures')", "4");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(0)", "4");
+
+ debug("");
+ debug("Test uncommon arguments for appendItem()");
+ shouldBeEqualToString("text1.requiredFeatures.appendItem(30)", "30");
+ shouldBe("text1.requiredFeatures.numberOfItems", "2");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(0)", "4");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(1)", "30");
+ shouldBeEqualToString("text1.getAttribute('requiredFeatures')", "4 30");
+
+ shouldBeEqualToString("text1.requiredFeatures.appendItem('aString')", "aString");
+ shouldBe("text1.requiredFeatures.numberOfItems", "3");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(0)", "4");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(1)", "30");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(2)", "aString");
+ shouldBeEqualToString("text1.getAttribute('requiredFeatures')", "4 30 aString");
+
+ shouldBeEqualToString("text1.requiredFeatures.appendItem(text1)", "[object SVGTextElement]");
+ shouldBe("text1.requiredFeatures.numberOfItems", "4");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(0)", "4");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(1)", "30");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(2)", "aString");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(3)", "[object SVGTextElement]");
+ shouldBeEqualToString("text1.getAttribute('requiredFeatures')", "4 30 aString [object SVGTextElement]");
+
+ shouldBeEqualToString("text1.requiredFeatures.appendItem(null)", "null");
+ shouldBe("text1.requiredFeatures.numberOfItems", "5");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(0)", "4");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(1)", "30");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(2)", "aString");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(3)", "[object SVGTextElement]");
+ shouldBeEqualToString("text1.requiredFeatures.getItem(4)", "null");
+ shouldBeEqualToString("text1.getAttribute('requiredFeatures')", "4 30 aString [object SVGTextElement] null");
+
+ debug("");
+ debug("clear() requiredFeatures list so text on top shows up");
+ shouldBeUndefined("text1.requiredFeatures.clear()");
+
+ successfullyParsed = true;
+]]>
+</script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/svg/dom/SVGTransformList-basics-expected.txt b/LayoutTests/svg/dom/SVGTransformList-basics-expected.txt
new file mode 100644
index 0000000..abd1462
--- /dev/null
+++ b/LayoutTests/svg/dom/SVGTransformList-basics-expected.txt
@@ -0,0 +1,132 @@
+This is a test of the simple SVGTransformList API parts.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS circle1.transform.baseVal != circle1.transform.animVal is true
+PASS circle1.transform.baseVal.numberOfItems is 2
+PASS circle1.transform.animVal.numberOfItems is 2
+PASS dumpTransform(circle1.transform.baseVal.getItem(0)) is "type=SVG_TRANSFORM_SCALE matrix=[2.0 0.0 0.0 2.0 0.0 0.0]"
+PASS dumpTransform(circle1.transform.baseVal.getItem(1)) is "type=SVG_TRANSFORM_TRANSLATE matrix=[1.0 0.0 0.0 1.0 10.0 10.0]"
+
+Test uncommon arguments for initialize()
+PASS circle1.transform.baseVal.initialize(30) threw exception TypeError: Type error.
+PASS circle1.transform.baseVal.initialize('aString') threw exception TypeError: Type error.
+PASS circle1.transform.baseVal.initialize(circle1) threw exception TypeError: Type error.
+PASS circle1.transform.baseVal.initialize(null) threw exception Error: SVG_WRONG_TYPE_ERR: DOM SVG Exception 0.
+
+Test uncommon arguments for getItem()
+PASS circle1.transform.baseVal.getItem(30) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
+PASS circle1.transform.baseVal.getItem('aString') is circle1.transform.baseVal.getItem(0)
+PASS circle1.transform.baseVal.getItem(circle1) is circle1.transform.baseVal.getItem(0)
+PASS circle1.transform.baseVal.getItem(null) is circle1.transform.baseVal.getItem(0)
+
+Test uncommon arguments for insertItemBefore()
+PASS circle1.transform.baseVal.insertItemBefore(30) threw exception SyntaxError: Not enough arguments.
+PASS circle1.transform.baseVal.insertItemBefore('aString') threw exception SyntaxError: Not enough arguments.
+PASS circle1.transform.baseVal.insertItemBefore(circle1) threw exception SyntaxError: Not enough arguments.
+PASS circle1.transform.baseVal.insertItemBefore(null) threw exception SyntaxError: Not enough arguments.
+PASS circle1.transform.baseVal.insertItemBefore(circle1.transform.baseVal.getItem(1), 'aString') is circle1.transform.baseVal.getItem(0)
+PASS circle1.transform.baseVal.numberOfItems is 2
+PASS dumpTransform(circle1.transform.baseVal.getItem(0)) is "type=SVG_TRANSFORM_TRANSLATE matrix=[1.0 0.0 0.0 1.0 10.0 10.0]"
+PASS dumpTransform(circle1.transform.baseVal.getItem(1)) is "type=SVG_TRANSFORM_SCALE matrix=[2.0 0.0 0.0 2.0 0.0 0.0]"
+PASS circle1.getAttribute('transform') is "translate(10 10) scale(2 2)"
+PASS circle1.transform.baseVal.insertItemBefore(circle1.transform.baseVal.getItem(1), circle1) is circle1.transform.baseVal.getItem(0)
+PASS circle1.transform.baseVal.numberOfItems is 2
+PASS dumpTransform(circle1.transform.baseVal.getItem(0)) is "type=SVG_TRANSFORM_SCALE matrix=[2.0 0.0 0.0 2.0 0.0 0.0]"
+PASS dumpTransform(circle1.transform.baseVal.getItem(1)) is "type=SVG_TRANSFORM_TRANSLATE matrix=[1.0 0.0 0.0 1.0 10.0 10.0]"
+PASS circle1.getAttribute('transform') is "scale(2 2) translate(10 10)"
+PASS circle1.transform.baseVal.insertItemBefore(circle1.transform.baseVal.getItem(1), null) is circle1.transform.baseVal.getItem(0)
+PASS circle1.transform.baseVal.numberOfItems is 2
+PASS dumpTransform(circle1.transform.baseVal.getItem(0)) is "type=SVG_TRANSFORM_TRANSLATE matrix=[1.0 0.0 0.0 1.0 10.0 10.0]"
+PASS dumpTransform(circle1.transform.baseVal.getItem(1)) is "type=SVG_TRANSFORM_SCALE matrix=[2.0 0.0 0.0 2.0 0.0 0.0]"
+PASS circle1.getAttribute('transform') is "translate(10 10) scale(2 2)"
+PASS circle1.transform.baseVal.insertItemBefore(circle1.transform.baseVal.getItem(1), 0) is circle1.transform.baseVal.getItem(0)
+PASS circle1.transform.baseVal.numberOfItems is 2
+PASS dumpTransform(circle1.transform.baseVal.getItem(0)) is "type=SVG_TRANSFORM_SCALE matrix=[2.0 0.0 0.0 2.0 0.0 0.0]"
+PASS dumpTransform(circle1.transform.baseVal.getItem(1)) is "type=SVG_TRANSFORM_TRANSLATE matrix=[1.0 0.0 0.0 1.0 10.0 10.0]"
+PASS circle1.getAttribute('transform') is "scale(2 2) translate(10 10)"
+PASS circle1.transform.baseVal.insertItemBefore(30, 0) threw exception TypeError: Type error.
+PASS circle1.transform.baseVal.insertItemBefore('aString', 0) threw exception TypeError: Type error.
+PASS circle1.transform.baseVal.insertItemBefore(circle1, 0) threw exception TypeError: Type error.
+PASS circle1.transform.baseVal.insertItemBefore(null, 0) threw exception Error: SVG_WRONG_TYPE_ERR: DOM SVG Exception 0.
+
+Set transform='rotate(90) scale(2 2) translate(10 10) skewX(45)' for circle1
+PASS circle1.setAttribute('transform', 'rotate(90) scale(2 2) translate(10 10) skewX(45)') is undefined.
+PASS circle1.transform.baseVal.numberOfItems is 4
+PASS dumpTransform(circle1.transform.baseVal.getItem(0)) is "type=SVG_TRANSFORM_ROTATE matrix=[0.0 1.0 -1.0 0.0 0.0 0.0]"
+PASS dumpTransform(circle1.transform.baseVal.getItem(1)) is "type=SVG_TRANSFORM_SCALE matrix=[2.0 0.0 0.0 2.0 0.0 0.0]"
+PASS dumpTransform(circle1.transform.baseVal.getItem(2)) is "type=SVG_TRANSFORM_TRANSLATE matrix=[1.0 0.0 0.0 1.0 10.0 10.0]"
+PASS dumpTransform(circle1.transform.baseVal.getItem(3)) is "type=SVG_TRANSFORM_SKEWX matrix=[1.0 0.0 1.0 1.0 0.0 0.0]"
+PASS circle1.getAttribute('transform') is "rotate(90) scale(2 2) translate(10 10) skewX(45)"
+
+Test uncommon arguments for replaceItem()
+PASS circle1.transform.baseVal.replaceItem(30) threw exception SyntaxError: Not enough arguments.
+PASS circle1.transform.baseVal.replaceItem('aString') threw exception SyntaxError: Not enough arguments.
+PASS circle1.transform.baseVal.replaceItem(circle1) threw exception SyntaxError: Not enough arguments.
+PASS circle1.transform.baseVal.replaceItem(null) threw exception SyntaxError: Not enough arguments.
+PASS circle1.transform.baseVal.replaceItem(30, 0) threw exception TypeError: Type error.
+PASS circle1.transform.baseVal.replaceItem('aString', 0) threw exception TypeError: Type error.
+PASS circle1.transform.baseVal.replaceItem(circle1, 0) threw exception TypeError: Type error.
+PASS circle1.transform.baseVal.replaceItem(null, 0) threw exception Error: SVG_WRONG_TYPE_ERR: DOM SVG Exception 0.
+PASS circle1.transform.baseVal.replaceItem(circle1.transform.baseVal.getItem(0), 0) is circle1.transform.baseVal.getItem(0)
+PASS circle1.transform.baseVal.numberOfItems is 3
+PASS dumpTransform(circle1.transform.baseVal.getItem(0)) is "type=SVG_TRANSFORM_ROTATE matrix=[0.0 1.0 -1.0 0.0 0.0 0.0]"
+PASS dumpTransform(circle1.transform.baseVal.getItem(1)) is "type=SVG_TRANSFORM_TRANSLATE matrix=[1.0 0.0 0.0 1.0 10.0 10.0]"
+PASS dumpTransform(circle1.transform.baseVal.getItem(2)) is "type=SVG_TRANSFORM_SKEWX matrix=[1.0 0.0 1.0 1.0 0.0 0.0]"
+PASS circle1.getAttribute('transform') is "rotate(90) translate(10 10) skewX(45)"
+PASS circle1.transform.baseVal.replaceItem(circle1.transform.baseVal.getItem(0), 'aString') is circle1.transform.baseVal.getItem(0)
+PASS circle1.transform.baseVal.numberOfItems is 2
+PASS dumpTransform(circle1.transform.baseVal.getItem(0)) is "type=SVG_TRANSFORM_ROTATE matrix=[0.0 1.0 -1.0 0.0 0.0 0.0]"
+PASS dumpTransform(circle1.transform.baseVal.getItem(1)) is "type=SVG_TRANSFORM_SKEWX matrix=[1.0 0.0 1.0 1.0 0.0 0.0]"
+PASS circle1.getAttribute('transform') is "rotate(90) skewX(45)"
+PASS circle1.transform.baseVal.replaceItem(circle1.transform.baseVal.getItem(0), circle1) is circle1.transform.baseVal.getItem(0)
+PASS circle1.transform.baseVal.numberOfItems is 1
+PASS dumpTransform(circle1.transform.baseVal.getItem(0)) is "type=SVG_TRANSFORM_ROTATE matrix=[0.0 1.0 -1.0 0.0 0.0 0.0]"
+PASS circle1.getAttribute('transform') is "rotate(90)"
+PASS circle1.transform.baseVal.replaceItem(circle1.transform.baseVal.getItem(0), null) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
+PASS circle1.transform.baseVal.numberOfItems is 0
+PASS circle1.getAttribute('transform') is ""
+
+Set transform='rotate(90) scale(2 2) translate(10 10) skewX(45)' for circle1
+PASS circle1.setAttribute('transform', 'rotate(90) scale(2 2) translate(10 10) skewX(45)') is undefined.
+
+Test uncommon arguments for removeItem()
+PASS circle1.transform.baseVal.removeItem(30) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
+PASS dumpTransform(circle1.transform.baseVal.removeItem(0)) is "type=SVG_TRANSFORM_ROTATE matrix=[0.0 1.0 -1.0 0.0 0.0 0.0]"
+PASS circle1.transform.baseVal.numberOfItems is 3
+PASS dumpTransform(circle1.transform.baseVal.getItem(0)) is "type=SVG_TRANSFORM_SCALE matrix=[2.0 0.0 0.0 2.0 0.0 0.0]"
+PASS dumpTransform(circle1.transform.baseVal.getItem(1)) is "type=SVG_TRANSFORM_TRANSLATE matrix=[1.0 0.0 0.0 1.0 10.0 10.0]"
+PASS dumpTransform(circle1.transform.baseVal.getItem(2)) is "type=SVG_TRANSFORM_SKEWX matrix=[1.0 0.0 1.0 1.0 0.0 0.0]"
+PASS circle1.getAttribute('transform') is "scale(2 2) translate(10 10) skewX(45)"
+PASS dumpTransform(circle1.transform.baseVal.removeItem('aString')) is "type=SVG_TRANSFORM_SCALE matrix=[2.0 0.0 0.0 2.0 0.0 0.0]"
+PASS circle1.transform.baseVal.numberOfItems is 2
+PASS dumpTransform(circle1.transform.baseVal.getItem(0)) is "type=SVG_TRANSFORM_TRANSLATE matrix=[1.0 0.0 0.0 1.0 10.0 10.0]"
+PASS dumpTransform(circle1.transform.baseVal.getItem(1)) is "type=SVG_TRANSFORM_SKEWX matrix=[1.0 0.0 1.0 1.0 0.0 0.0]"
+PASS circle1.getAttribute('transform') is "translate(10 10) skewX(45)"
+PASS dumpTransform(circle1.transform.baseVal.removeItem(circle1)) is "type=SVG_TRANSFORM_TRANSLATE matrix=[1.0 0.0 0.0 1.0 10.0 10.0]"
+PASS circle1.transform.baseVal.numberOfItems is 1
+PASS dumpTransform(circle1.transform.baseVal.getItem(0)) is "type=SVG_TRANSFORM_SKEWX matrix=[1.0 0.0 1.0 1.0 0.0 0.0]"
+PASS circle1.getAttribute('transform') is "skewX(45)"
+
+Test uncommon arguments for appendItem()
+PASS circle1.transform.baseVal.appendItem(30) threw exception TypeError: Type error.
+PASS circle1.transform.baseVal.appendItem('aString') threw exception TypeError: Type error.
+PASS circle1.transform.baseVal.appendItem(circle1) threw exception TypeError: Type error.
+PASS circle1.transform.baseVal.appendItem(null) threw exception Error: SVG_WRONG_TYPE_ERR: DOM SVG Exception 0.
+
+Testing animVal clear throws
+PASS circle1.transform.animVal.clear() threw exception Error: NO_MODIFICATION_ALLOWED_ERR: DOM Exception 7.
+PASS circle1.transform.baseVal.clear() is undefined.
+
+Creating new SVGTransform, with 45 deg rotation about x=50, y=100 and append it to the transform list
+PASS dumpTransform(transform = svg.createSVGTransform()) is "type=SVG_TRANSFORM_MATRIX matrix=[1.0 0.0 0.0 1.0 0.0 0.0]"
+PASS transform.setRotate(45, 50, 100) is undefined.
+PASS dumpTransform(circle1.transform.baseVal.appendItem(transform)) is "type=SVG_TRANSFORM_ROTATE matrix=[0.7 0.7 -0.7 0.7 85.4 -6.1]"
+PASS circle1.transform.baseVal.numberOfItems is 1
+PASS dumpTransform(circle1.transform.baseVal.getItem(0)) is "type=SVG_TRANSFORM_ROTATE matrix=[0.7 0.7 -0.7 0.7 85.4 -6.1]"
+PASS circle1.getAttribute('transform') is "rotate(45 50 100)"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/svg/dom/SVGTransformList-basics.xhtml b/LayoutTests/svg/dom/SVGTransformList-basics.xhtml
new file mode 100644
index 0000000..b9277be
--- /dev/null
+++ b/LayoutTests/svg/dom/SVGTransformList-basics.xhtml
@@ -0,0 +1,200 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css"/>
+<script>window.enablePixelTesting = true;</script>
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<svg id="svg" xmlns="http://www.w3.org/2000/svg" width="200" height="200">
+ <circle id="circle1" cx="40" cy="40" r="40" fill="green" transform="scale(2, 2) translate(10 10)"/>
+</svg>
+
+<p id="description"></p>
+<div id="console"></div>
+<script type="text/javascript">
+<![CDATA[
+ description("This is a test of the simple SVGTransformList API parts.");
+
+ function dumpMatrix(matrix) {
+ return "[" + matrix.a.toFixed(1)
+ + " " + matrix.b.toFixed(1)
+ + " " + matrix.c.toFixed(1)
+ + " " + matrix.d.toFixed(1)
+ + " " + matrix.e.toFixed(1)
+ + " " + matrix.f.toFixed(1)
+ + "]";
+ }
+
+ function dumpTransform(transform) {
+ var transformTypes = {
+ "0": "SVG_TRANSFORM_UNKNOWN",
+ "1": "SVG_TRANSFORM_MATRIX",
+ "2": "SVG_TRANSFORM_TRANSLATE",
+ "3": "SVG_TRANSFORM_SCALE",
+ "4": "SVG_TRANSFORM_ROTATE",
+ "5": "SVG_TRANSFORM_SKEWX",
+ "6": "SVG_TRANSFORM_SKEWY"
+ };
+
+ return "type=" + transformTypes[transform.type] + " matrix=" + dumpMatrix(transform.matrix);
+ }
+
+ var svg = document.getElementById("svg");
+ var circle1 = document.getElementById("circle1");
+
+ // Spec: The object referenced by animVal will always be distinct from the one referenced by baseVal, even when the attribute is not animated.
+ shouldBeTrue("circle1.transform.baseVal != circle1.transform.animVal");
+
+ shouldBe("circle1.transform.baseVal.numberOfItems", "2");
+ shouldBe("circle1.transform.animVal.numberOfItems", "2");
+ shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(0))", "type=SVG_TRANSFORM_SCALE matrix=[2.0 0.0 0.0 2.0 0.0 0.0]");
+ shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(1))", "type=SVG_TRANSFORM_TRANSLATE matrix=[1.0 0.0 0.0 1.0 10.0 10.0]");
+
+ debug("");
+ debug("Test uncommon arguments for initialize()");
+ shouldThrow("circle1.transform.baseVal.initialize(30)");
+ shouldThrow("circle1.transform.baseVal.initialize('aString')");
+ shouldThrow("circle1.transform.baseVal.initialize(circle1)");
+ shouldThrow("circle1.transform.baseVal.initialize(null)");
+
+ debug("");
+ debug("Test uncommon arguments for getItem()");
+ shouldThrow("circle1.transform.baseVal.getItem(30)");
+ shouldBe("circle1.transform.baseVal.getItem('aString')", "circle1.transform.baseVal.getItem(0)");
+ shouldBe("circle1.transform.baseVal.getItem(circle1)", "circle1.transform.baseVal.getItem(0)");
+ shouldBe("circle1.transform.baseVal.getItem(null)", "circle1.transform.baseVal.getItem(0)");
+
+ debug("");
+ debug("Test uncommon arguments for insertItemBefore()");
+ shouldThrow("circle1.transform.baseVal.insertItemBefore(30)");
+ shouldThrow("circle1.transform.baseVal.insertItemBefore('aString')");
+ shouldThrow("circle1.transform.baseVal.insertItemBefore(circle1)");
+ shouldThrow("circle1.transform.baseVal.insertItemBefore(null)");
+
+ shouldBe("circle1.transform.baseVal.insertItemBefore(circle1.transform.baseVal.getItem(1), 'aString')", "circle1.transform.baseVal.getItem(0)");
+ shouldBe("circle1.transform.baseVal.numberOfItems", "2");
+ shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(0))", "type=SVG_TRANSFORM_TRANSLATE matrix=[1.0 0.0 0.0 1.0 10.0 10.0]");
+ shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(1))", "type=SVG_TRANSFORM_SCALE matrix=[2.0 0.0 0.0 2.0 0.0 0.0]");
+ shouldBeEqualToString("circle1.getAttribute('transform')", "translate(10 10) scale(2 2)");
+
+ shouldBe("circle1.transform.baseVal.insertItemBefore(circle1.transform.baseVal.getItem(1), circle1)", "circle1.transform.baseVal.getItem(0)");
+ shouldBe("circle1.transform.baseVal.numberOfItems", "2");
+ shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(0))", "type=SVG_TRANSFORM_SCALE matrix=[2.0 0.0 0.0 2.0 0.0 0.0]");
+ shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(1))", "type=SVG_TRANSFORM_TRANSLATE matrix=[1.0 0.0 0.0 1.0 10.0 10.0]");
+ shouldBeEqualToString("circle1.getAttribute('transform')", "scale(2 2) translate(10 10)");
+
+ shouldBe("circle1.transform.baseVal.insertItemBefore(circle1.transform.baseVal.getItem(1), null)", "circle1.transform.baseVal.getItem(0)");
+ shouldBe("circle1.transform.baseVal.numberOfItems", "2");
+ shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(0))", "type=SVG_TRANSFORM_TRANSLATE matrix=[1.0 0.0 0.0 1.0 10.0 10.0]");
+ shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(1))", "type=SVG_TRANSFORM_SCALE matrix=[2.0 0.0 0.0 2.0 0.0 0.0]");
+ shouldBeEqualToString("circle1.getAttribute('transform')", "translate(10 10) scale(2 2)");
+
+ shouldBe("circle1.transform.baseVal.insertItemBefore(circle1.transform.baseVal.getItem(1), 0)", "circle1.transform.baseVal.getItem(0)");
+ shouldBe("circle1.transform.baseVal.numberOfItems", "2");
+ shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(0))", "type=SVG_TRANSFORM_SCALE matrix=[2.0 0.0 0.0 2.0 0.0 0.0]");
+ shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(1))", "type=SVG_TRANSFORM_TRANSLATE matrix=[1.0 0.0 0.0 1.0 10.0 10.0]");
+ shouldBeEqualToString("circle1.getAttribute('transform')", "scale(2 2) translate(10 10)");
+
+ shouldThrow("circle1.transform.baseVal.insertItemBefore(30, 0)");
+ shouldThrow("circle1.transform.baseVal.insertItemBefore('aString', 0)");
+ shouldThrow("circle1.transform.baseVal.insertItemBefore(circle1, 0)");
+ shouldThrow("circle1.transform.baseVal.insertItemBefore(null, 0)");
+
+ debug("");
+ debug("Set transform='rotate(90) scale(2 2) translate(10 10) skewX(45)' for circle1");
+ shouldBeUndefined("circle1.setAttribute('transform', 'rotate(90) scale(2 2) translate(10 10) skewX(45)')");
+ shouldBe("circle1.transform.baseVal.numberOfItems", "4");
+ shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(0))", "type=SVG_TRANSFORM_ROTATE matrix=[0.0 1.0 -1.0 0.0 0.0 0.0]");
+ shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(1))", "type=SVG_TRANSFORM_SCALE matrix=[2.0 0.0 0.0 2.0 0.0 0.0]");
+ shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(2))", "type=SVG_TRANSFORM_TRANSLATE matrix=[1.0 0.0 0.0 1.0 10.0 10.0]");
+ shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(3))", "type=SVG_TRANSFORM_SKEWX matrix=[1.0 0.0 1.0 1.0 0.0 0.0]");
+ shouldBeEqualToString("circle1.getAttribute('transform')", "rotate(90) scale(2 2) translate(10 10) skewX(45)");
+
+ debug("");
+ debug("Test uncommon arguments for replaceItem()");
+ shouldThrow("circle1.transform.baseVal.replaceItem(30)");
+ shouldThrow("circle1.transform.baseVal.replaceItem('aString')");
+ shouldThrow("circle1.transform.baseVal.replaceItem(circle1)");
+ shouldThrow("circle1.transform.baseVal.replaceItem(null)");
+ shouldThrow("circle1.transform.baseVal.replaceItem(30, 0)");
+ shouldThrow("circle1.transform.baseVal.replaceItem('aString', 0)");
+ shouldThrow("circle1.transform.baseVal.replaceItem(circle1, 0)");
+ shouldThrow("circle1.transform.baseVal.replaceItem(null, 0)");
+
+ shouldBe("circle1.transform.baseVal.replaceItem(circle1.transform.baseVal.getItem(0), 0)", "circle1.transform.baseVal.getItem(0)");
+ shouldBe("circle1.transform.baseVal.numberOfItems", "3");
+ shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(0))", "type=SVG_TRANSFORM_ROTATE matrix=[0.0 1.0 -1.0 0.0 0.0 0.0]");
+ shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(1))", "type=SVG_TRANSFORM_TRANSLATE matrix=[1.0 0.0 0.0 1.0 10.0 10.0]");
+ shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(2))", "type=SVG_TRANSFORM_SKEWX matrix=[1.0 0.0 1.0 1.0 0.0 0.0]");
+ shouldBeEqualToString("circle1.getAttribute('transform')", "rotate(90) translate(10 10) skewX(45)");
+
+ shouldBe("circle1.transform.baseVal.replaceItem(circle1.transform.baseVal.getItem(0), 'aString')", "circle1.transform.baseVal.getItem(0)");
+ shouldBe("circle1.transform.baseVal.numberOfItems", "2");
+ shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(0))", "type=SVG_TRANSFORM_ROTATE matrix=[0.0 1.0 -1.0 0.0 0.0 0.0]");
+ shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(1))", "type=SVG_TRANSFORM_SKEWX matrix=[1.0 0.0 1.0 1.0 0.0 0.0]");
+ shouldBeEqualToString("circle1.getAttribute('transform')", "rotate(90) skewX(45)");
+
+ shouldBe("circle1.transform.baseVal.replaceItem(circle1.transform.baseVal.getItem(0), circle1)", "circle1.transform.baseVal.getItem(0)");
+ shouldBe("circle1.transform.baseVal.numberOfItems", "1");
+ shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(0))", "type=SVG_TRANSFORM_ROTATE matrix=[0.0 1.0 -1.0 0.0 0.0 0.0]");
+ shouldBeEqualToString("circle1.getAttribute('transform')", "rotate(90)");
+
+ shouldThrow("circle1.transform.baseVal.replaceItem(circle1.transform.baseVal.getItem(0), null)");
+ shouldBe("circle1.transform.baseVal.numberOfItems", "0");
+ shouldBeEqualToString("circle1.getAttribute('transform')", "");
+
+ debug("");
+ debug("Set transform='rotate(90) scale(2 2) translate(10 10) skewX(45)' for circle1");
+ shouldBeUndefined("circle1.setAttribute('transform', 'rotate(90) scale(2 2) translate(10 10) skewX(45)')");
+
+ debug("");
+ debug("Test uncommon arguments for removeItem()");
+ shouldThrow("circle1.transform.baseVal.removeItem(30)");
+
+ shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.removeItem(0))", "type=SVG_TRANSFORM_ROTATE matrix=[0.0 1.0 -1.0 0.0 0.0 0.0]");
+ shouldBe("circle1.transform.baseVal.numberOfItems", "3");
+ shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(0))", "type=SVG_TRANSFORM_SCALE matrix=[2.0 0.0 0.0 2.0 0.0 0.0]");
+ shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(1))", "type=SVG_TRANSFORM_TRANSLATE matrix=[1.0 0.0 0.0 1.0 10.0 10.0]");
+ shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(2))", "type=SVG_TRANSFORM_SKEWX matrix=[1.0 0.0 1.0 1.0 0.0 0.0]");
+ shouldBeEqualToString("circle1.getAttribute('transform')", "scale(2 2) translate(10 10) skewX(45)");
+
+ shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.removeItem('aString'))", "type=SVG_TRANSFORM_SCALE matrix=[2.0 0.0 0.0 2.0 0.0 0.0]");
+ shouldBe("circle1.transform.baseVal.numberOfItems", "2");
+ shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(0))", "type=SVG_TRANSFORM_TRANSLATE matrix=[1.0 0.0 0.0 1.0 10.0 10.0]");
+ shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(1))", "type=SVG_TRANSFORM_SKEWX matrix=[1.0 0.0 1.0 1.0 0.0 0.0]");
+ shouldBeEqualToString("circle1.getAttribute('transform')", "translate(10 10) skewX(45)");
+
+ shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.removeItem(circle1))", "type=SVG_TRANSFORM_TRANSLATE matrix=[1.0 0.0 0.0 1.0 10.0 10.0]");
+ shouldBe("circle1.transform.baseVal.numberOfItems", "1");
+ shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(0))", "type=SVG_TRANSFORM_SKEWX matrix=[1.0 0.0 1.0 1.0 0.0 0.0]");
+ shouldBeEqualToString("circle1.getAttribute('transform')", "skewX(45)");
+
+ debug("");
+ debug("Test uncommon arguments for appendItem()");
+ shouldThrow("circle1.transform.baseVal.appendItem(30)");
+ shouldThrow("circle1.transform.baseVal.appendItem('aString')");
+ shouldThrow("circle1.transform.baseVal.appendItem(circle1)");
+ shouldThrow("circle1.transform.baseVal.appendItem(null)");
+
+ debug("");
+ debug("Testing animVal clear throws");
+ shouldThrow("circle1.transform.animVal.clear()");
+ shouldBeUndefined("circle1.transform.baseVal.clear()");
+
+ debug("");
+ debug("Creating new SVGTransform, with 45 deg rotation about x=50, y=100 and append it to the transform list");
+ var transform;
+ shouldBeEqualToString("dumpTransform(transform = svg.createSVGTransform())", "type=SVG_TRANSFORM_MATRIX matrix=[1.0 0.0 0.0 1.0 0.0 0.0]");
+ shouldBeUndefined("transform.setRotate(45, 50, 100)");
+
+ shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.appendItem(transform))", "type=SVG_TRANSFORM_ROTATE matrix=[0.7 0.7 -0.7 0.7 85.4 -6.1]");
+ shouldBe("circle1.transform.baseVal.numberOfItems", "1");
+ shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(0))", "type=SVG_TRANSFORM_ROTATE matrix=[0.7 0.7 -0.7 0.7 85.4 -6.1]");
+ shouldBeEqualToString("circle1.getAttribute('transform')", "rotate(45 50 100)");
+
+ successfullyParsed = true;
+]]>
+</script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/svg/dom/svglist-exception-on-out-bounds-error-expected.txt b/LayoutTests/svg/dom/svglist-exception-on-out-bounds-error-expected.txt
index dda168c..23bc00c 100644
--- a/LayoutTests/svg/dom/svglist-exception-on-out-bounds-error-expected.txt
+++ b/LayoutTests/svg/dom/svglist-exception-on-out-bounds-error-expected.txt
@@ -4,40 +4,40 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
PASS svgList.getItem(index) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
-PASS svgList.insertItemBefore(null, index) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
+PASS svgList.insertItemBefore(null, index) threw exception Error: SVG_WRONG_TYPE_ERR: DOM SVG Exception 0.
PASS svgList.insertItemBefore(seg, index) is seg
PASS svgList.replaceItem(seg, index) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
-PASS svgList.replaceItem(null, index) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
+PASS svgList.replaceItem(null, index) threw exception Error: SVG_WRONG_TYPE_ERR: DOM SVG Exception 0.
PASS svgList.removeItem(index) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
PASS svgList.getItem(index) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
-PASS svgList.insertItemBefore(null, index) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
+PASS svgList.insertItemBefore(null, index) threw exception Error: SVG_WRONG_TYPE_ERR: DOM SVG Exception 0.
PASS svgList.insertItemBefore(seg, index) is seg
PASS svgList.replaceItem(seg, index) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
-PASS svgList.replaceItem(null, index) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
+PASS svgList.replaceItem(null, index) threw exception Error: SVG_WRONG_TYPE_ERR: DOM SVG Exception 0.
PASS svgList.removeItem(index) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
PASS svgList.getItem(index) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
-PASS svgList.insertItemBefore(null, index) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
+PASS svgList.insertItemBefore(null, index) threw exception Error: SVG_WRONG_TYPE_ERR: DOM SVG Exception 0.
PASS svgList.insertItemBefore(seg, index) is seg
PASS svgList.replaceItem(seg, index) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
-PASS svgList.replaceItem(null, index) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
+PASS svgList.replaceItem(null, index) threw exception Error: SVG_WRONG_TYPE_ERR: DOM SVG Exception 0.
PASS svgList.removeItem(index) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
PASS svgList.getItem(index) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
-PASS svgList.insertItemBefore(null, index) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
+PASS svgList.insertItemBefore(null, index) threw exception Error: SVG_WRONG_TYPE_ERR: DOM SVG Exception 0.
PASS svgList.insertItemBefore(seg, index) is seg
PASS svgList.replaceItem(seg, index) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
-PASS svgList.replaceItem(null, index) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
+PASS svgList.replaceItem(null, index) threw exception Error: SVG_WRONG_TYPE_ERR: DOM SVG Exception 0.
PASS svgList.removeItem(index) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
PASS svgList.getItem(index) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
-PASS svgList.insertItemBefore(null, index) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
+PASS svgList.insertItemBefore(null, index) threw exception Error: SVG_WRONG_TYPE_ERR: DOM SVG Exception 0.
PASS svgList.insertItemBefore(seg, index) is seg
PASS svgList.replaceItem(seg, index) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
-PASS svgList.replaceItem(null, index) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
+PASS svgList.replaceItem(null, index) threw exception Error: SVG_WRONG_TYPE_ERR: DOM SVG Exception 0.
PASS svgList.removeItem(index) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
PASS svgList.getItem(index) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
-PASS svgList.insertItemBefore(null, index) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
+PASS svgList.insertItemBefore(null, index) threw exception Error: SVG_WRONG_TYPE_ERR: DOM SVG Exception 0.
PASS svgList.insertItemBefore(seg, index) is seg
PASS svgList.replaceItem(seg, index) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
-PASS svgList.replaceItem(null, index) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
+PASS svgList.replaceItem(null, index) threw exception Error: SVG_WRONG_TYPE_ERR: DOM SVG Exception 0.
PASS svgList.removeItem(index) threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
PASS successfullyParsed is true
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 8619f2c..c3b57a2 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,127 @@
+2010-11-22 Nikolas Zimmermann <nzimmermann at 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):
+
2010-11-22 Yuzo Fujishima <yuzo at google.com>
Reviewed by Dan Bernstein.
diff --git a/WebCore/bindings/js/JSSVGLengthCustom.cpp b/WebCore/bindings/js/JSSVGLengthCustom.cpp
index 9a9138c..5b668c4 100644
--- a/WebCore/bindings/js/JSSVGLengthCustom.cpp
+++ b/WebCore/bindings/js/JSSVGLengthCustom.cpp
@@ -45,6 +45,11 @@ JSValue JSSVGLength::value(ExecState* exec) const
void JSSVGLength::setValue(ExecState* exec, JSValue value)
{
+ if (impl()->role() == AnimValRole) {
+ setDOMException(exec, NO_MODIFICATION_ALLOWED_ERR);
+ return;
+ }
+
if (!value.isUndefinedOrNull() && !value.isNumber() && !value.isBoolean()) {
throwVMTypeError(exec);
return;
@@ -64,6 +69,11 @@ void JSSVGLength::setValue(ExecState* exec, JSValue value)
JSValue JSSVGLength::convertToSpecifiedUnits(ExecState* exec)
{
+ if (impl()->role() == AnimValRole) {
+ setDOMException(exec, NO_MODIFICATION_ALLOWED_ERR);
+ return jsUndefined();
+ }
+
SVGLength& podImp = impl()->propertyReference();
// Mimic the behaviour of RequiresAllArguments=Raise.
diff --git a/WebCore/bindings/scripts/CodeGeneratorJS.pm b/WebCore/bindings/scripts/CodeGeneratorJS.pm
index e09a95a..b4b03bb 100644
--- a/WebCore/bindings/scripts/CodeGeneratorJS.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorJS.pm
@@ -1747,6 +1747,12 @@ sub GenerateImplementation
my $nativeValue = JSValueToNative($attribute->signature, "value");
if ($svgPropertyOrListPropertyType) {
+ if ($svgPropertyType) {
+ push(@implContent, " if (imp->role() == AnimValRole) {\n");
+ push(@implContent, " setDOMException(exec, NO_MODIFICATION_ALLOWED_ERR);\n");
+ push(@implContent, " return;\n");
+ push(@implContent, " }\n");
+ }
push(@implContent, " $svgPropertyOrListPropertyType& podImp = imp->propertyReference();\n");
if ($svgPropertyOrListPropertyType eq "float") { # Special case for JSSVGNumber
push(@implContent, " podImp = $nativeValue;\n");
@@ -1848,7 +1854,13 @@ sub GenerateImplementation
push(@implContent, " return JSValue::encode(castedThis->" . $functionImplementationName . "(exec));\n");
} else {
push(@implContent, " $implType* imp = static_cast<$implType*>(castedThis->impl());\n");
- push(@implContent, " $svgPropertyOrListPropertyType& podImp = imp->propertyReference();\n") if $svgPropertyType;
+ if ($svgPropertyType) {
+ push(@implContent, " if (imp->role() == AnimValRole) {\n");
+ push(@implContent, " setDOMException(exec, NO_MODIFICATION_ALLOWED_ERR);\n");
+ push(@implContent, " return JSValue::encode(jsUndefined());\n");
+ push(@implContent, " }\n");
+ push(@implContent, " $svgPropertyType& podImp = imp->propertyReference();\n");
+ }
my $numParameters = @{$function->parameters};
diff --git a/WebCore/bindings/scripts/CodeGeneratorObjC.pm b/WebCore/bindings/scripts/CodeGeneratorObjC.pm
index 979b71e..6fb2270 100644
--- a/WebCore/bindings/scripts/CodeGeneratorObjC.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorObjC.pm
@@ -1394,6 +1394,10 @@ sub GenerateImplementation
if ($svgPropertyType) {
$getterContentHead = "$getterExpressionPrefix";
+ push(@implContent, " if (IMPL->role() == WebCore::AnimValRole) {\n");
+ push(@implContent, " WebCore::raiseOnDOMError(WebCore::NO_MODIFICATION_ALLOWED_ERR);\n");
+ push(@implContent, " return;\n");
+ push(@implContent, " }\n");
push(@implContent, " $svgPropertyType& podImpl = IMPL->propertyReference();\n");
my $ec = $hasSetterException ? ", ec" : "";
push(@implContent, " $exceptionInit\n") if $hasSetterException;
@@ -1576,6 +1580,14 @@ sub GenerateImplementation
my $content = $codeGenerator->WK_lcfirst($functionName) . "(" . join(", ", @parameterNames) . ")";
if ($svgPropertyType) {
+ push(@functionContent, " if (IMPL->role() == WebCore::AnimValRole) {\n");
+ push(@functionContent, " WebCore::raiseOnDOMError(WebCore::NO_MODIFICATION_ALLOWED_ERR);\n");
+ if ($returnType eq "void") {
+ push(@functionContent, " return;\n");
+ } else {
+ push(@functionContent, " return nil;\n");
+ }
+ push(@functionContent, " }\n");
push(@functionContent, " $svgPropertyType& podImpl = IMPL->propertyReference();\n");
$content = "podImpl.$content";
} else {
diff --git a/WebCore/bindings/scripts/CodeGeneratorV8.pm b/WebCore/bindings/scripts/CodeGeneratorV8.pm
index 6ea61bc..049f765 100644
--- a/WebCore/bindings/scripts/CodeGeneratorV8.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorV8.pm
@@ -915,11 +915,13 @@ sub GenerateNormalAttrSetter
$svgNativeType* imp = V8${implClassName}::toNative(info.Holder());
END
} else {
- push(@implContentDecls, <<END);
- $svgNativeType* wrapper = V8${implClassName}::toNative(info.Holder());
- $svgWrappedNativeType& impInstance = wrapper->propertyReference();
- $svgWrappedNativeType* imp = &impInstance;
-END
+ push(@implContentDecls, " $svgNativeType* wrapper = V8${implClassName}::toNative(info.Holder());\n");
+ push(@implContentDecls, " if (wrapper->role() == AnimValRole) {\n");
+ push(@implContentDecls, " V8Proxy::setDOMException(NO_MODIFICATION_ALLOWED_ERR);\n");
+ push(@implContentDecls, " return;\n");
+ push(@implContentDecls, " }\n");
+ push(@implContentDecls, " $svgWrappedNativeType& impInstance = wrapper->propertyReference();\n");
+ push(@implContentDecls, " $svgWrappedNativeType* imp = &impInstance;\n");
}
} elsif ($attrExt->{"v8OnProto"}) {
if ($interfaceName eq "DOMWindow") {
@@ -1216,8 +1218,12 @@ END
if ($implClassName =~ /List$/) {
push(@implContentDecls, " $nativeClassName imp = V8${implClassName}::toNative(args.Holder());\n");
} else {
- my $svgWrappedNativeType = $codeGenerator->GetSVGWrappedTypeNeedingTearOff($implClassName);
push(@implContentDecls, " $nativeClassName wrapper = V8${implClassName}::toNative(args.Holder());\n");
+ push(@implContentDecls, " if (wrapper->role() == AnimValRole) {\n");
+ push(@implContentDecls, " V8Proxy::setDOMException(NO_MODIFICATION_ALLOWED_ERR);\n");
+ push(@implContentDecls, " return v8::Handle<v8::Value>();\n");
+ push(@implContentDecls, " }\n");
+ my $svgWrappedNativeType = $codeGenerator->GetSVGWrappedTypeNeedingTearOff($implClassName);
push(@implContentDecls, " $svgWrappedNativeType& impInstance = wrapper->propertyReference();\n");
push(@implContentDecls, " $svgWrappedNativeType* imp = &impInstance;\n");
}
diff --git a/WebCore/bindings/v8/custom/V8SVGLengthCustom.cpp b/WebCore/bindings/v8/custom/V8SVGLengthCustom.cpp
index ec6324d..58f26fd 100644
--- a/WebCore/bindings/v8/custom/V8SVGLengthCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8SVGLengthCustom.cpp
@@ -56,12 +56,17 @@ v8::Handle<v8::Value> V8SVGLength::valueAccessorGetter(v8::Local<v8::String> nam
void V8SVGLength::valueAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
INC_STATS("DOM.SVGLength.value._set");
+ SVGPropertyTearOff<SVGLength>* wrapper = V8SVGLength::toNative(info.Holder());
+ if (wrapper->role() == AnimValRole) {
+ V8Proxy::setDOMException(NO_MODIFICATION_ALLOWED_ERR);
+ return;
+ }
+
if (!isUndefinedOrNull(value) && !value->IsNumber() && !value->IsBoolean()) {
V8Proxy::throwTypeError();
return;
}
- SVGPropertyTearOff<SVGLength>* wrapper = V8SVGLength::toNative(info.Holder());
SVGLength& imp = wrapper->propertyReference();
ExceptionCode ec = 0;
imp.setValue(static_cast<float>(value->NumberValue()), wrapper->contextElement(), ec);
@@ -74,10 +79,15 @@ void V8SVGLength::valueAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::
v8::Handle<v8::Value> V8SVGLength::convertToSpecifiedUnitsCallback(const v8::Arguments& args)
{
INC_STATS("DOM.SVGLength.convertToSpecifiedUnits");
+ SVGPropertyTearOff<SVGLength>* wrapper = V8SVGLength::toNative(args.Holder());
+ if (wrapper->role() == AnimValRole) {
+ V8Proxy::setDOMException(NO_MODIFICATION_ALLOWED_ERR);
+ return v8::Handle<v8::Value>();
+ }
+
if (args.Length() < 1)
return throwError("Not enough arguments", V8Proxy::SyntaxError);
- SVGPropertyTearOff<SVGLength>* wrapper = V8SVGLength::toNative(args.Holder());
SVGLength& imp = wrapper->propertyReference();
ExceptionCode ec = 0;
EXCEPTION_BLOCK(int, unitType, toUInt32(args[0]));
diff --git a/WebCore/svg/SVGAElement.cpp b/WebCore/svg/SVGAElement.cpp
index 8e0e56e..811d5f7 100644
--- a/WebCore/svg/SVGAElement.cpp
+++ b/WebCore/svg/SVGAElement.cpp
@@ -108,6 +108,7 @@ void SVGAElement::synchronizeProperty(const QualifiedName& attrName)
synchronizeSVGTarget();
synchronizeHref();
synchronizeExternalResourcesRequired();
+ SVGTests::synchronizeProperties(this, attrName);
return;
}
@@ -117,6 +118,8 @@ void SVGAElement::synchronizeProperty(const QualifiedName& attrName)
synchronizeHref();
else if (SVGExternalResourcesRequired::isKnownAttribute(attrName))
synchronizeExternalResourcesRequired();
+ else if (SVGTests::isKnownAttribute(attrName))
+ SVGTests::synchronizeProperties(this, attrName);
}
RenderObject* SVGAElement::createRenderer(RenderArena* arena, RenderStyle*)
diff --git a/WebCore/svg/SVGAnimationElement.cpp b/WebCore/svg/SVGAnimationElement.cpp
index 25b319e..c3b6f0c 100644
--- a/WebCore/svg/SVGAnimationElement.cpp
+++ b/WebCore/svg/SVGAnimationElement.cpp
@@ -166,8 +166,16 @@ void SVGAnimationElement::synchronizeProperty(const QualifiedName& attrName)
{
SVGSMILElement::synchronizeProperty(attrName);
- if (attrName == anyQName() || SVGExternalResourcesRequired::isKnownAttribute(attrName))
+ if (attrName == anyQName()) {
synchronizeExternalResourcesRequired();
+ SVGTests::synchronizeProperties(this, attrName);
+ return;
+ }
+
+ if (SVGExternalResourcesRequired::isKnownAttribute(attrName))
+ synchronizeExternalResourcesRequired();
+ else if (SVGTests::isKnownAttribute(attrName))
+ SVGTests::synchronizeProperties(this, attrName);
}
float SVGAnimationElement::getStartTime() const
diff --git a/WebCore/svg/SVGCircleElement.cpp b/WebCore/svg/SVGCircleElement.cpp
index a2c6a8d..2aa34b8 100644
--- a/WebCore/svg/SVGCircleElement.cpp
+++ b/WebCore/svg/SVGCircleElement.cpp
@@ -110,6 +110,7 @@ void SVGCircleElement::synchronizeProperty(const QualifiedName& attrName)
synchronizeCy();
synchronizeR();
synchronizeExternalResourcesRequired();
+ SVGTests::synchronizeProperties(this, attrName);
return;
}
@@ -121,6 +122,8 @@ void SVGCircleElement::synchronizeProperty(const QualifiedName& attrName)
synchronizeR();
else if (SVGExternalResourcesRequired::isKnownAttribute(attrName))
synchronizeExternalResourcesRequired();
+ else if (SVGTests::isKnownAttribute(attrName))
+ SVGTests::synchronizeProperties(this, attrName);
}
void SVGCircleElement::toPathData(Path& path) const
diff --git a/WebCore/svg/SVGClipPathElement.cpp b/WebCore/svg/SVGClipPathElement.cpp
index 715a34e..bd4df19 100644
--- a/WebCore/svg/SVGClipPathElement.cpp
+++ b/WebCore/svg/SVGClipPathElement.cpp
@@ -86,6 +86,7 @@ void SVGClipPathElement::synchronizeProperty(const QualifiedName& attrName)
if (attrName == anyQName()) {
synchronizeClipPathUnits();
synchronizeExternalResourcesRequired();
+ SVGTests::synchronizeProperties(this, attrName);
return;
}
@@ -93,6 +94,8 @@ void SVGClipPathElement::synchronizeProperty(const QualifiedName& attrName)
synchronizeClipPathUnits();
else if (SVGExternalResourcesRequired::isKnownAttribute(attrName))
synchronizeExternalResourcesRequired();
+ else if (SVGTests::isKnownAttribute(attrName))
+ SVGTests::synchronizeProperties(this, attrName);
}
void SVGClipPathElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
diff --git a/WebCore/svg/SVGCursorElement.cpp b/WebCore/svg/SVGCursorElement.cpp
index 9fb4140..d3d7d86 100644
--- a/WebCore/svg/SVGCursorElement.cpp
+++ b/WebCore/svg/SVGCursorElement.cpp
@@ -104,6 +104,7 @@ void SVGCursorElement::synchronizeProperty(const QualifiedName& attrName)
synchronizeY();
synchronizeExternalResourcesRequired();
synchronizeHref();
+ SVGTests::synchronizeProperties(this, attrName);
return;
}
@@ -115,6 +116,8 @@ void SVGCursorElement::synchronizeProperty(const QualifiedName& attrName)
synchronizeExternalResourcesRequired();
else if (SVGURIReference::isKnownAttribute(attrName))
synchronizeHref();
+ else if (SVGTests::isKnownAttribute(attrName))
+ SVGTests::synchronizeProperties(this, attrName);
}
void SVGCursorElement::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) const
diff --git a/WebCore/svg/SVGDefsElement.cpp b/WebCore/svg/SVGDefsElement.cpp
index 4f5a582..8525705 100644
--- a/WebCore/svg/SVGDefsElement.cpp
+++ b/WebCore/svg/SVGDefsElement.cpp
@@ -51,8 +51,16 @@ void SVGDefsElement::synchronizeProperty(const QualifiedName& attrName)
{
SVGStyledTransformableElement::synchronizeProperty(attrName);
- if (attrName == anyQName() || SVGExternalResourcesRequired::isKnownAttribute(attrName))
+ if (attrName == anyQName()) {
synchronizeExternalResourcesRequired();
+ SVGTests::synchronizeProperties(this, attrName);
+ return;
+ }
+
+ if (SVGExternalResourcesRequired::isKnownAttribute(attrName))
+ synchronizeExternalResourcesRequired();
+ else if (SVGTests::isKnownAttribute(attrName))
+ SVGTests::synchronizeProperties(this, attrName);
}
}
diff --git a/WebCore/svg/SVGEllipseElement.cpp b/WebCore/svg/SVGEllipseElement.cpp
index 5726c53..c945a9a 100644
--- a/WebCore/svg/SVGEllipseElement.cpp
+++ b/WebCore/svg/SVGEllipseElement.cpp
@@ -117,6 +117,7 @@ void SVGEllipseElement::synchronizeProperty(const QualifiedName& attrName)
synchronizeRx();
synchronizeRy();
synchronizeExternalResourcesRequired();
+ SVGTests::synchronizeProperties(this, attrName);
return;
}
@@ -130,6 +131,8 @@ void SVGEllipseElement::synchronizeProperty(const QualifiedName& attrName)
synchronizeRy();
else if (SVGExternalResourcesRequired::isKnownAttribute(attrName))
synchronizeExternalResourcesRequired();
+ else if (SVGTests::isKnownAttribute(attrName))
+ SVGTests::synchronizeProperties(this, attrName);
}
void SVGEllipseElement::toPathData(Path& path) const
diff --git a/WebCore/svg/SVGForeignObjectElement.cpp b/WebCore/svg/SVGForeignObjectElement.cpp
index d21172a..78063fc 100644
--- a/WebCore/svg/SVGForeignObjectElement.cpp
+++ b/WebCore/svg/SVGForeignObjectElement.cpp
@@ -111,6 +111,7 @@ void SVGForeignObjectElement::synchronizeProperty(const QualifiedName& attrName)
synchronizeHeight();
synchronizeExternalResourcesRequired();
synchronizeHref();
+ SVGTests::synchronizeProperties(this, attrName);
return;
}
@@ -124,6 +125,8 @@ void SVGForeignObjectElement::synchronizeProperty(const QualifiedName& attrName)
synchronizeHeight();
else if (SVGExternalResourcesRequired::isKnownAttribute(attrName))
synchronizeExternalResourcesRequired();
+ else if (SVGTests::isKnownAttribute(attrName))
+ SVGTests::synchronizeProperties(this, attrName);
}
RenderObject* SVGForeignObjectElement::createRenderer(RenderArena* arena, RenderStyle*)
diff --git a/WebCore/svg/SVGGElement.cpp b/WebCore/svg/SVGGElement.cpp
index b6b4a70..c58eefa 100644
--- a/WebCore/svg/SVGGElement.cpp
+++ b/WebCore/svg/SVGGElement.cpp
@@ -77,8 +77,16 @@ void SVGGElement::synchronizeProperty(const QualifiedName& attrName)
{
SVGStyledTransformableElement::synchronizeProperty(attrName);
- if (attrName == anyQName() || SVGExternalResourcesRequired::isKnownAttribute(attrName))
+ if (attrName == anyQName()) {
synchronizeExternalResourcesRequired();
+ SVGTests::synchronizeProperties(this, attrName);
+ return;
+ }
+
+ if (SVGExternalResourcesRequired::isKnownAttribute(attrName))
+ synchronizeExternalResourcesRequired();
+ else if (SVGTests::isKnownAttribute(attrName))
+ SVGTests::synchronizeProperties(this, attrName);
}
RenderObject* SVGGElement::createRenderer(RenderArena* arena, RenderStyle* style)
diff --git a/WebCore/svg/SVGImageElement.cpp b/WebCore/svg/SVGImageElement.cpp
index 3eb64db..dd80c65 100644
--- a/WebCore/svg/SVGImageElement.cpp
+++ b/WebCore/svg/SVGImageElement.cpp
@@ -135,6 +135,7 @@ void SVGImageElement::synchronizeProperty(const QualifiedName& attrName)
synchronizePreserveAspectRatio();
synchronizeExternalResourcesRequired();
synchronizeHref();
+ SVGTests::synchronizeProperties(this, attrName);
return;
}
@@ -152,6 +153,8 @@ void SVGImageElement::synchronizeProperty(const QualifiedName& attrName)
synchronizeExternalResourcesRequired();
else if (SVGURIReference::isKnownAttribute(attrName))
synchronizeHref();
+ else if (SVGTests::isKnownAttribute(attrName))
+ SVGTests::synchronizeProperties(this, attrName);
}
bool SVGImageElement::selfHasRelativeLengths() const
diff --git a/WebCore/svg/SVGLengthList.cpp b/WebCore/svg/SVGLengthList.cpp
index a05ea4b..d2e8fbb 100644
--- a/WebCore/svg/SVGLengthList.cpp
+++ b/WebCore/svg/SVGLengthList.cpp
@@ -61,7 +61,7 @@ String SVGLengthList::valueAsString() const
unsigned size = this->size();
for (unsigned i = 0; i < size; ++i) {
if (i > 0)
- builder.append(", ");
+ builder.append(' ');
builder.append(at(i).valueAsString());
}
diff --git a/WebCore/svg/SVGLengthList.idl b/WebCore/svg/SVGLengthList.idl
index a5771d2..e23f8af 100644
--- a/WebCore/svg/SVGLengthList.idl
+++ b/WebCore/svg/SVGLengthList.idl
@@ -31,17 +31,17 @@ module svg {
void clear()
raises(DOMException);
- SVGLength initialize(in SVGLength item)
+ [StrictTypeChecking, RequiresAllArguments=Raise] SVGLength initialize(in SVGLength item)
raises(DOMException, SVGException);
- SVGLength getItem(in unsigned long index)
+ [StrictTypeChecking, RequiresAllArguments=Raise] SVGLength getItem(in unsigned long index)
raises(DOMException);
- SVGLength insertItemBefore(in SVGLength item, in unsigned long index)
+ [StrictTypeChecking, RequiresAllArguments=Raise] SVGLength insertItemBefore(in SVGLength item, in unsigned long index)
raises(DOMException, SVGException);
- SVGLength replaceItem(in SVGLength item, in unsigned long index)
+ [StrictTypeChecking, RequiresAllArguments=Raise] SVGLength replaceItem(in SVGLength item, in unsigned long index)
raises(DOMException, SVGException);
- SVGLength removeItem(in unsigned long index)
+ [StrictTypeChecking, RequiresAllArguments=Raise] SVGLength removeItem(in unsigned long index)
raises(DOMException);
- SVGLength appendItem(in SVGLength item)
+ [StrictTypeChecking, RequiresAllArguments=Raise] SVGLength appendItem(in SVGLength item)
raises(DOMException, SVGException);
};
diff --git a/WebCore/svg/SVGLineElement.cpp b/WebCore/svg/SVGLineElement.cpp
index ac461fe..e4986a2 100644
--- a/WebCore/svg/SVGLineElement.cpp
+++ b/WebCore/svg/SVGLineElement.cpp
@@ -113,6 +113,7 @@ void SVGLineElement::synchronizeProperty(const QualifiedName& attrName)
synchronizeX2();
synchronizeY2();
synchronizeExternalResourcesRequired();
+ SVGTests::synchronizeProperties(this, attrName);
return;
}
@@ -126,6 +127,8 @@ void SVGLineElement::synchronizeProperty(const QualifiedName& attrName)
synchronizeY2();
else if (SVGExternalResourcesRequired::isKnownAttribute(attrName))
synchronizeExternalResourcesRequired();
+ else if (SVGTests::isKnownAttribute(attrName))
+ SVGTests::synchronizeProperties(this, attrName);
}
void SVGLineElement::toPathData(Path& path) const
diff --git a/WebCore/svg/SVGMaskElement.cpp b/WebCore/svg/SVGMaskElement.cpp
index 78c3732..dda8924 100644
--- a/WebCore/svg/SVGMaskElement.cpp
+++ b/WebCore/svg/SVGMaskElement.cpp
@@ -124,6 +124,7 @@ void SVGMaskElement::synchronizeProperty(const QualifiedName& attrName)
synchronizeX();
synchronizeY();
synchronizeExternalResourcesRequired();
+ SVGTests::synchronizeProperties(this, attrName);
return;
}
@@ -137,6 +138,8 @@ void SVGMaskElement::synchronizeProperty(const QualifiedName& attrName)
synchronizeY();
else if (SVGExternalResourcesRequired::isKnownAttribute(attrName))
synchronizeExternalResourcesRequired();
+ else if (SVGTests::isKnownAttribute(attrName))
+ SVGTests::synchronizeProperties(this, attrName);
}
void SVGMaskElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
diff --git a/WebCore/svg/SVGNumberList.cpp b/WebCore/svg/SVGNumberList.cpp
index a1dc430..7c0149c 100644
--- a/WebCore/svg/SVGNumberList.cpp
+++ b/WebCore/svg/SVGNumberList.cpp
@@ -51,7 +51,7 @@ String SVGNumberList::valueAsString() const
unsigned size = this->size();
for (unsigned i = 0; i < size; ++i) {
if (i > 0)
- builder.append(", ");
+ builder.append(' ');
builder.append(String::number(at(i)));
}
diff --git a/WebCore/svg/SVGNumberList.idl b/WebCore/svg/SVGNumberList.idl
index 58bbcf4..01ecf31 100644
--- a/WebCore/svg/SVGNumberList.idl
+++ b/WebCore/svg/SVGNumberList.idl
@@ -31,17 +31,17 @@ module svg {
void clear()
raises(DOMException);
- SVGNumber initialize(in SVGNumber item)
+ [StrictTypeChecking, RequiresAllArguments=Raise] SVGNumber initialize(in SVGNumber item)
raises(DOMException, SVGException);
- SVGNumber getItem(in unsigned long index)
+ [StrictTypeChecking, RequiresAllArguments=Raise] SVGNumber getItem(in unsigned long index)
raises(DOMException);
- SVGNumber insertItemBefore(in SVGNumber item, in unsigned long index)
+ [StrictTypeChecking, RequiresAllArguments=Raise] SVGNumber insertItemBefore(in SVGNumber item, in unsigned long index)
raises(DOMException, SVGException);
- SVGNumber replaceItem(in SVGNumber item, in unsigned long index)
+ [StrictTypeChecking, RequiresAllArguments=Raise] SVGNumber replaceItem(in SVGNumber item, in unsigned long index)
raises(DOMException, SVGException);
- SVGNumber removeItem(in unsigned long index)
+ [StrictTypeChecking, RequiresAllArguments=Raise] SVGNumber removeItem(in unsigned long index)
raises(DOMException);
- SVGNumber appendItem(in SVGNumber item)
+ [StrictTypeChecking, RequiresAllArguments=Raise] SVGNumber appendItem(in SVGNumber item)
raises(DOMException, SVGException);
};
diff --git a/WebCore/svg/SVGPathElement.cpp b/WebCore/svg/SVGPathElement.cpp
index f9432ce..d9993ae 100644
--- a/WebCore/svg/SVGPathElement.cpp
+++ b/WebCore/svg/SVGPathElement.cpp
@@ -245,6 +245,7 @@ void SVGPathElement::synchronizeProperty(const QualifiedName& attrName)
synchronizeD();
synchronizePathLength();
synchronizeExternalResourcesRequired();
+ SVGTests::synchronizeProperties(this, attrName);
return;
}
@@ -254,6 +255,8 @@ void SVGPathElement::synchronizeProperty(const QualifiedName& attrName)
synchronizePathLength();
else if (SVGExternalResourcesRequired::isKnownAttribute(attrName))
synchronizeExternalResourcesRequired();
+ else if (SVGTests::isKnownAttribute(attrName))
+ SVGTests::synchronizeProperties(this, attrName);
}
void SVGPathElement::synchronizeD()
diff --git a/WebCore/svg/SVGPatternElement.cpp b/WebCore/svg/SVGPatternElement.cpp
index 268bd71..ed2e354 100644
--- a/WebCore/svg/SVGPatternElement.cpp
+++ b/WebCore/svg/SVGPatternElement.cpp
@@ -158,6 +158,7 @@ void SVGPatternElement::synchronizeProperty(const QualifiedName& attrName)
synchronizeViewBox();
synchronizePreserveAspectRatio();
synchronizeHref();
+ SVGTests::synchronizeProperties(this, attrName);
return;
}
@@ -177,11 +178,14 @@ void SVGPatternElement::synchronizeProperty(const QualifiedName& attrName)
synchronizeHeight();
else if (SVGExternalResourcesRequired::isKnownAttribute(attrName))
synchronizeExternalResourcesRequired();
- else if (SVGFitToViewBox::isKnownAttribute(attrName)) {
+ else if (attrName == SVGNames::viewBoxAttr)
synchronizeViewBox();
+ else if (attrName == SVGNames::preserveAspectRatioAttr)
synchronizePreserveAspectRatio();
- } else if (SVGURIReference::isKnownAttribute(attrName))
+ else if (SVGURIReference::isKnownAttribute(attrName))
synchronizeHref();
+ else if (SVGTests::isKnownAttribute(attrName))
+ SVGTests::synchronizeProperties(this, attrName);
}
void SVGPatternElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
diff --git a/WebCore/svg/SVGPointList.idl b/WebCore/svg/SVGPointList.idl
index 647ae69..080d114 100644
--- a/WebCore/svg/SVGPointList.idl
+++ b/WebCore/svg/SVGPointList.idl
@@ -30,17 +30,17 @@ module svg {
void clear()
raises(DOMException);
- SVGPoint initialize(in SVGPoint item)
+ [StrictTypeChecking, RequiresAllArguments=Raise] SVGPoint initialize(in SVGPoint item)
raises(DOMException, SVGException);
- SVGPoint getItem(in unsigned long index)
+ [StrictTypeChecking, RequiresAllArguments=Raise] SVGPoint getItem(in unsigned long index)
raises(DOMException);
- SVGPoint insertItemBefore(in SVGPoint item, in unsigned long index)
+ [StrictTypeChecking, RequiresAllArguments=Raise] SVGPoint insertItemBefore(in SVGPoint item, in unsigned long index)
raises(DOMException, SVGException);
- SVGPoint replaceItem(in SVGPoint item, in unsigned long index)
+ [StrictTypeChecking, RequiresAllArguments=Raise] SVGPoint replaceItem(in SVGPoint item, in unsigned long index)
raises(DOMException, SVGException);
- SVGPoint removeItem(in unsigned long index)
+ [StrictTypeChecking, RequiresAllArguments=Raise] SVGPoint removeItem(in unsigned long index)
raises(DOMException);
- SVGPoint appendItem(in SVGPoint item)
+ [StrictTypeChecking, RequiresAllArguments=Raise] SVGPoint appendItem(in SVGPoint item)
raises(DOMException, SVGException);
};
diff --git a/WebCore/svg/SVGPolyElement.cpp b/WebCore/svg/SVGPolyElement.cpp
index 211dd58..beef21f 100644
--- a/WebCore/svg/SVGPolyElement.cpp
+++ b/WebCore/svg/SVGPolyElement.cpp
@@ -97,6 +97,7 @@ void SVGPolyElement::synchronizeProperty(const QualifiedName& attrName)
if (attrName == anyQName()) {
synchronizeExternalResourcesRequired();
synchronizePoints();
+ SVGTests::synchronizeProperties(this, attrName);
return;
}
@@ -104,6 +105,8 @@ void SVGPolyElement::synchronizeProperty(const QualifiedName& attrName)
synchronizeExternalResourcesRequired();
else if (attrName == SVGNames::pointsAttr)
synchronizePoints();
+ else if (SVGTests::isKnownAttribute(attrName))
+ SVGTests::synchronizeProperties(this, attrName);
}
void SVGPolyElement::synchronizePoints()
diff --git a/WebCore/svg/SVGRectElement.cpp b/WebCore/svg/SVGRectElement.cpp
index c3ff3cb..167f737 100644
--- a/WebCore/svg/SVGRectElement.cpp
+++ b/WebCore/svg/SVGRectElement.cpp
@@ -130,6 +130,7 @@ void SVGRectElement::synchronizeProperty(const QualifiedName& attrName)
synchronizeRx();
synchronizeRy();
synchronizeExternalResourcesRequired();
+ SVGTests::synchronizeProperties(this, attrName);
return;
}
@@ -147,6 +148,8 @@ void SVGRectElement::synchronizeProperty(const QualifiedName& attrName)
synchronizeRy();
else if (SVGExternalResourcesRequired::isKnownAttribute(attrName))
synchronizeExternalResourcesRequired();
+ else if (SVGTests::isKnownAttribute(attrName))
+ SVGTests::synchronizeProperties(this, attrName);
}
void SVGRectElement::toPathData(Path& path) const
diff --git a/WebCore/svg/SVGSVGElement.cpp b/WebCore/svg/SVGSVGElement.cpp
index e90fba4..e64f665 100644
--- a/WebCore/svg/SVGSVGElement.cpp
+++ b/WebCore/svg/SVGSVGElement.cpp
@@ -357,6 +357,7 @@ void SVGSVGElement::synchronizeProperty(const QualifiedName& attrName)
synchronizeExternalResourcesRequired();
synchronizeViewBox();
synchronizePreserveAspectRatio();
+ SVGTests::synchronizeProperties(this, attrName);
return;
}
@@ -370,10 +371,12 @@ void SVGSVGElement::synchronizeProperty(const QualifiedName& attrName)
synchronizeHeight();
else if (SVGExternalResourcesRequired::isKnownAttribute(attrName))
synchronizeExternalResourcesRequired();
- else if (SVGFitToViewBox::isKnownAttribute(attrName)) {
+ else if (attrName == SVGNames::viewBoxAttr)
synchronizeViewBox();
+ else if (attrName == SVGNames::preserveAspectRatioAttr)
synchronizePreserveAspectRatio();
- }
+ else if (SVGTests::isKnownAttribute(attrName))
+ SVGTests::synchronizeProperties(this, attrName);
}
unsigned SVGSVGElement::suspendRedraw(unsigned /* maxWaitMilliseconds */)
diff --git a/WebCore/svg/SVGStringList.cpp b/WebCore/svg/SVGStringList.cpp
index 3eb392a..2a1238b 100644
--- a/WebCore/svg/SVGStringList.cpp
+++ b/WebCore/svg/SVGStringList.cpp
@@ -25,6 +25,7 @@
#include "SVGElement.h"
#include "SVGParserUtilities.h"
+#include <wtf/text/StringBuilder.h>
namespace WebCore {
@@ -62,6 +63,21 @@ void SVGStringList::parse(const String& data, UChar delimiter)
}
}
+String SVGStringList::valueAsString() const
+{
+ StringBuilder builder;
+
+ unsigned size = this->size();
+ for (unsigned i = 0; i < size; ++i) {
+ if (i > 0)
+ builder.append(' ');
+
+ builder.append(at(i));
+ }
+
+ return builder.toString();
+}
+
}
#endif // ENABLE(SVG)
diff --git a/WebCore/svg/SVGStringList.h b/WebCore/svg/SVGStringList.h
index c741b9d..9d74624 100644
--- a/WebCore/svg/SVGStringList.h
+++ b/WebCore/svg/SVGStringList.h
@@ -43,6 +43,8 @@ public:
// Only used by SVGStringListPropertyTearOff.
void commitChange(SVGElement* contextElement);
+ String valueAsString() const;
+
private:
const QualifiedName& m_attributeName;
};
diff --git a/WebCore/svg/SVGStringList.idl b/WebCore/svg/SVGStringList.idl
index 12eed8d..82af72d 100644
--- a/WebCore/svg/SVGStringList.idl
+++ b/WebCore/svg/SVGStringList.idl
@@ -30,17 +30,17 @@ module svg {
void clear()
raises(DOMException);
- DOMString initialize(in DOMString item)
+ [StrictTypeChecking, RequiresAllArguments=Raise] DOMString initialize(in DOMString item)
raises(DOMException, SVGException);
- DOMString getItem(in unsigned long index)
+ [StrictTypeChecking, RequiresAllArguments=Raise] DOMString getItem(in unsigned long index)
raises(DOMException);
- DOMString insertItemBefore(in DOMString item, in unsigned long index)
+ [StrictTypeChecking, RequiresAllArguments=Raise] DOMString insertItemBefore(in DOMString item, in unsigned long index)
raises(DOMException, SVGException);
- DOMString replaceItem(in DOMString item, in unsigned long index)
+ [StrictTypeChecking, RequiresAllArguments=Raise] DOMString replaceItem(in DOMString item, in unsigned long index)
raises(DOMException, SVGException);
- DOMString removeItem(in unsigned long index)
+ [StrictTypeChecking, RequiresAllArguments=Raise] DOMString removeItem(in unsigned long index)
raises(DOMException);
- DOMString appendItem(in DOMString item)
+ [StrictTypeChecking, RequiresAllArguments=Raise] DOMString appendItem(in DOMString item)
raises(DOMException, SVGException);
};
diff --git a/WebCore/svg/SVGSwitchElement.cpp b/WebCore/svg/SVGSwitchElement.cpp
index 9b40a02..b2588f5 100644
--- a/WebCore/svg/SVGSwitchElement.cpp
+++ b/WebCore/svg/SVGSwitchElement.cpp
@@ -62,8 +62,16 @@ void SVGSwitchElement::synchronizeProperty(const QualifiedName& attrName)
{
SVGStyledTransformableElement::synchronizeProperty(attrName);
- if (attrName == anyQName() || SVGExternalResourcesRequired::isKnownAttribute(attrName))
+ if (attrName == anyQName()) {
synchronizeExternalResourcesRequired();
+ SVGTests::synchronizeProperties(this, attrName);
+ return;
+ }
+
+ if (SVGExternalResourcesRequired::isKnownAttribute(attrName))
+ synchronizeExternalResourcesRequired();
+ else if (SVGTests::isKnownAttribute(attrName))
+ SVGTests::synchronizeProperties(this, attrName);
}
}
diff --git a/WebCore/svg/SVGTests.cpp b/WebCore/svg/SVGTests.cpp
index 2b9cb14..63733bf 100644
--- a/WebCore/svg/SVGTests.cpp
+++ b/WebCore/svg/SVGTests.cpp
@@ -33,8 +33,8 @@
namespace WebCore {
SVGTests::SVGTests()
- : m_features(SVGNames::requiredFeaturesAttr)
- , m_extensions(SVGNames::requiredExtensionsAttr)
+ : m_requiredFeatures(SVGNames::requiredFeaturesAttr)
+ , m_requiredExtensions(SVGNames::requiredExtensionsAttr)
, m_systemLanguage(SVGNames::systemLanguageAttr)
{
}
@@ -47,21 +47,21 @@ bool SVGTests::hasExtension(const String&) const
bool SVGTests::isValid() const
{
- unsigned featuresSize = m_features.size();
+ unsigned featuresSize = m_requiredFeatures.value.size();
for (unsigned i = 0; i < featuresSize; ++i) {
- String value = m_features.at(i);
+ String value = m_requiredFeatures.value.at(i);
if (value.isEmpty() || !DOMImplementation::hasFeature(value, String()))
return false;
}
- unsigned systemLanguageSize = m_systemLanguage.size();
+ unsigned systemLanguageSize = m_systemLanguage.value.size();
for (unsigned i = 0; i < systemLanguageSize; ++i) {
- String value = m_systemLanguage.at(i);
+ String value = m_systemLanguage.value.at(i);
if (value != defaultLanguage().substring(0, 2))
return false;
}
- if (!m_extensions.isEmpty())
+ if (!m_requiredExtensions.value.isEmpty())
return false;
return true;
@@ -70,34 +70,29 @@ bool SVGTests::isValid() const
bool SVGTests::parseMappedAttribute(Attribute* attr)
{
if (attr->name() == SVGNames::requiredFeaturesAttr) {
- m_features.reset(attr->value());
+ m_requiredFeatures.value.reset(attr->value());
return true;
} else if (attr->name() == SVGNames::requiredExtensionsAttr) {
- m_extensions.reset(attr->value());
+ m_requiredExtensions.value.reset(attr->value());
return true;
} else if (attr->name() == SVGNames::systemLanguageAttr) {
- m_systemLanguage.reset(attr->value());
+ m_systemLanguage.value.reset(attr->value());
return true;
}
return false;
}
-static bool knownAttribute(const QualifiedName& attrName)
+bool SVGTests::isKnownAttribute(const QualifiedName& attrName)
{
return attrName == SVGNames::requiredFeaturesAttr
|| attrName == SVGNames::requiredExtensionsAttr
|| attrName == SVGNames::systemLanguageAttr;
}
-bool SVGTests::isKnownAttribute(const QualifiedName& attrName)
-{
- return knownAttribute(attrName);
-}
-
bool SVGTests::handleAttributeChange(const SVGElement* targetElement, const QualifiedName& attrName)
{
- if (!knownAttribute(attrName))
+ if (!isKnownAttribute(attrName))
return false;
if (!targetElement->inDocument())
return false;
@@ -111,6 +106,65 @@ bool SVGTests::handleAttributeChange(const SVGElement* targetElement, const Qual
return true;
}
+void SVGTests::synchronizeProperties(SVGElement* contextElement, const QualifiedName& attrName)
+{
+ if (attrName == anyQName()) {
+ synchronizeRequiredFeatures(contextElement);
+ synchronizeRequiredExtensions(contextElement);
+ synchronizeSystemLanguage(contextElement);
+ return;
+ }
+
+ if (attrName == SVGNames::requiredFeaturesAttr)
+ synchronizeRequiredFeatures(contextElement);
+ else if (attrName == SVGNames::requiredExtensionsAttr)
+ synchronizeRequiredExtensions(contextElement);
+ else if (attrName == SVGNames::systemLanguageAttr)
+ synchronizeSystemLanguage(contextElement);
+}
+
+void SVGTests::synchronizeRequiredFeatures(SVGElement* contextElement)
+{
+ if (!m_requiredFeatures.shouldSynchronize)
+ return;
+ AtomicString value(m_requiredFeatures.value.valueAsString());
+ SVGAnimatedPropertySynchronizer<true>::synchronize(contextElement, SVGNames::requiredFeaturesAttr, value);
+}
+
+void SVGTests::synchronizeRequiredExtensions(SVGElement* contextElement)
+{
+ if (!m_requiredExtensions.shouldSynchronize)
+ return;
+ AtomicString value(m_requiredExtensions.value.valueAsString());
+ SVGAnimatedPropertySynchronizer<true>::synchronize(contextElement, SVGNames::requiredExtensionsAttr, value);
+}
+
+void SVGTests::synchronizeSystemLanguage(SVGElement* contextElement)
+{
+ if (!m_systemLanguage.shouldSynchronize)
+ return;
+ AtomicString value(m_systemLanguage.value.valueAsString());
+ SVGAnimatedPropertySynchronizer<true>::synchronize(contextElement, SVGNames::systemLanguageAttr, value);
+}
+
+SVGStringList& SVGTests::requiredFeatures()
+{
+ m_requiredFeatures.shouldSynchronize = true;
+ return m_requiredFeatures.value;
+}
+
+SVGStringList& SVGTests::requiredExtensions()
+{
+ m_requiredExtensions.shouldSynchronize = true;
+ return m_requiredExtensions.value;
+}
+
+SVGStringList& SVGTests::systemLanguage()
+{
+ m_systemLanguage.shouldSynchronize = true;
+ return m_systemLanguage.value;
+}
+
}
#endif // ENABLE(SVG)
diff --git a/WebCore/svg/SVGTests.h b/WebCore/svg/SVGTests.h
index 8cba9d2..8160955 100644
--- a/WebCore/svg/SVGTests.h
+++ b/WebCore/svg/SVGTests.h
@@ -22,6 +22,7 @@
#define SVGTests_h
#if ENABLE(SVG)
+#include "SVGAnimatedPropertyMacros.h"
#include "SVGStringList.h"
namespace WebCore {
@@ -32,9 +33,9 @@ class SVGElement;
class SVGTests {
public:
- SVGStringList& requiredFeatures() { return m_features; }
- SVGStringList& requiredExtensions() { return m_extensions; }
- SVGStringList& systemLanguage() { return m_systemLanguage; }
+ SVGStringList& requiredFeatures();
+ SVGStringList& requiredExtensions();
+ SVGStringList& systemLanguage();
bool hasExtension(const String&) const;
bool isValid() const;
@@ -42,15 +43,20 @@ public:
bool parseMappedAttribute(Attribute*);
bool isKnownAttribute(const QualifiedName&);
- static bool handleAttributeChange(const SVGElement*, const QualifiedName&);
+ bool handleAttributeChange(const SVGElement*, const QualifiedName&);
+ void synchronizeProperties(SVGElement*, const QualifiedName&);
protected:
SVGTests();
private:
- SVGStringList m_features;
- SVGStringList m_extensions;
- SVGStringList m_systemLanguage;
+ void synchronizeRequiredFeatures(SVGElement*);
+ void synchronizeRequiredExtensions(SVGElement*);
+ void synchronizeSystemLanguage(SVGElement*);
+
+ SVGSynchronizableAnimatedProperty<SVGStringList> m_requiredFeatures;
+ SVGSynchronizableAnimatedProperty<SVGStringList> m_requiredExtensions;
+ SVGSynchronizableAnimatedProperty<SVGStringList> m_systemLanguage;
};
} // namespace WebCore
diff --git a/WebCore/svg/SVGTextContentElement.cpp b/WebCore/svg/SVGTextContentElement.cpp
index 0cbcc9a..65b89e9 100644
--- a/WebCore/svg/SVGTextContentElement.cpp
+++ b/WebCore/svg/SVGTextContentElement.cpp
@@ -190,6 +190,7 @@ void SVGTextContentElement::synchronizeProperty(const QualifiedName& attrName)
synchronizeLengthAdjust();
synchronizeTextLength();
synchronizeExternalResourcesRequired();
+ SVGTests::synchronizeProperties(this, attrName);
return;
}
@@ -199,6 +200,8 @@ void SVGTextContentElement::synchronizeProperty(const QualifiedName& attrName)
synchronizeTextLength();
else if (SVGExternalResourcesRequired::isKnownAttribute(attrName))
synchronizeExternalResourcesRequired();
+ else if (SVGTests::isKnownAttribute(attrName))
+ SVGTests::synchronizeProperties(this, attrName);
}
void SVGTextContentElement::svgAttributeChanged(const QualifiedName& attrName)
diff --git a/WebCore/svg/SVGTransform.cpp b/WebCore/svg/SVGTransform.cpp
index c39fe39..4878b57 100644
--- a/WebCore/svg/SVGTransform.cpp
+++ b/WebCore/svg/SVGTransform.cpp
@@ -21,13 +21,16 @@
#include "config.h"
#if ENABLE(SVG)
+#include "SVGTransform.h"
+
+#include "FloatConversion.h"
#include "FloatPoint.h"
#include "FloatSize.h"
#include "SVGAngle.h"
#include "SVGSVGElement.h"
-#include "SVGTransform.h"
-
#include <wtf/MathExtras.h>
+#include <wtf/text/StringBuilder.h>
+#include <wtf/text/StringConcatenate.h>
namespace WebCore {
@@ -126,6 +129,41 @@ void SVGTransform::setSkewY(float angle)
m_matrix.skewY(angle);
}
+String SVGTransform::valueAsString() const
+{
+ switch (m_type) {
+ case SVG_TRANSFORM_UNKNOWN:
+ return String();
+ case SVG_TRANSFORM_MATRIX: {
+ StringBuilder builder;
+ builder.append(makeString("matrix(", String::number(m_matrix.a()), ' ', String::number(m_matrix.b()), ' ', String::number(m_matrix.c()), ' '));
+ builder.append(makeString(String::number(m_matrix.d()), ' ', String::number(m_matrix.e()), ' ', String::number(m_matrix.f()), ')'));
+ return builder.toString();
+ }
+ case SVG_TRANSFORM_TRANSLATE:
+ return makeString("translate(", String::number(m_matrix.e()), ' ', String::number(m_matrix.f()), ')');
+ case SVG_TRANSFORM_SCALE:
+ return makeString("scale(", String::number(m_matrix.xScale()), ' ', String::number(m_matrix.yScale()), ')');
+ case SVG_TRANSFORM_ROTATE: {
+ double angleInRad = deg2rad(m_angle);
+ double cosAngle = cos(angleInRad);
+ double sinAngle = sin(angleInRad);
+ float cx = narrowPrecisionToFloat(cosAngle != 1 ? (m_matrix.e() * (1 - cosAngle) - m_matrix.f() * sinAngle) / (1 - cosAngle) / 2 : 0);
+ float cy = narrowPrecisionToFloat(cosAngle != 1 ? (m_matrix.e() * sinAngle / (1 - cosAngle) + m_matrix.f()) / 2 : 0);
+ if (cx || cy)
+ return makeString("rotate(", String::number(m_angle), ' ', String::number(cx), ' ', String::number(cy), ')');
+ return makeString("rotate(", String::number(m_angle), ')');
+ }
+ case SVG_TRANSFORM_SKEWX:
+ return makeString("skewX(", String::number(m_angle), ')');
+ case SVG_TRANSFORM_SKEWY:
+ return makeString("skewY(", String::number(m_angle), ')');
+ }
+
+ ASSERT_NOT_REACHED();
+ return String();
+}
+
} // namespace WebCore
#endif // ENABLE(SVG)
diff --git a/WebCore/svg/SVGTransform.h b/WebCore/svg/SVGTransform.h
index 36dd038..14718ae 100644
--- a/WebCore/svg/SVGTransform.h
+++ b/WebCore/svg/SVGTransform.h
@@ -66,6 +66,7 @@ public:
FloatSize scale() const;
bool isValid() const { return m_type != SVG_TRANSFORM_UNKNOWN; }
+ String valueAsString() const;
private:
friend bool operator==(const SVGTransform& a, const SVGTransform& b);
diff --git a/WebCore/svg/SVGTransformList.cpp b/WebCore/svg/SVGTransformList.cpp
index 9137a89..759b064 100644
--- a/WebCore/svg/SVGTransformList.cpp
+++ b/WebCore/svg/SVGTransformList.cpp
@@ -62,13 +62,15 @@ bool SVGTransformList::concatenate(AffineTransform& result) const
String SVGTransformList::valueAsString() const
{
- // TODO: We may want to build a real transform string, instead of concatting to a matrix(...).
- AffineTransform matrix;
- concatenate(matrix);
-
StringBuilder builder;
- builder.append(makeString("matrix(", String::number(matrix.a()), ' ', String::number(matrix.b()), ' ', String::number(matrix.c()), ' '));
- builder.append(makeString(String::number(matrix.d()), ' ', String::number(matrix.e()), ' ', String::number(matrix.f()), ')'));
+ unsigned size = this->size();
+ for (unsigned i = 0; i < size; ++i) {
+ if (i > 0)
+ builder.append(' ');
+
+ builder.append(at(i).valueAsString());
+ }
+
return builder.toString();
}
diff --git a/WebCore/svg/SVGUseElement.cpp b/WebCore/svg/SVGUseElement.cpp
index a69334c..fc01fd9 100644
--- a/WebCore/svg/SVGUseElement.cpp
+++ b/WebCore/svg/SVGUseElement.cpp
@@ -199,6 +199,7 @@ void SVGUseElement::synchronizeProperty(const QualifiedName& attrName)
synchronizeHeight();
synchronizeExternalResourcesRequired();
synchronizeHref();
+ SVGTests::synchronizeProperties(this, attrName);
return;
}
@@ -214,6 +215,8 @@ void SVGUseElement::synchronizeProperty(const QualifiedName& attrName)
synchronizeExternalResourcesRequired();
else if (SVGURIReference::isKnownAttribute(attrName))
synchronizeHref();
+ else if (SVGTests::isKnownAttribute(attrName))
+ SVGTests::synchronizeProperties(this, attrName);
}
static void updateContainerSize(SVGUseElement* useElement, SVGElementInstance* targetInstance)
diff --git a/WebCore/svg/properties/SVGListProperty.h b/WebCore/svg/properties/SVGListProperty.h
index f143389..9018923 100644
--- a/WebCore/svg/properties/SVGListProperty.h
+++ b/WebCore/svg/properties/SVGListProperty.h
@@ -110,7 +110,7 @@ public:
// Not specified, but FF/Opera do it this way, and it's just sane.
if (!passNewItem) {
- ec = TYPE_MISMATCH_ERR;
+ ec = SVGException::SVG_WRONG_TYPE_ERR;
return 0;
}
@@ -207,7 +207,7 @@ public:
// Not specified, but FF/Opera do it this way, and it's just sane.
if (!passNewItem) {
- ec = TYPE_MISMATCH_ERR;
+ ec = SVGException::SVG_WRONG_TYPE_ERR;
return 0;
}
@@ -258,6 +258,12 @@ public:
// Spec: If the item is already in this list, note that the index of the item to replace is before the removal of the item.
processIncomingListItemValue(newItem, &index);
+ if (values.isEmpty()) {
+ // 'newItem' already lived in our list, we removed it, and now we're empty, which means there's nothing to replace.
+ ec = INDEX_SIZE_ERR;
+ return ListItemType();
+ }
+
// Update the value at the desired position 'index'.
values.at(index) = newItem;
@@ -274,7 +280,7 @@ public:
// Not specified, but FF/Opera do it this way, and it's just sane.
if (!passNewItem) {
- ec = TYPE_MISMATCH_ERR;
+ ec = SVGException::SVG_WRONG_TYPE_ERR;
return 0;
}
@@ -286,6 +292,13 @@ public:
// Spec: If the item is already in this list, note that the index of the item to replace is before the removal of the item.
processIncomingListItemWrapper(newItem, &index);
+ if (values.isEmpty()) {
+ ASSERT(wrappers.isEmpty());
+ // 'passNewItem' already lived in our list, we removed it, and now we're empty, which means there's nothing to replace.
+ ec = INDEX_SIZE_ERR;
+ return 0;
+ }
+
// Detach the existing wrapper.
RefPtr<ListItemTearOff> oldItem = wrappers.at(index);
if (oldItem)
@@ -337,9 +350,10 @@ public:
// Detach the existing wrapper.
RefPtr<ListItemTearOff> oldItem = wrappers.at(index);
- if (oldItem)
- oldItem->detachWrapper();
+ if (!oldItem)
+ oldItem = ListItemTearOff::create(animatedList, UndefinedRole, values.at(index));
+ oldItem->detachWrapper();
wrappers.remove(index);
values.remove(index);
@@ -371,7 +385,7 @@ public:
// Not specified, but FF/Opera do it this way, and it's just sane.
if (!passNewItem) {
- ec = TYPE_MISMATCH_ERR;
+ ec = SVGException::SVG_WRONG_TYPE_ERR;
return 0;
}
@@ -392,6 +406,8 @@ public:
return newItem.release();
}
+ virtual SVGPropertyRole role() const { return m_role; }
+
protected:
SVGListProperty(SVGPropertyRole role)
: m_role(role)
diff --git a/WebCore/svg/properties/SVGPathSegListPropertyTearOff.h b/WebCore/svg/properties/SVGPathSegListPropertyTearOff.h
index 71977d1..94acda1 100644
--- a/WebCore/svg/properties/SVGPathSegListPropertyTearOff.h
+++ b/WebCore/svg/properties/SVGPathSegListPropertyTearOff.h
@@ -75,7 +75,7 @@ public:
{
// Not specified, but FF/Opera do it this way, and it's just sane.
if (!passNewItem) {
- ec = TYPE_MISMATCH_ERR;
+ ec = SVGException::SVG_WRONG_TYPE_ERR;
return 0;
}
@@ -90,7 +90,7 @@ public:
{
// Not specified, but FF/Opera do it this way, and it's just sane.
if (!passNewItem) {
- ec = TYPE_MISMATCH_ERR;
+ ec = SVGException::SVG_WRONG_TYPE_ERR;
return 0;
}
@@ -103,7 +103,7 @@ public:
{
// Not specified, but FF/Opera do it this way, and it's just sane.
if (!passNewItem) {
- ec = TYPE_MISMATCH_ERR;
+ ec = SVGException::SVG_WRONG_TYPE_ERR;
return 0;
}
@@ -118,7 +118,7 @@ public:
{
// Not specified, but FF/Opera do it this way, and it's just sane.
if (!passNewItem) {
- ec = TYPE_MISMATCH_ERR;
+ ec = SVGException::SVG_WRONG_TYPE_ERR;
return 0;
}
diff --git a/WebCore/svg/properties/SVGProperty.h b/WebCore/svg/properties/SVGProperty.h
index 104fb0e..609e264 100644
--- a/WebCore/svg/properties/SVGProperty.h
+++ b/WebCore/svg/properties/SVGProperty.h
@@ -35,6 +35,7 @@ class SVGProperty : public RefCounted<SVGProperty> {
public:
virtual ~SVGProperty() { }
+ virtual SVGPropertyRole role() const = 0;
virtual void commitChange() = 0;
};
diff --git a/WebCore/svg/properties/SVGPropertyTearOff.h b/WebCore/svg/properties/SVGPropertyTearOff.h
index 219a4a6..d0eac3b 100644
--- a/WebCore/svg/properties/SVGPropertyTearOff.h
+++ b/WebCore/svg/properties/SVGPropertyTearOff.h
@@ -34,10 +34,10 @@ public:
// Used for child types (baseVal/animVal) of a SVGAnimated* property (for example: SVGAnimatedLength::baseVal()).
// Also used for list tear offs (for example: text.x.baseVal.getItem(0)).
- static PassRefPtr<Self> create(SVGAnimatedProperty* animatedProperty, SVGPropertyRole, PropertyType& value)
+ static PassRefPtr<Self> create(SVGAnimatedProperty* animatedProperty, SVGPropertyRole role, PropertyType& value)
{
ASSERT(animatedProperty);
- return adoptRef(new Self(animatedProperty, value));
+ return adoptRef(new Self(animatedProperty, role, value));
}
// Used for non-animated POD types (for example: SVGSVGElement::createSVGLength()).
@@ -91,9 +91,12 @@ public:
m_animatedProperty->commitChange();
}
+ virtual SVGPropertyRole role() const { return m_role; }
+
protected:
- SVGPropertyTearOff(SVGAnimatedProperty* animatedProperty, PropertyType& value)
+ SVGPropertyTearOff(SVGAnimatedProperty* animatedProperty, SVGPropertyRole role, PropertyType& value)
: m_animatedProperty(animatedProperty)
+ , m_role(role)
, m_value(&value)
, m_valueIsCopy(false)
{
@@ -103,6 +106,7 @@ protected:
SVGPropertyTearOff(const PropertyType& initialValue)
: m_animatedProperty(0)
+ , m_role(UndefinedRole)
, m_value(new PropertyType(initialValue))
, m_valueIsCopy(true)
{
@@ -115,6 +119,7 @@ protected:
}
RefPtr<SVGAnimatedProperty> m_animatedProperty;
+ SVGPropertyRole m_role;
PropertyType* m_value;
bool m_valueIsCopy : 1;
};
diff --git a/WebCore/svg/properties/SVGStaticPropertyTearOff.h b/WebCore/svg/properties/SVGStaticPropertyTearOff.h
index 8f31909..233880f 100644
--- a/WebCore/svg/properties/SVGStaticPropertyTearOff.h
+++ b/WebCore/svg/properties/SVGStaticPropertyTearOff.h
@@ -48,7 +48,7 @@ public:
private:
SVGStaticPropertyTearOff(ContextElement* contextElement, PropertyType& value, UpdateMethod update)
- : SVGPropertyTearOff<PropertyType>(0, value)
+ : SVGPropertyTearOff<PropertyType>(0, UndefinedRole, value)
, m_update(update)
, m_contextElement(contextElement)
{
diff --git a/WebCore/svg/properties/SVGStaticPropertyWithParentTearOff.h b/WebCore/svg/properties/SVGStaticPropertyWithParentTearOff.h
index 1e58341..cf47960 100644
--- a/WebCore/svg/properties/SVGStaticPropertyWithParentTearOff.h
+++ b/WebCore/svg/properties/SVGStaticPropertyWithParentTearOff.h
@@ -53,7 +53,7 @@ public:
private:
SVGStaticPropertyWithParentTearOff(SVGProperty* parent, PropertyType& value, UpdateMethod update)
- : SVGPropertyTearOff<PropertyType>(0, value)
+ : SVGPropertyTearOff<PropertyType>(0, UndefinedRole, value)
, m_update(update)
, m_parent(parent)
{
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list