[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

zimmermann at webkit.org zimmermann at webkit.org
Wed Dec 22 15:19:50 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 7bd553a66093027b950fe1a2bfa3c3f2f5e48e8e
Author: zimmermann at webkit.org <zimmermann at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Nov 1 08:57:11 2010 +0000

    2010-10-31  Nikolas Zimmermann  <nzimmermann at rim.com>
    
            Reviewed by Rob Buis.
    
            Enable StrictTypeChecking for all types using SVG(Animated)PropertyTearOff
            https://bugs.webkit.org/show_bug.cgi?id=48715
    
            Enable StrictTypeChecking for all readwrite attributes and function calls of all types using the new SVG(Animated)PropertyTearOff concept.
            Also enable RequiresAllArguments=Raise for all function calls of these new types. Cover this functionality by tests for each of them.
    
            When testing SVGLength it became obvious that quite a lot of functionality was missing.
            Conversion from relative arguments (percentage, ems, exs) to user specified units was missing, added that functionality and tested it.
            User units to pt conversion was wrong, fixed that.
    
            Tests: svg/dom/SVGAnimatedAngle.html
                   svg/dom/SVGAnimatedBoolean.html
                   svg/dom/SVGAnimatedEnumeration.html
                   svg/dom/SVGAnimatedInteger.html
                   svg/dom/SVGAnimatedLength.html
                   svg/dom/SVGAnimatedLengthList.html
                   svg/dom/SVGAnimatedRect.html
                   svg/dom/SVGLength-px-with-context.html
                   svg/dom/SVGLength-px.html
                   svg/dom/SVGLength.html
    
            * bindings/js/JSSVGLengthCustom.cpp: These SVGLength methods now take an ExceptionCode parameter, adapt to that.
            (WebCore::JSSVGLength::value):
            (WebCore::JSSVGLength::setValue):
            (WebCore::JSSVGLength::convertToSpecifiedUnits):
            * bindings/scripts/CodeGeneratorObjC.pm: Remove FIXMEs, pass real context instead off null pointer. DOMSVGLength::value is functional now.
            * bindings/v8/custom/V8SVGLengthCustom.cpp: These SVGLength methods now take an ExceptionCode parameter, adapt to that.
            (WebCore::V8SVGLength::valueAccessorGetter):
            (WebCore::V8SVGLength::valueAccessorSetter):
            (WebCore::V8SVGLength::convertToSpecifiedUnitsCallback):
            * rendering/style/SVGRenderStyle.h: Adapt to SVGLength API changes.
            (WebCore::SVGRenderStyle::initialBaselineShiftValue):
            (WebCore::SVGRenderStyle::initialKerning):
            (WebCore::SVGRenderStyle::initialStrokeDashOffset):
            (WebCore::SVGRenderStyle::initialStrokeWidth):
            * svg/SVGAngle.idl: Add StrictTypeChecking, RequiresAllArguments=Raise to all methods.
            * svg/SVGAnimatedBoolean.idl: Remove StrictTypeChecking from animVal, it's readonly so this is useless.
            * svg/SVGAnimatedEnumeration.idl: Add StrictTypeChecking to all attributes.
            * svg/SVGAnimatedInteger.idl: Ditto.
            * svg/SVGLength.cpp: Implement all missing features of SVGLength. Conform to our style guide (s/.0f// etc)
            (WebCore::lengthTypeToString):
            (WebCore::SVGLength::SVGLength):
            (WebCore::SVGLength::value): Throw NOT_SUPPORTED_ERR when trying to obtain to relative units, when no context is given (SVGLength created by createSVGLength()).
            (WebCore::SVGLength::setValue): Ditto, for the setter.
            (WebCore::SVGLength::valueAsPercentage): Use m_valueInSpecifiedUnits instead of valueInSpecifiedUnits().
            (WebCore::SVGLength::setValueAsString): Throw SYNTAX_ERR if parsing failed.
            (WebCore::SVGLength::valueAsString): Use makeString() instead of String and operator+.
            (WebCore::SVGLength::newValueSpecifiedUnits): Add ExceptionCode parameter, throw NOT_SUPPORTED_ERR, if the given unit type is invalid.
            (WebCore::SVGLength::convertToSpecifiedUnits): Ditto.
            (WebCore::SVGLength::determineViewport): Added helper function used by convertValue*Percentage*.
            (WebCore::SVGLength::convertValueFromUserUnitsToPercentage): Add new helper functions, used by value/setValue.
            (WebCore::SVGLength::convertValueFromPercentageToUserUnits): Ditto.
            (WebCore::SVGLength::convertValueFromUserUnitsToEMS): Ditto.
            (WebCore::SVGLength::convertValueFromEMSToUserUnits): Ditto.
            (WebCore::SVGLength::convertValueFromUserUnitsToEXS): Ditto.
            (WebCore::SVGLength::convertValueFromEXSToUserUnits): Ditto.
            (WebCore::SVGLength::fromCSSPrimitiveValue): Adapt to newValueSpecifiedUnits API change.
            (WebCore::SVGLength::toCSSPrimitiveValue): Remove default switch case.
            * svg/SVGLength.h:
            (WebCore::SVGLength::valueInSpecifiedUnits): Inlined.
            (WebCore::SVGLength::setValueInSpecifiedUnits): Ditto.
            (WebCore::SVGLength::isRelative):
            * svg/SVGLength.idl: Add StrictTypeChecking for all attributes/functions and RequiresAllArguments=Raise for all functions.
            * svg/SVGLengthList.cpp: Adapt to SVGLength API changes.
            (WebCore::SVGLengthList::parse):
    
    2010-10-31  Nikolas Zimmermann  <nzimmermann at rim.com>
    
            Reviewed by Rob Buis.
    
            Enable StrictTypeChecking for all types using SVG(Animated)PropertyTearOff
            https://bugs.webkit.org/show_bug.cgi?id=48715
    
            * svg/dom/SVGAngle-expected.txt:
            * svg/dom/SVGAnimatedAngle-expected.txt: Added.
            * svg/dom/SVGAnimatedAngle.html: Added.
            * svg/dom/SVGAnimatedBoolean-expected.txt: Copied from LayoutTests/svg/dom/SVGExternalResourcesRequired-expected.txt.
            * svg/dom/SVGAnimatedBoolean.html: Copied from LayoutTests/svg/dom/SVGExternalResourcesRequired.html.
            * svg/dom/SVGAnimatedEnumeration-expected.txt: Added.
            * svg/dom/SVGAnimatedEnumeration.html: Added.
            * svg/dom/SVGAnimatedInteger-expected.txt: Added.
            * svg/dom/SVGAnimatedInteger.html: Added.
            * svg/dom/SVGAnimatedLength-expected.txt: Added.
            * svg/dom/SVGAnimatedLength.html: Added.
            * svg/dom/SVGAnimatedLengthList-expected.txt: Added.
            * svg/dom/SVGAnimatedLengthList.html: Added.
            * svg/dom/SVGAnimatedRect-expected.txt: Added.
            * svg/dom/SVGAnimatedRect.html: Added.
            * svg/dom/SVGExternalResourcesRequired-expected.txt: Removed.
            * svg/dom/SVGExternalResourcesRequired.html: Removed.
            * svg/dom/SVGLength-expected.txt: Added.
            * svg/dom/SVGLength-px-expected.txt: Added.
            * svg/dom/SVGLength-px-with-context-expected.txt: Added.
            * svg/dom/SVGLength-px-with-context.html: Added.
            * svg/dom/SVGLength-px.html: Added.
            * svg/dom/SVGLength.html: Added.
            * svg/dom/script-tests/SVGAngle.js:
            * svg/dom/script-tests/SVGAnimatedAngle.js: Added.
            * svg/dom/script-tests/SVGAnimatedBoolean.js: Copied from LayoutTests/svg/dom/script-tests/SVGExternalResourcesRequired.js.
            * svg/dom/script-tests/SVGAnimatedEnumeration.js: Added.
            * svg/dom/script-tests/SVGAnimatedInteger.js: Added.
            * svg/dom/script-tests/SVGAnimatedLength.js: Added.
            * svg/dom/script-tests/SVGAnimatedLengthList.js: Added.
            * svg/dom/script-tests/SVGAnimatedRect.js: Added.
            * svg/dom/script-tests/SVGExternalResourcesRequired.js: Removed.
            * svg/dom/script-tests/SVGLength-px-with-context.js: Added. Tests various operations on a SVGLength object obtained via rectElement.x.baseVal.
            * svg/dom/script-tests/SVGLength-px.js: Added. Tests various operations on a SVGLength object created via svgElement.createSVGLength().
            * svg/dom/script-tests/SVGLength.js: Added.
            * svg/dom/svg-length-units-expected.txt: Removed.
            * svg/dom/svg-length-units.html: Removed. Test is obsolete now, as SVGLength* covers this in detail.
            * svg/dynamic-updates/script-tests/SVGCircleElement-svgdom-cx-prop.js:
            (executeTest): Fixed StrictTypeChecking correctness, don't assign strings as SVGLength value.
            * svg/dynamic-updates/script-tests/SVGCircleElement-svgdom-cy-prop.js:
            (executeTest): Ditto.
            * svg/dynamic-updates/script-tests/SVGCircleElement-svgdom-r-prop.js:
            (executeTest): Ditto.
            * svg/dynamic-updates/script-tests/SVGEllipseElement-svgdom-cx-prop.js:
            (executeTest): Ditto.
            * svg/dynamic-updates/script-tests/SVGEllipseElement-svgdom-cy-prop.js:
            (executeTest): Ditto.
            * svg/dynamic-updates/script-tests/SVGEllipseElement-svgdom-rx-prop.js:
            (executeTest): Ditto.
            * svg/dynamic-updates/script-tests/SVGEllipseElement-svgdom-ry-prop.js:
            (executeTest): Ditto.
            * svg/dynamic-updates/script-tests/SVGForeignObjectElement-svgdom-height-prop.js:
            (executeTest): Ditto.
            * svg/dynamic-updates/script-tests/SVGForeignObjectElement-svgdom-width-prop.js:
            (executeTest): Ditto.
            * svg/dynamic-updates/script-tests/SVGForeignObjectElement-svgdom-x-prop.js:
            (executeTest): Ditto.
            * svg/dynamic-updates/script-tests/SVGForeignObjectElement-svgdom-y-prop.js:
            (executeTest): Ditto.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71014 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 7bec30e..2993072 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,70 @@
+2010-11-01  Nikolas Zimmermann  <nzimmermann at rim.com>
+
+        Reviewed by Rob Buis.
+
+        Enable StrictTypeChecking for all types using SVG(Animated)PropertyTearOff
+        https://bugs.webkit.org/show_bug.cgi?id=48715
+
+        * svg/dom/SVGAngle-expected.txt:
+        * svg/dom/SVGAnimatedAngle-expected.txt: Added.
+        * svg/dom/SVGAnimatedAngle.html: Added.
+        * svg/dom/SVGAnimatedBoolean-expected.txt: Copied from LayoutTests/svg/dom/SVGExternalResourcesRequired-expected.txt.
+        * svg/dom/SVGAnimatedBoolean.html: Copied from LayoutTests/svg/dom/SVGExternalResourcesRequired.html.
+        * svg/dom/SVGAnimatedEnumeration-expected.txt: Added.
+        * svg/dom/SVGAnimatedEnumeration.html: Added.
+        * svg/dom/SVGAnimatedInteger-expected.txt: Added.
+        * svg/dom/SVGAnimatedInteger.html: Added.
+        * svg/dom/SVGAnimatedLength-expected.txt: Added.
+        * svg/dom/SVGAnimatedLength.html: Added.
+        * svg/dom/SVGAnimatedLengthList-expected.txt: Added.
+        * svg/dom/SVGAnimatedLengthList.html: Added.
+        * svg/dom/SVGAnimatedRect-expected.txt: Added.
+        * svg/dom/SVGAnimatedRect.html: Added.
+        * svg/dom/SVGExternalResourcesRequired-expected.txt: Removed.
+        * svg/dom/SVGExternalResourcesRequired.html: Removed.
+        * svg/dom/SVGLength-expected.txt: Added.
+        * svg/dom/SVGLength-px-expected.txt: Added.
+        * svg/dom/SVGLength-px-with-context-expected.txt: Added.
+        * svg/dom/SVGLength-px-with-context.html: Added.
+        * svg/dom/SVGLength-px.html: Added.
+        * svg/dom/SVGLength.html: Added.
+        * svg/dom/script-tests/SVGAngle.js:
+        * svg/dom/script-tests/SVGAnimatedAngle.js: Added.
+        * svg/dom/script-tests/SVGAnimatedBoolean.js: Copied from LayoutTests/svg/dom/script-tests/SVGExternalResourcesRequired.js.
+        * svg/dom/script-tests/SVGAnimatedEnumeration.js: Added.
+        * svg/dom/script-tests/SVGAnimatedInteger.js: Added.
+        * svg/dom/script-tests/SVGAnimatedLength.js: Added.
+        * svg/dom/script-tests/SVGAnimatedLengthList.js: Added.
+        * svg/dom/script-tests/SVGAnimatedRect.js: Added.
+        * svg/dom/script-tests/SVGExternalResourcesRequired.js: Removed.
+        * svg/dom/script-tests/SVGLength-px-with-context.js: Added. Tests various operations on a SVGLength object obtained via rectElement.x.baseVal.
+        * svg/dom/script-tests/SVGLength-px.js: Added. Tests various operations on a SVGLength object created via svgElement.createSVGLength().
+        * svg/dom/script-tests/SVGLength.js: Added.
+        * svg/dom/svg-length-units-expected.txt: Removed.
+        * svg/dom/svg-length-units.html: Removed. Test is obsolete now, as SVGLength* covers this in detail.
+        * svg/dynamic-updates/script-tests/SVGCircleElement-svgdom-cx-prop.js:
+        (executeTest): Fixed StrictTypeChecking correctness, don't assign strings as SVGLength value.
+        * svg/dynamic-updates/script-tests/SVGCircleElement-svgdom-cy-prop.js:
+        (executeTest): Ditto.
+        * svg/dynamic-updates/script-tests/SVGCircleElement-svgdom-r-prop.js:
+        (executeTest): Ditto.
+        * svg/dynamic-updates/script-tests/SVGEllipseElement-svgdom-cx-prop.js:
+        (executeTest): Ditto.
+        * svg/dynamic-updates/script-tests/SVGEllipseElement-svgdom-cy-prop.js:
+        (executeTest): Ditto.
+        * svg/dynamic-updates/script-tests/SVGEllipseElement-svgdom-rx-prop.js:
+        (executeTest): Ditto.
+        * svg/dynamic-updates/script-tests/SVGEllipseElement-svgdom-ry-prop.js:
+        (executeTest): Ditto.
+        * svg/dynamic-updates/script-tests/SVGForeignObjectElement-svgdom-height-prop.js:
+        (executeTest): Ditto.
+        * svg/dynamic-updates/script-tests/SVGForeignObjectElement-svgdom-width-prop.js:
+        (executeTest): Ditto.
+        * svg/dynamic-updates/script-tests/SVGForeignObjectElement-svgdom-x-prop.js:
+        (executeTest): Ditto.
+        * svg/dynamic-updates/script-tests/SVGForeignObjectElement-svgdom-y-prop.js:
+        (executeTest): Ditto.
+
 2010-11-01  Roland Steiner  <rolandsteiner at chromium.org>
 
         Unreviewed: add failing SVG tests to Chromium test_expectations.txt.
diff --git a/LayoutTests/svg/dom/SVGAngle-expected.txt b/LayoutTests/svg/dom/SVGAngle-expected.txt
index 217c2a2..2f9bf84 100644
--- a/LayoutTests/svg/dom/SVGAngle-expected.txt
+++ b/LayoutTests/svg/dom/SVGAngle-expected.txt
@@ -14,6 +14,10 @@ Check invalid arguments for 'convertToSpecifiedUnits'
 PASS angle.convertToSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_UNKNOWN) threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
 PASS angle.convertToSpecifiedUnits(-1) threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
 PASS angle.convertToSpecifiedUnits(5) threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
+PASS angle.convertToSpecifiedUnits('aString') threw exception TypeError: Type error.
+PASS angle.convertToSpecifiedUnits(angle) threw exception TypeError: Type error.
+PASS angle.convertToSpecifiedUnits(svgElement) threw exception TypeError: Type error.
+PASS angle.convertToSpecifiedUnits() threw exception SyntaxError: Not enough arguments.
 PASS angle.unitType is SVGAngle.SVG_ANGLETYPE_UNSPECIFIED
 
 Check valid arguments for 'convertToSpecifiedUnits', that should only modify the 'valueAsString'
@@ -42,6 +46,18 @@ Check invalid arguments for 'newValueSpecifiedUnits'
 PASS angle.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_UNKNOWN, 50) threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
 PASS angle.newValueSpecifiedUnits(-1, 50) threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
 PASS angle.newValueSpecifiedUnits(5, 50) threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
+PASS angle.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_DEG) threw exception SyntaxError: Not enough arguments.
+PASS angle.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_DEG, 'aString') threw exception TypeError: Type error.
+PASS angle.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_DEG, angle) threw exception TypeError: Type error.
+PASS angle.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_DEG, svgElement) threw exception TypeError: Type error.
+PASS angle.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_DEG) threw exception SyntaxError: Not enough arguments.
+PASS angle.newValueSpecifiedUnits('aString', 4) threw exception TypeError: Type error.
+PASS angle.newValueSpecifiedUnits(angle, 4) threw exception TypeError: Type error.
+PASS angle.newValueSpecifiedUnits(svgElement, 4) threw exception TypeError: Type error.
+PASS angle.newValueSpecifiedUnits('aString', 'aString') threw exception TypeError: Type error.
+PASS angle.newValueSpecifiedUnits(angle, angle) threw exception TypeError: Type error.
+PASS angle.newValueSpecifiedUnits(svgElement, svgElement) threw exception TypeError: Type error.
+PASS angle.newValueSpecifiedUnits() threw exception SyntaxError: Not enough arguments.
 PASS angle.unitType is SVGAngle.SVG_ANGLETYPE_UNSPECIFIED
 
 Check valid arguments for 'newValueSpecifiedUnits', that should only modify the 'valueAsString'
diff --git a/LayoutTests/svg/dom/SVGAnimatedAngle-expected.txt b/LayoutTests/svg/dom/SVGAnimatedAngle-expected.txt
new file mode 100644
index 0000000..bbabbaf
--- /dev/null
+++ b/LayoutTests/svg/dom/SVGAnimatedAngle-expected.txt
@@ -0,0 +1,27 @@
+This test checks the SVGAnimatedAngle API - utilizing the orientAngle property of SVGMarkerElement
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+
+Check initial orientAngle value
+PASS markerElement.orientAngle.toString() is "[object SVGAnimatedAngle]"
+PASS markerElement.orientAngle.baseVal.toString() is "[object SVGAngle]"
+PASS markerElement.orientAngle.baseVal.value is 0
+
+Check that angles are dynamic, caching value in a local variable and modifying it, should take effect
+PASS numRef.value is 100
+PASS markerElement.orientAngle.baseVal.value is 100
+
+Check that assigning to baseVal has no effect, as no setter is defined
+PASS markerElement.orientAngle.baseVal = -1 is -1
+PASS markerElement.orientAngle.baseVal = 'aString' is "aString"
+PASS markerElement.orientAngle.baseVal = markerElement is markerElement
+
+Check that the orientAngle value remained 100, and the baseVal type has not been changed
+PASS markerElement.orientAngle.baseVal.toString() is "[object SVGAngle]"
+PASS markerElement.orientAngle.baseVal.value is 100
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/svg/dom/SVGAnimatedAngle.html b/LayoutTests/svg/dom/SVGAnimatedAngle.html
new file mode 100644
index 0000000..5668044
--- /dev/null
+++ b/LayoutTests/svg/dom/SVGAnimatedAngle.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/SVGAnimatedAngle.js"></script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/svg/dom/SVGAnimatedBoolean-expected.txt b/LayoutTests/svg/dom/SVGAnimatedBoolean-expected.txt
new file mode 100644
index 0000000..ca08176
--- /dev/null
+++ b/LayoutTests/svg/dom/SVGAnimatedBoolean-expected.txt
@@ -0,0 +1,34 @@
+This test checks the SVGAnimatedBoolean API - utilizing the externalResourcesRequired property of SVGRectElement
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+
+Check initial SVGExternalResourcesRequired value
+PASS rectElement.externalResourcesRequired.baseVal is false
+
+Set value to true
+PASS rectElement.externalResourcesRequired.baseVal = true is true
+
+Caching baseVal in local variable
+PASS baseVal is true
+
+Modify local baseVal variable to true
+PASS baseVal = false is false
+
+Assure that rectElement.externalResourcesRequired has not been changed, but the local baseVal variable
+PASS baseVal is false
+PASS rectElement.externalResourcesRequired.baseVal is true
+
+Check assigning invalid values
+PASS rectElement.externalResourcesRequired.baseVal = rectElement.externalResourcesRequired threw exception TypeError: Type error.
+PASS rectElement.externalResourcesRequired.baseVal = null is null
+PASS rectElement.externalResourcesRequired.baseVal = 'aString' threw exception TypeError: Type error.
+PASS rectElement.externalResourcesRequired.baseVal = rectElement threw exception TypeError: Type error.
+
+Check that the value is now false
+PASS rectElement.externalResourcesRequired.baseVal is false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/svg/dom/SVGAnimatedBoolean.html b/LayoutTests/svg/dom/SVGAnimatedBoolean.html
new file mode 100644
index 0000000..6c390b6
--- /dev/null
+++ b/LayoutTests/svg/dom/SVGAnimatedBoolean.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/SVGAnimatedBoolean.js"></script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/svg/dom/SVGAnimatedEnumeration-expected.txt b/LayoutTests/svg/dom/SVGAnimatedEnumeration-expected.txt
new file mode 100644
index 0000000..c80b9fb
--- /dev/null
+++ b/LayoutTests/svg/dom/SVGAnimatedEnumeration-expected.txt
@@ -0,0 +1,28 @@
+This test checks the SVGAnimatedEnumeration API - utilizing the clipPathUnits property of SVGClipPathElement
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+
+Check initial clipPathUnits value
+PASS clipPathElement.clipPathUnits.toString() is "[object SVGAnimatedEnumeration]"
+PASS typeof(clipPathElement.clipPathUnits.baseVal) is "number"
+PASS clipPathElement.clipPathUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE
+
+Check that enumerations are static, caching value in a local variable and modifying it, should have no effect
+PASS enumRef is SVGUnitTypes.SVG_UNIT_TYPE_UNKNOWN
+PASS clipPathElement.clipPathUnits.baseVal is SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE
+
+Check assigning various valid and invalid values
+FAIL clipPathElement.clipPathUnits.baseVal = 3 should throw an exception. Was 3.
+PASS clipPathElement.clipPathUnits.baseVal = 2 is SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
+FAIL clipPathElement.clipPathUnits.baseVal = -1 should throw an exception. Was -1.
+PASS clipPathElement.clipPathUnits.baseVal = 'aString' threw exception TypeError: Type error.
+PASS clipPathElement.clipPathUnits.baseVal = clipPathElement threw exception TypeError: Type error.
+
+Check that the clipPathUnits value remained objectBBox
+PASS clipPathElement.clipPathUnits.baseVal = 2 is SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/svg/dom/SVGAnimatedEnumeration.html b/LayoutTests/svg/dom/SVGAnimatedEnumeration.html
new file mode 100644
index 0000000..cf8cb76
--- /dev/null
+++ b/LayoutTests/svg/dom/SVGAnimatedEnumeration.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/SVGAnimatedEnumeration.js"></script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/svg/dom/SVGAnimatedInteger-expected.txt b/LayoutTests/svg/dom/SVGAnimatedInteger-expected.txt
new file mode 100644
index 0000000..1e5f6b1
--- /dev/null
+++ b/LayoutTests/svg/dom/SVGAnimatedInteger-expected.txt
@@ -0,0 +1,27 @@
+This test checks the SVGAnimatedInteger API - utilizing the filterResX property of SVGFilterElement
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+
+Check initial filterResX value
+PASS filterElement.filterResX.toString() is "[object SVGAnimatedInteger]"
+PASS typeof(filterElement.filterResX.baseVal) is "number"
+PASS filterElement.filterResX.baseVal is 0
+
+Check that integers are static, caching value in a local variable and modifying it, should have no effect
+PASS numRef is 100
+PASS filterElement.filterResX.baseVal is 0
+
+Check assigning various valid and invalid values
+PASS filterElement.filterResX.baseVal = -1 is -1
+PASS filterElement.filterResX.baseVal = 300 is 300
+PASS filterElement.filterResX.baseVal = 'aString' threw exception TypeError: Type error.
+PASS filterElement.filterResX.baseVal = filterElement threw exception TypeError: Type error.
+
+Check that the filterResX value remained 300
+PASS filterElement.filterResX.baseVal = 300 is 300
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/svg/dom/SVGAnimatedInteger.html b/LayoutTests/svg/dom/SVGAnimatedInteger.html
new file mode 100644
index 0000000..fbda935
--- /dev/null
+++ b/LayoutTests/svg/dom/SVGAnimatedInteger.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/SVGAnimatedInteger.js"></script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/svg/dom/SVGAnimatedLength-expected.txt b/LayoutTests/svg/dom/SVGAnimatedLength-expected.txt
new file mode 100644
index 0000000..fa21a69
--- /dev/null
+++ b/LayoutTests/svg/dom/SVGAnimatedLength-expected.txt
@@ -0,0 +1,27 @@
+This test checks the SVGAnimatedLength API - utilizing the width property of SVGRectElement
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+
+Check initial width value
+PASS rectElement.width.toString() is "[object SVGAnimatedLength]"
+PASS rectElement.width.baseVal.toString() is "[object SVGLength]"
+PASS rectElement.width.baseVal.value is 0
+
+Check that lengths are dynamic, caching value in a local variable and modifying it, should take effect
+PASS numRef.value is 100
+PASS rectElement.width.baseVal.value is 100
+
+Check that assigning to baseVal has no effect, as no setter is defined
+PASS rectElement.width.baseVal = -1 is -1
+PASS rectElement.width.baseVal = 'aString' is "aString"
+PASS rectElement.width.baseVal = rectElement is rectElement
+
+Check that the width value remained 100, and the baseVal type has not been changed
+PASS rectElement.width.baseVal.toString() is "[object SVGLength]"
+PASS rectElement.width.baseVal.value is 100
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/svg/dom/SVGAnimatedLength.html b/LayoutTests/svg/dom/SVGAnimatedLength.html
new file mode 100644
index 0000000..5189718
--- /dev/null
+++ b/LayoutTests/svg/dom/SVGAnimatedLength.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/SVGAnimatedLength.js"></script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/svg/dom/SVGAnimatedLengthList-expected.txt b/LayoutTests/svg/dom/SVGAnimatedLengthList-expected.txt
new file mode 100644
index 0000000..ab46020
--- /dev/null
+++ b/LayoutTests/svg/dom/SVGAnimatedLengthList-expected.txt
@@ -0,0 +1,27 @@
+This test checks the SVGAnimatedLengthList API - utilizing the dx property of SVGTextElement
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+
+Check initial dx value
+PASS textElement.dx.toString() is "[object SVGAnimatedLengthList]"
+PASS textElement.dx.baseVal.toString() is "[object SVGLengthList]"
+PASS textElement.dx.baseVal.getItem(0).value is 50
+
+Check that length lists are dynamic, caching value in a local variable and modifying it, should take effect
+PASS numRef.getItem(0).value is 100
+PASS textElement.dx.baseVal.getItem(0).value is 100
+
+Check that assigning to baseVal has no effect, as no setter is defined
+PASS textElement.dx.baseVal = -1 is -1
+PASS textElement.dx.baseVal = 'aString' is "aString"
+PASS textElement.dx.baseVal = textElement is textElement
+
+Check that the dx value remained 100, and the baseVal type has not been changed
+PASS textElement.dx.baseVal.toString() is "[object SVGLengthList]"
+PASS textElement.dx.baseVal.getItem(0).value is 100
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/svg/dom/SVGAnimatedLengthList.html b/LayoutTests/svg/dom/SVGAnimatedLengthList.html
new file mode 100644
index 0000000..bc9c2ce
--- /dev/null
+++ b/LayoutTests/svg/dom/SVGAnimatedLengthList.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/SVGAnimatedLengthList.js"></script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/svg/dom/SVGAnimatedNumberList-expected.txt b/LayoutTests/svg/dom/SVGAnimatedNumberList-expected.txt
index beb93bc..bff3bd9 100644
--- a/LayoutTests/svg/dom/SVGAnimatedNumberList-expected.txt
+++ b/LayoutTests/svg/dom/SVGAnimatedNumberList-expected.txt
@@ -13,7 +13,7 @@ Check that number lists are dynamic, caching value in a local variable and modif
 PASS numRef.getItem(0).value is 100
 PASS textElement.rotate.baseVal.getItem(0).value is 100
 
-Check assigning to baseVal has no effect, as no setter is defined
+Check that assigning to baseVal has no effect, as no setter is defined
 PASS textElement.rotate.baseVal = -1 is -1
 PASS textElement.rotate.baseVal = 'aString' is "aString"
 PASS textElement.rotate.baseVal = textElement is textElement
diff --git a/LayoutTests/svg/dom/SVGAnimatedRect-expected.txt b/LayoutTests/svg/dom/SVGAnimatedRect-expected.txt
new file mode 100644
index 0000000..8946c41
--- /dev/null
+++ b/LayoutTests/svg/dom/SVGAnimatedRect-expected.txt
@@ -0,0 +1,27 @@
+This test checks the SVGAnimatedRect API - utilizing the viewBox property of SVGSVGElement
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+
+Check initial viewBox value
+PASS svgElement.viewBox.toString() is "[object SVGAnimatedRect]"
+PASS svgElement.viewBox.baseVal.toString() is "[object SVGRect]"
+PASS svgElement.viewBox.baseVal.x is 0
+
+Check that rects are dynamic, caching value in a local variable and modifying it, should take effect
+PASS numRef.x is 100
+PASS svgElement.viewBox.baseVal.x is 100
+
+Check that assigning to baseVal has no effect, as no setter is defined
+PASS svgElement.viewBox.baseVal = -1 is -1
+PASS svgElement.viewBox.baseVal = 'aString' is "aString"
+PASS svgElement.viewBox.baseVal = svgElement is svgElement
+
+Check that the viewBox x remained 100, and the baseVal type has not been changed
+PASS svgElement.viewBox.baseVal.toString() is "[object SVGRect]"
+PASS svgElement.viewBox.baseVal.x is 100
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/svg/dom/SVGAnimatedRect.html b/LayoutTests/svg/dom/SVGAnimatedRect.html
new file mode 100644
index 0000000..d15d4b2
--- /dev/null
+++ b/LayoutTests/svg/dom/SVGAnimatedRect.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/SVGAnimatedRect.js"></script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/svg/dom/SVGExternalResourcesRequired-expected.txt b/LayoutTests/svg/dom/SVGExternalResourcesRequired-expected.txt
deleted file mode 100644
index 844e7cd..0000000
--- a/LayoutTests/svg/dom/SVGExternalResourcesRequired-expected.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-This test checks the SVGExternalResourcesRequired API
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-
-Check initial SVGExternalResourcesRequired value
-PASS rectElement.externalResourcesRequired.baseVal is false
-
-Set value to true
-PASS rectElement.externalResourcesRequired.baseVal = true is true
-
-Caching baseVal in local variable
-PASS baseVal is true
-
-Modify local baseVal variable to true
-PASS baseVal = false is false
-
-Assure that rectElement.externalResourcesRequired has not been changed, but the local baseVal variable
-PASS baseVal is false
-PASS rectElement.externalResourcesRequired.baseVal is true
-
-Check assigning invalid values
-PASS rectElement.externalResourcesRequired.baseVal = rectElement.externalResourcesRequired threw exception TypeError: Type error.
-PASS rectElement.externalResourcesRequired.baseVal = null is null
-PASS rectElement.externalResourcesRequired.baseVal = 'aString' threw exception TypeError: Type error.
-PASS rectElement.externalResourcesRequired.baseVal = rectElement threw exception TypeError: Type error.
-
-Check that the value is now false
-PASS rectElement.externalResourcesRequired.baseVal is false
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/LayoutTests/svg/dom/SVGExternalResourcesRequired.html b/LayoutTests/svg/dom/SVGExternalResourcesRequired.html
deleted file mode 100644
index 610acd7..0000000
--- a/LayoutTests/svg/dom/SVGExternalResourcesRequired.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<head>
-<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
-<script src="../../fast/js/resources/js-test-pre.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-<script src="script-tests/SVGExternalResourcesRequired.js"></script>
-<script src="../../fast/js/resources/js-test-post.js"></script>
-</body>
-</html>
diff --git a/LayoutTests/svg/dom/SVGLength-expected.txt b/LayoutTests/svg/dom/SVGLength-expected.txt
new file mode 100644
index 0000000..a4b50ad
--- /dev/null
+++ b/LayoutTests/svg/dom/SVGLength-expected.txt
@@ -0,0 +1,53 @@
+This test checks the SVGLength API
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+
+Check initial length values
+PASS length.unitType is SVGLength.SVG_LENGTHTYPE_NUMBER
+PASS length.value is 0
+PASS length.valueInSpecifiedUnits is 0
+PASS length.valueAsString is "0"
+
+Set value to be 2px
+PASS length.unitType is SVGLength.SVG_LENGTHTYPE_PX
+PASS length.value is 2
+PASS length.valueInSpecifiedUnits is 2
+PASS length.valueAsString is "2px"
+
+Check invalid arguments for 'convertToSpecifiedUnits'
+PASS length.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_UNKNOWN) threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
+PASS length.convertToSpecifiedUnits(-1) threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
+PASS length.convertToSpecifiedUnits(11) threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
+PASS length.convertToSpecifiedUnits('aString') threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
+PASS length.convertToSpecifiedUnits(length) threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
+PASS length.convertToSpecifiedUnits(svgElement) threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
+PASS length.convertToSpecifiedUnits() threw exception SyntaxError: Not enough arguments.
+PASS length.unitType is SVGLength.SVG_LENGTHTYPE_PX
+PASS length.value is 2
+PASS length.valueInSpecifiedUnits is 2
+PASS length.unitType is SVGLength.SVG_LENGTHTYPE_PX
+
+Check invalid arguments for 'newValueSpecifiedUnits'
+PASS length.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_UNKNOWN, 4) threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
+PASS length.newValueSpecifiedUnits(-1, 4) threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
+PASS length.newValueSpecifiedUnits(11, 4) threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
+PASS length.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PX, 'aString') threw exception TypeError: Type error.
+PASS length.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PX, length) threw exception TypeError: Type error.
+PASS length.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PX, svgElement) threw exception TypeError: Type error.
+PASS length.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PX) threw exception SyntaxError: Not enough arguments.
+PASS length.newValueSpecifiedUnits('aString', 4) threw exception TypeError: Type error.
+PASS length.newValueSpecifiedUnits(length, 4) threw exception TypeError: Type error.
+PASS length.newValueSpecifiedUnits(svgElement, 4) threw exception TypeError: Type error.
+PASS length.newValueSpecifiedUnits('aString', 'aString') threw exception TypeError: Type error.
+PASS length.newValueSpecifiedUnits(length, length) threw exception TypeError: Type error.
+PASS length.newValueSpecifiedUnits(svgElement, svgElement) threw exception TypeError: Type error.
+PASS length.unitType is SVGLength.SVG_LENGTHTYPE_PX
+PASS length.value is 2
+PASS length.valueInSpecifiedUnits is 2
+PASS length.unitType is SVGLength.SVG_LENGTHTYPE_PX
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/svg/dom/SVGLength-px-expected.txt b/LayoutTests/svg/dom/SVGLength-px-expected.txt
new file mode 100644
index 0000000..99b3896
--- /dev/null
+++ b/LayoutTests/svg/dom/SVGLength-px-expected.txt
@@ -0,0 +1,93 @@
+This test checks SVGLength - converting from px to all other unit types
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+
+Set value to be 2px
+PASS length.unitType is SVGLength.SVG_LENGTHTYPE_PX
+PASS length.value is 2
+PASS length.valueInSpecifiedUnits is 2
+PASS length.valueAsString is "2px"
+
+Convert from px to unitless
+PASS length.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_NUMBER) is undefined.
+PASS length.valueAsString is "2"
+PASS length.value is 2
+PASS length.valueInSpecifiedUnits is 2
+PASS length.unitType is SVGLength.SVG_LENGTHTYPE_NUMBER
+
+Reset to 2px
+
+Try converting from px to percentage, should fail as the SVGLength is not associated with a SVGSVGElement, and thus no viewport information is available
+PASS length.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PERCENTAGE) threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
+PASS length.valueAsString is "2px"
+PASS length.value is 2
+PASS length.valueInSpecifiedUnits is 2
+PASS length.unitType is SVGLength.SVG_LENGTHTYPE_PX
+
+Reset to 2px
+
+Try converting from px to ems, should fail as the SVGLength is not associated with a SVGSVGElement, and thus no font-size information is available
+PASS length.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_EMS) threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
+PASS length.valueAsString is "2px"
+PASS length.value is 2
+PASS length.valueInSpecifiedUnits is 2
+PASS length.unitType is SVGLength.SVG_LENGTHTYPE_PX
+
+Reset to 2px
+
+Try converting from px to exs, should fail as the SVGLength is not associated with a SVGSVGElement, and thus no font-size information is available
+PASS length.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_EXS) threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
+PASS length.valueAsString is "2px"
+PASS length.value is 2
+PASS length.valueInSpecifiedUnits is 2
+PASS length.unitType is SVGLength.SVG_LENGTHTYPE_PX
+
+Reset to 2px
+
+Convert from px to cm
+PASS length.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_CM) is undefined.
+PASS length.valueAsString is "0.0529167cm"
+PASS length.valueInSpecifiedUnits.toFixed(7) is "0.0529167"
+PASS length.value.toFixed(1) is "2.0"
+PASS length.unitType is SVGLength.SVG_LENGTHTYPE_CM
+
+Reset to 2px
+
+Convert from px to mm
+PASS length.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_MM) is undefined.
+PASS length.valueAsString is "0.529167mm"
+PASS length.valueInSpecifiedUnits.toFixed(6) is "0.529167"
+PASS length.value.toFixed(1) is "2.0"
+PASS length.unitType is SVGLength.SVG_LENGTHTYPE_MM
+
+Reset to 2px
+
+Convert from px to in
+PASS length.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_IN) is undefined.
+PASS length.valueAsString is "0.0208333in"
+PASS length.valueInSpecifiedUnits.toFixed(7) is "0.0208333"
+PASS length.value.toFixed(1) is "2.0"
+PASS length.unitType is SVGLength.SVG_LENGTHTYPE_IN
+
+Reset to 2px
+
+Convert from px to pt
+PASS length.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PT) is undefined.
+PASS length.valueAsString is "1.5pt"
+PASS length.valueInSpecifiedUnits is 1.5
+PASS length.value.toFixed(1) is "2.0"
+PASS length.unitType is SVGLength.SVG_LENGTHTYPE_PT
+
+Reset to 2px
+
+Convert from px to pc
+PASS length.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PC) is undefined.
+PASS length.valueInSpecifiedUnits.toFixed(3) is "0.125"
+PASS length.value.toFixed(1) is "2.0"
+PASS length.unitType is SVGLength.SVG_LENGTHTYPE_PC
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/svg/dom/SVGLength-px-with-context-expected.txt b/LayoutTests/svg/dom/SVGLength-px-with-context-expected.txt
new file mode 100644
index 0000000..e1833e0
--- /dev/null
+++ b/LayoutTests/svg/dom/SVGLength-px-with-context-expected.txt
@@ -0,0 +1,92 @@
+This test checks SVGLength - converting from px to all other unit types
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+
+Set value to be 2px
+PASS length.unitType is SVGLength.SVG_LENGTHTYPE_PX
+PASS length.value is 2
+PASS length.valueInSpecifiedUnits is 2
+PASS length.valueAsString is "2px"
+
+Convert from px to unitless
+PASS length.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_NUMBER) is undefined.
+PASS length.valueAsString is "2"
+PASS length.value is 2
+PASS length.valueInSpecifiedUnits is 2
+PASS length.unitType is SVGLength.SVG_LENGTHTYPE_NUMBER
+
+Reset to 2px
+
+Convert from px to percentage
+PASS length.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PERCENTAGE) is undefined.
+PASS length.valueAsString is "1.33333%"
+PASS length.valueInSpecifiedUnits.toFixed(5) is "1.33333"
+PASS length.value.toFixed(1) is "2.0"
+PASS length.unitType is SVGLength.SVG_LENGTHTYPE_PERCENTAGE
+
+Reset to 2px
+
+Convert from px to ems
+PASS length.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_EMS) is undefined.
+PASS length.valueAsString is "0.166667em"
+PASS length.valueInSpecifiedUnits.toFixed(6) is "0.166667"
+PASS length.value.toFixed(1) is "2.0"
+PASS length.unitType is SVGLength.SVG_LENGTHTYPE_EMS
+
+Reset to 2px
+
+Convert from px to exs
+PASS length.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_EXS) is undefined.
+PASS length.valueInSpecifiedUnits.toFixed(1) is "0.2"
+PASS length.value.toFixed(1) is "2.0"
+PASS length.unitType is SVGLength.SVG_LENGTHTYPE_EXS
+
+Reset to 2px
+
+Convert from px to cm
+PASS length.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_CM) is undefined.
+PASS length.valueAsString is "0.0529167cm"
+PASS length.valueInSpecifiedUnits.toFixed(7) is "0.0529167"
+PASS length.value.toFixed(1) is "2.0"
+PASS length.unitType is SVGLength.SVG_LENGTHTYPE_CM
+
+Reset to 2px
+
+Convert from px to mm
+PASS length.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_MM) is undefined.
+PASS length.valueAsString is "0.529167mm"
+PASS length.valueInSpecifiedUnits.toFixed(6) is "0.529167"
+PASS length.value.toFixed(1) is "2.0"
+PASS length.unitType is SVGLength.SVG_LENGTHTYPE_MM
+
+Reset to 2px
+
+Convert from px to in
+PASS length.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_IN) is undefined.
+PASS length.valueAsString is "0.0208333in"
+PASS length.valueInSpecifiedUnits.toFixed(7) is "0.0208333"
+PASS length.value.toFixed(1) is "2.0"
+PASS length.unitType is SVGLength.SVG_LENGTHTYPE_IN
+
+Reset to 2px
+
+Convert from px to pt
+PASS length.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PT) is undefined.
+PASS length.valueAsString is "1.5pt"
+PASS length.valueInSpecifiedUnits is 1.5
+PASS length.value.toFixed(1) is "2.0"
+PASS length.unitType is SVGLength.SVG_LENGTHTYPE_PT
+
+Reset to 2px
+
+Convert from px to pc
+PASS length.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PC) is undefined.
+PASS length.valueInSpecifiedUnits.toFixed(3) is "0.125"
+PASS length.value.toFixed(1) is "2.0"
+PASS length.unitType is SVGLength.SVG_LENGTHTYPE_PC
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/svg/dom/SVGLength-px-with-context.html b/LayoutTests/svg/dom/SVGLength-px-with-context.html
new file mode 100644
index 0000000..0171a48
--- /dev/null
+++ b/LayoutTests/svg/dom/SVGLength-px-with-context.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/SVGLength-px-with-context.js"></script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/svg/dom/SVGLength-px.html b/LayoutTests/svg/dom/SVGLength-px.html
new file mode 100644
index 0000000..abd0f89
--- /dev/null
+++ b/LayoutTests/svg/dom/SVGLength-px.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/SVGLength-px.js"></script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/svg/dom/SVGLength.html b/LayoutTests/svg/dom/SVGLength.html
new file mode 100644
index 0000000..e3059bb
--- /dev/null
+++ b/LayoutTests/svg/dom/SVGLength.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/SVGLength.js"></script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/svg/dom/script-tests/SVGAngle.js b/LayoutTests/svg/dom/script-tests/SVGAngle.js
index c772946..d544d41 100644
--- a/LayoutTests/svg/dom/script-tests/SVGAngle.js
+++ b/LayoutTests/svg/dom/script-tests/SVGAngle.js
@@ -16,6 +16,10 @@ debug("Check invalid arguments for 'convertToSpecifiedUnits'");
 shouldThrow("angle.convertToSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_UNKNOWN)");
 shouldThrow("angle.convertToSpecifiedUnits(-1)");
 shouldThrow("angle.convertToSpecifiedUnits(5)");
+shouldThrow("angle.convertToSpecifiedUnits('aString')");
+shouldThrow("angle.convertToSpecifiedUnits(angle)");
+shouldThrow("angle.convertToSpecifiedUnits(svgElement)");
+shouldThrow("angle.convertToSpecifiedUnits()");
 shouldBe("angle.unitType", "SVGAngle.SVG_ANGLETYPE_UNSPECIFIED");
 
 debug("");
@@ -50,6 +54,18 @@ debug("Check invalid arguments for 'newValueSpecifiedUnits'");
 shouldThrow("angle.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_UNKNOWN, 50)");
 shouldThrow("angle.newValueSpecifiedUnits(-1, 50)");
 shouldThrow("angle.newValueSpecifiedUnits(5, 50)");
+shouldThrow("angle.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_DEG)");
+shouldThrow("angle.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_DEG, 'aString')");
+shouldThrow("angle.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_DEG, angle)");
+shouldThrow("angle.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_DEG, svgElement)");
+shouldThrow("angle.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_DEG)");
+shouldThrow("angle.newValueSpecifiedUnits('aString', 4)");
+shouldThrow("angle.newValueSpecifiedUnits(angle, 4)");
+shouldThrow("angle.newValueSpecifiedUnits(svgElement, 4)");
+shouldThrow("angle.newValueSpecifiedUnits('aString', 'aString')");
+shouldThrow("angle.newValueSpecifiedUnits(angle, angle)");
+shouldThrow("angle.newValueSpecifiedUnits(svgElement, svgElement)");
+shouldThrow("angle.newValueSpecifiedUnits()");
 shouldBe("angle.unitType", "SVGAngle.SVG_ANGLETYPE_UNSPECIFIED");
 
 debug("");
diff --git a/LayoutTests/svg/dom/script-tests/SVGAnimatedAngle.js b/LayoutTests/svg/dom/script-tests/SVGAnimatedAngle.js
new file mode 100644
index 0000000..9fa2bb1
--- /dev/null
+++ b/LayoutTests/svg/dom/script-tests/SVGAnimatedAngle.js
@@ -0,0 +1,29 @@
+description("This test checks the SVGAnimatedAngle API - utilizing the orientAngle property of SVGMarkerElement");
+
+var markerElement = document.createElementNS("http://www.w3.org/2000/svg", "marker");
+
+debug("");
+debug("Check initial orientAngle value");
+shouldBeEqualToString("markerElement.orientAngle.toString()", "[object SVGAnimatedAngle]");
+shouldBeEqualToString("markerElement.orientAngle.baseVal.toString()", "[object SVGAngle]");
+shouldBe("markerElement.orientAngle.baseVal.value", "0");
+
+debug("");
+debug("Check that angles are dynamic, caching value in a local variable and modifying it, should take effect");
+var numRef = markerElement.orientAngle.baseVal;
+numRef.value = 100;
+shouldBe("numRef.value", "100");
+shouldBe("markerElement.orientAngle.baseVal.value", "100");
+
+debug("");
+debug("Check that assigning to baseVal has no effect, as no setter is defined");
+shouldBe("markerElement.orientAngle.baseVal = -1", "-1");
+shouldBeEqualToString("markerElement.orientAngle.baseVal = 'aString'", "aString");
+shouldBe("markerElement.orientAngle.baseVal = markerElement", "markerElement");
+
+debug("");
+debug("Check that the orientAngle value remained 100, and the baseVal type has not been changed");
+shouldBeEqualToString("markerElement.orientAngle.baseVal.toString()", "[object SVGAngle]");
+shouldBe("markerElement.orientAngle.baseVal.value", "100");
+
+successfullyParsed = true;
diff --git a/LayoutTests/svg/dom/script-tests/SVGAnimatedBoolean.js b/LayoutTests/svg/dom/script-tests/SVGAnimatedBoolean.js
new file mode 100644
index 0000000..ecc8a90
--- /dev/null
+++ b/LayoutTests/svg/dom/script-tests/SVGAnimatedBoolean.js
@@ -0,0 +1,37 @@
+description("This test checks the SVGAnimatedBoolean API - utilizing the externalResourcesRequired property of SVGRectElement");
+
+var rectElement = document.createElementNS("http://www.w3.org/2000/svg", "rect");
+debug("");
+debug("Check initial SVGExternalResourcesRequired value");
+shouldBe("rectElement.externalResourcesRequired.baseVal", "false");
+
+debug("");
+debug("Set value to true");
+shouldBe("rectElement.externalResourcesRequired.baseVal = true", "true");
+
+debug("");
+debug("Caching baseVal in local variable");
+var baseVal = rectElement.externalResourcesRequired.baseVal;
+shouldBe("baseVal", "true");
+
+debug("");
+debug("Modify local baseVal variable to true");
+shouldBeFalse("baseVal = false");
+
+debug("");
+debug("Assure that rectElement.externalResourcesRequired has not been changed, but the local baseVal variable");
+shouldBe("baseVal", "false");
+shouldBe("rectElement.externalResourcesRequired.baseVal", "true");
+
+debug("");
+debug("Check assigning invalid values");
+shouldThrow("rectElement.externalResourcesRequired.baseVal = rectElement.externalResourcesRequired");
+shouldBeNull("rectElement.externalResourcesRequired.baseVal = null");
+shouldThrow("rectElement.externalResourcesRequired.baseVal = 'aString'");
+shouldThrow("rectElement.externalResourcesRequired.baseVal = rectElement");
+
+debug("");
+debug("Check that the value is now false");
+shouldBe("rectElement.externalResourcesRequired.baseVal", "false");
+
+successfullyParsed = true;
diff --git a/LayoutTests/svg/dom/script-tests/SVGAnimatedEnumeration.js b/LayoutTests/svg/dom/script-tests/SVGAnimatedEnumeration.js
new file mode 100644
index 0000000..7bb637c
--- /dev/null
+++ b/LayoutTests/svg/dom/script-tests/SVGAnimatedEnumeration.js
@@ -0,0 +1,30 @@
+description("This test checks the SVGAnimatedEnumeration API - utilizing the clipPathUnits property of SVGClipPathElement");
+
+var clipPathElement = document.createElementNS("http://www.w3.org/2000/svg", "clipPath");
+
+debug("");
+debug("Check initial clipPathUnits value");
+shouldBeEqualToString("clipPathElement.clipPathUnits.toString()", "[object SVGAnimatedEnumeration]");
+shouldBeEqualToString("typeof(clipPathElement.clipPathUnits.baseVal)", "number");
+shouldBe("clipPathElement.clipPathUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE");
+
+debug("");
+debug("Check that enumerations are static, caching value in a local variable and modifying it, should have no effect");
+var enumRef = clipPathElement.clipPathUnits.baseVal;
+enumRef = SVGUnitTypes.SVG_UNIT_TYPE_UNKNOWN;
+shouldBe("enumRef", "SVGUnitTypes.SVG_UNIT_TYPE_UNKNOWN");
+shouldBe("clipPathElement.clipPathUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE");
+
+debug("");
+debug("Check assigning various valid and invalid values");
+shouldThrow("clipPathElement.clipPathUnits.baseVal = 3"); // FIXME: Doesn't throw in WebKit, we're not clamping to the allowed range.
+shouldBe("clipPathElement.clipPathUnits.baseVal = 2", "SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX");
+shouldThrow("clipPathElement.clipPathUnits.baseVal = -1"); // FIXME: Doesn't throw in WebKit, we're not clamping to the allowed range.
+shouldThrow("clipPathElement.clipPathUnits.baseVal = 'aString'");
+shouldThrow("clipPathElement.clipPathUnits.baseVal = clipPathElement");
+
+debug("");
+debug("Check that the clipPathUnits value remained objectBBox");
+shouldBe("clipPathElement.clipPathUnits.baseVal = 2", "SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX");
+
+successfullyParsed = true;
diff --git a/LayoutTests/svg/dom/script-tests/SVGAnimatedInteger.js b/LayoutTests/svg/dom/script-tests/SVGAnimatedInteger.js
new file mode 100644
index 0000000..184e848
--- /dev/null
+++ b/LayoutTests/svg/dom/script-tests/SVGAnimatedInteger.js
@@ -0,0 +1,29 @@
+description("This test checks the SVGAnimatedInteger API - utilizing the filterResX property of SVGFilterElement");
+
+var filterElement = document.createElementNS("http://www.w3.org/2000/svg", "filter");
+
+debug("");
+debug("Check initial filterResX value");
+shouldBeEqualToString("filterElement.filterResX.toString()", "[object SVGAnimatedInteger]");
+shouldBeEqualToString("typeof(filterElement.filterResX.baseVal)", "number");
+shouldBe("filterElement.filterResX.baseVal", "0");
+
+debug("");
+debug("Check that integers are static, caching value in a local variable and modifying it, should have no effect");
+var numRef = filterElement.filterResX.baseVal;
+numRef = 100;
+shouldBe("numRef", "100");
+shouldBe("filterElement.filterResX.baseVal", "0");
+
+debug("");
+debug("Check assigning various valid and invalid values");
+shouldBe("filterElement.filterResX.baseVal = -1", "-1"); // Negative values are allowed from SVG DOM, but should lead to an error when rendering (disable the filter)
+shouldBe("filterElement.filterResX.baseVal = 300", "300");
+shouldThrow("filterElement.filterResX.baseVal = 'aString'");
+shouldThrow("filterElement.filterResX.baseVal = filterElement");
+
+debug("");
+debug("Check that the filterResX value remained 300");
+shouldBe("filterElement.filterResX.baseVal = 300", "300");
+
+successfullyParsed = true;
diff --git a/LayoutTests/svg/dom/script-tests/SVGAnimatedLength.js b/LayoutTests/svg/dom/script-tests/SVGAnimatedLength.js
new file mode 100644
index 0000000..7f499a2
--- /dev/null
+++ b/LayoutTests/svg/dom/script-tests/SVGAnimatedLength.js
@@ -0,0 +1,29 @@
+description("This test checks the SVGAnimatedLength API - utilizing the width property of SVGRectElement");
+
+var rectElement = document.createElementNS("http://www.w3.org/2000/svg", "rect");
+
+debug("");
+debug("Check initial width value");
+shouldBeEqualToString("rectElement.width.toString()", "[object SVGAnimatedLength]");
+shouldBeEqualToString("rectElement.width.baseVal.toString()", "[object SVGLength]");
+shouldBe("rectElement.width.baseVal.value", "0");
+
+debug("");
+debug("Check that lengths are dynamic, caching value in a local variable and modifying it, should take effect");
+var numRef = rectElement.width.baseVal;
+numRef.value = 100;
+shouldBe("numRef.value", "100");
+shouldBe("rectElement.width.baseVal.value", "100");
+
+debug("");
+debug("Check that assigning to baseVal has no effect, as no setter is defined");
+shouldBe("rectElement.width.baseVal = -1", "-1");
+shouldBeEqualToString("rectElement.width.baseVal = 'aString'", "aString");
+shouldBe("rectElement.width.baseVal = rectElement", "rectElement");
+
+debug("");
+debug("Check that the width value remained 100, and the baseVal type has not been changed");
+shouldBeEqualToString("rectElement.width.baseVal.toString()", "[object SVGLength]");
+shouldBe("rectElement.width.baseVal.value", "100");
+
+successfullyParsed = true;
diff --git a/LayoutTests/svg/dom/script-tests/SVGAnimatedLengthList.js b/LayoutTests/svg/dom/script-tests/SVGAnimatedLengthList.js
new file mode 100644
index 0000000..1cc7668
--- /dev/null
+++ b/LayoutTests/svg/dom/script-tests/SVGAnimatedLengthList.js
@@ -0,0 +1,30 @@
+description("This test checks the SVGAnimatedLengthList API - utilizing the dx property of SVGTextElement");
+
+var textElement = document.createElementNS("http://www.w3.org/2000/svg", "text");
+textElement.setAttribute("dx", "50");
+
+debug("");
+debug("Check initial dx value");
+shouldBeEqualToString("textElement.dx.toString()", "[object SVGAnimatedLengthList]");
+shouldBeEqualToString("textElement.dx.baseVal.toString()", "[object SVGLengthList]");
+shouldBe("textElement.dx.baseVal.getItem(0).value", "50");
+
+debug("");
+debug("Check that length lists are dynamic, caching value in a local variable and modifying it, should take effect");
+var numRef = textElement.dx.baseVal;
+numRef.getItem(0).value = 100;
+shouldBe("numRef.getItem(0).value", "100");
+shouldBe("textElement.dx.baseVal.getItem(0).value", "100");
+
+debug("");
+debug("Check that assigning to baseVal has no effect, as no setter is defined");
+shouldBe("textElement.dx.baseVal = -1", "-1");
+shouldBeEqualToString("textElement.dx.baseVal = 'aString'", "aString");
+shouldBe("textElement.dx.baseVal = textElement", "textElement");
+
+debug("");
+debug("Check that the dx value remained 100, and the baseVal type has not been changed");
+shouldBeEqualToString("textElement.dx.baseVal.toString()", "[object SVGLengthList]");
+shouldBe("textElement.dx.baseVal.getItem(0).value", "100");
+
+successfullyParsed = true;
diff --git a/LayoutTests/svg/dom/script-tests/SVGAnimatedNumberList.js b/LayoutTests/svg/dom/script-tests/SVGAnimatedNumberList.js
index bde0544..c4516b4 100644
--- a/LayoutTests/svg/dom/script-tests/SVGAnimatedNumberList.js
+++ b/LayoutTests/svg/dom/script-tests/SVGAnimatedNumberList.js
@@ -17,7 +17,7 @@ shouldBe("numRef.getItem(0).value", "100");
 shouldBe("textElement.rotate.baseVal.getItem(0).value", "100");
 
 debug("");
-debug("Check assigning to baseVal has no effect, as no setter is defined");
+debug("Check that assigning to baseVal has no effect, as no setter is defined");
 shouldBe("textElement.rotate.baseVal = -1", "-1");
 shouldBeEqualToString("textElement.rotate.baseVal = 'aString'", "aString");
 shouldBe("textElement.rotate.baseVal = textElement", "textElement");
diff --git a/LayoutTests/svg/dom/script-tests/SVGAnimatedRect.js b/LayoutTests/svg/dom/script-tests/SVGAnimatedRect.js
new file mode 100644
index 0000000..5cb7d03
--- /dev/null
+++ b/LayoutTests/svg/dom/script-tests/SVGAnimatedRect.js
@@ -0,0 +1,29 @@
+description("This test checks the SVGAnimatedRect API - utilizing the viewBox property of SVGSVGElement");
+
+var svgElement = document.createElementNS("http://www.w3.org/2000/svg", "svg");
+
+debug("");
+debug("Check initial viewBox value");
+shouldBeEqualToString("svgElement.viewBox.toString()", "[object SVGAnimatedRect]");
+shouldBeEqualToString("svgElement.viewBox.baseVal.toString()", "[object SVGRect]");
+shouldBe("svgElement.viewBox.baseVal.x", "0");
+
+debug("");
+debug("Check that rects are dynamic, caching value in a local variable and modifying it, should take effect");
+var numRef = svgElement.viewBox.baseVal;
+numRef.x = 100;
+shouldBe("numRef.x", "100");
+shouldBe("svgElement.viewBox.baseVal.x", "100");
+
+debug("");
+debug("Check that assigning to baseVal has no effect, as no setter is defined");
+shouldBe("svgElement.viewBox.baseVal = -1", "-1");
+shouldBeEqualToString("svgElement.viewBox.baseVal = 'aString'", "aString");
+shouldBe("svgElement.viewBox.baseVal = svgElement", "svgElement");
+
+debug("");
+debug("Check that the viewBox x remained 100, and the baseVal type has not been changed");
+shouldBeEqualToString("svgElement.viewBox.baseVal.toString()", "[object SVGRect]");
+shouldBe("svgElement.viewBox.baseVal.x", "100");
+
+successfullyParsed = true;
diff --git a/LayoutTests/svg/dom/script-tests/SVGExternalResourcesRequired.js b/LayoutTests/svg/dom/script-tests/SVGExternalResourcesRequired.js
deleted file mode 100644
index cafb775..0000000
--- a/LayoutTests/svg/dom/script-tests/SVGExternalResourcesRequired.js
+++ /dev/null
@@ -1,37 +0,0 @@
-description("This test checks the SVGExternalResourcesRequired API");
-
-var rectElement = document.createElementNS("http://www.w3.org/2000/svg", "rect");
-debug("");
-debug("Check initial SVGExternalResourcesRequired value");
-shouldBe("rectElement.externalResourcesRequired.baseVal", "false");
-
-debug("");
-debug("Set value to true");
-shouldBe("rectElement.externalResourcesRequired.baseVal = true", "true");
-
-debug("");
-debug("Caching baseVal in local variable");
-var baseVal = rectElement.externalResourcesRequired.baseVal;
-shouldBe("baseVal", "true");
-
-debug("");
-debug("Modify local baseVal variable to true");
-shouldBeFalse("baseVal = false");
-
-debug("");
-debug("Assure that rectElement.externalResourcesRequired has not been changed, but the local baseVal variable");
-shouldBe("baseVal", "false");
-shouldBe("rectElement.externalResourcesRequired.baseVal", "true");
-
-debug("");
-debug("Check assigning invalid values");
-shouldThrow("rectElement.externalResourcesRequired.baseVal = rectElement.externalResourcesRequired");
-shouldBeNull("rectElement.externalResourcesRequired.baseVal = null");
-shouldThrow("rectElement.externalResourcesRequired.baseVal = 'aString'");
-shouldThrow("rectElement.externalResourcesRequired.baseVal = rectElement");
-
-debug("");
-debug("Check that the value is now false");
-shouldBe("rectElement.externalResourcesRequired.baseVal", "false");
-
-successfullyParsed = true;
diff --git a/LayoutTests/svg/dom/script-tests/SVGLength-px-with-context.js b/LayoutTests/svg/dom/script-tests/SVGLength-px-with-context.js
new file mode 100644
index 0000000..c1e6cc9
--- /dev/null
+++ b/LayoutTests/svg/dom/script-tests/SVGLength-px-with-context.js
@@ -0,0 +1,170 @@
+description("This test checks SVGLength - converting from px to all other unit types");
+
+function calculateDPI()
+{
+    // Crude hack to determine the DPI, instead of hardcoding our 96 dpi here.
+    var divElement = document.createElement("div");
+    divElement.setAttribute("style", "height: 1in");
+    document.getElementById("description").appendChild(divElement);
+    var cssPixelsPerInch = divElement.offsetHeight;
+    document.getElementById("description").removeChild(divElement);
+
+    // Crude hack to make this test pass with Opera/Mac
+    if (navigator.userAgent.indexOf("Opera") != -1) {
+        if (navigator.userAgent.indexOf("Macintosh") != -1) {    
+            cssPixelsPerInch = 72;
+        }
+    }
+
+    return cssPixelsPerInch;
+}
+
+function calculateXHeight()
+{
+    // Crude hack to calculate the x-height
+    var divElement = document.createElement("div");
+    divElement.setAttribute("style", "height: 1ex; font-size: 12px; font-family: Ahem;");
+    document.getElementById("description").appendChild(divElement);
+    var xHeight = divElement.offsetHeight;
+    document.getElementById("description").removeChild(divElement);
+    return xHeight;
+}
+
+// Setup a real SVG document, so SVGLength can resolve relative units.
+var svgElement = document.createElementNS("http://www.w3.org/2000/svg", "svg");
+svgElement.setAttribute("width", "150");
+svgElement.setAttribute("height", "50");
+
+var rectElement = document.createElementNS("http://www.w3.org/2000/svg", "rect");
+rectElement.setAttribute("style", "visibility: hidden; font-size: 12px; font-family: Ahem;");
+svgElement.appendChild(rectElement);
+document.getElementById("description").appendChild(svgElement);
+
+// Extract test information
+var length = rectElement.x.baseVal;
+var svgWidth = svgElement.width.baseVal.value;
+var svgHeight = svgElement.height.baseVal.value;
+var fontSize = parseInt(rectElement.style.fontSize);
+var cssPixelsPerInch = calculateDPI();
+
+debug("");
+debug("Set value to be 2px");
+length.valueAsString = "2px";
+shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_PX");
+shouldBe("length.value", "2");
+shouldBe("length.valueInSpecifiedUnits", "2");
+shouldBeEqualToString("length.valueAsString", "2px");
+
+debug("");
+debug("Convert from px to unitless");
+shouldBeUndefined("length.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_NUMBER)");
+shouldBeEqualToString("length.valueAsString", "2");
+shouldBe("length.value", "2");
+shouldBe("length.valueInSpecifiedUnits", "2");
+shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_NUMBER");
+
+debug("");
+debug("Reset to 2px");
+length.valueAsString = "2px";
+
+debug("");
+debug("Convert from px to percentage");
+shouldBeUndefined("length.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PERCENTAGE)");
+referenceValue = Number(2 / svgWidth * 100).toFixed(5);
+shouldBeEqualToString("length.valueAsString", referenceValue + "%");
+shouldBeEqualToString("length.valueInSpecifiedUnits.toFixed(5)", referenceValue);
+shouldBeEqualToString("length.value.toFixed(1)", "2.0");
+shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_PERCENTAGE");
+
+debug("");
+debug("Reset to 2px");
+length.valueAsString = "2px";
+
+debug("");
+debug("Convert from px to ems");
+shouldBeUndefined("length.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_EMS)");
+referenceValue = Number(2 / fontSize).toFixed(6);
+shouldBeEqualToString("length.valueAsString", referenceValue + "em");
+shouldBeEqualToString("length.valueInSpecifiedUnits.toFixed(6)", referenceValue);
+shouldBeEqualToString("length.value.toFixed(1)", "2.0");
+shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_EMS");
+
+debug("");
+debug("Reset to 2px");
+length.valueAsString = "2px";
+
+debug("");
+debug("Convert from px to exs");
+shouldBeUndefined("length.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_EXS)");
+referenceValue = Number(2 / calculateXHeight()).toFixed(1);
+// Don't check valueAsString here, it's unreliable across browsers.
+shouldBeEqualToString("length.valueInSpecifiedUnits.toFixed(1)", referenceValue);
+shouldBeEqualToString("length.value.toFixed(1)", "2.0");
+shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_EXS");
+
+debug("");
+debug("Reset to 2px");
+length.valueAsString = "2px";
+
+debug("");
+debug("Convert from px to cm");
+shouldBeUndefined("length.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_CM)");
+referenceValue = Number(2 * 2.54 / cssPixelsPerInch).toFixed(7);
+shouldBeEqualToString("length.valueAsString", referenceValue + "cm");
+shouldBeEqualToString("length.valueInSpecifiedUnits.toFixed(7)", referenceValue);
+shouldBeEqualToString("length.value.toFixed(1)", "2.0");
+shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_CM");
+
+debug("");
+debug("Reset to 2px");
+length.valueAsString = "2px";
+
+debug("");
+debug("Convert from px to mm");
+shouldBeUndefined("length.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_MM)");
+referenceValue = Number(2 * 25.4 / cssPixelsPerInch).toFixed(6);
+shouldBeEqualToString("length.valueAsString", referenceValue + "mm");
+shouldBeEqualToString("length.valueInSpecifiedUnits.toFixed(6)", referenceValue);
+shouldBeEqualToString("length.value.toFixed(1)", "2.0");
+shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_MM");
+
+debug("");
+debug("Reset to 2px");
+length.valueAsString = "2px";
+
+debug("");
+debug("Convert from px to in");
+shouldBeUndefined("length.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_IN)");
+referenceValue = Number(2 / cssPixelsPerInch).toFixed(7);
+shouldBeEqualToString("length.valueAsString", referenceValue + "in");
+shouldBeEqualToString("length.valueInSpecifiedUnits.toFixed(7)", referenceValue);
+shouldBeEqualToString("length.value.toFixed(1)", "2.0");
+shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_IN");
+
+debug("");
+debug("Reset to 2px");
+length.valueAsString = "2px";
+
+debug("");
+debug("Convert from px to pt");
+shouldBeUndefined("length.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PT)");
+referenceValue = Number(2 / cssPixelsPerInch * 72);
+shouldBeEqualToString("length.valueAsString", referenceValue + "pt");
+shouldBe("length.valueInSpecifiedUnits", referenceValue.toString());
+shouldBeEqualToString("length.value.toFixed(1)", "2.0");
+shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_PT");
+
+debug("");
+debug("Reset to 2px");
+length.valueAsString = "2px";
+
+debug("");
+debug("Convert from px to pc");
+shouldBeUndefined("length.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PC)");
+referenceValue = Number(2 / cssPixelsPerInch * 6).toFixed(3);
+// Don't check valueAsString here, it's unreliable across browsers.
+shouldBeEqualToString("length.valueInSpecifiedUnits.toFixed(3)", referenceValue);
+shouldBeEqualToString("length.value.toFixed(1)", "2.0");
+shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_PC");
+
+successfullyParsed = true;
diff --git a/LayoutTests/svg/dom/script-tests/SVGLength-px.js b/LayoutTests/svg/dom/script-tests/SVGLength-px.js
new file mode 100644
index 0000000..0f267a6
--- /dev/null
+++ b/LayoutTests/svg/dom/script-tests/SVGLength-px.js
@@ -0,0 +1,144 @@
+description("This test checks SVGLength - converting from px to all other unit types");
+
+function calculateDPI()
+{
+    // Crude hack to determine the DPI, instead of hardcoding our 96 dpi here.
+    var divElement = document.createElement("div");
+    divElement.setAttribute("style", "height: 1in");
+    document.getElementById("description").appendChild(divElement);
+    var cssPixelsPerInch = divElement.offsetHeight;
+    document.getElementById("description").removeChild(divElement);
+
+    // Crude hack to make this test pass with Opera/Mac
+    if (navigator.userAgent.indexOf("Opera") != -1) {
+        if (navigator.userAgent.indexOf("Macintosh") != -1) {    
+            cssPixelsPerInch = 72;
+        }
+    }
+
+    return cssPixelsPerInch;
+}
+
+var cssPixelsPerInch = calculateDPI();
+
+var svgElement = document.createElementNS("http://www.w3.org/2000/svg", "svg");
+var length = svgElement.createSVGLength();
+
+debug("");
+debug("Set value to be 2px");
+length.valueAsString = "2px";
+shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_PX");
+shouldBe("length.value", "2");
+shouldBe("length.valueInSpecifiedUnits", "2");
+shouldBeEqualToString("length.valueAsString", "2px");
+
+debug("");
+debug("Convert from px to unitless");
+shouldBeUndefined("length.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_NUMBER)");
+shouldBeEqualToString("length.valueAsString", "2");
+shouldBe("length.value", "2");
+shouldBe("length.valueInSpecifiedUnits", "2");
+shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_NUMBER");
+
+debug("");
+debug("Reset to 2px");
+length.valueAsString = "2px";
+
+debug("");
+debug("Try converting from px to percentage, should fail as the SVGLength is not associated with a SVGSVGElement, and thus no viewport information is available");
+shouldThrow("length.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PERCENTAGE)");
+shouldBeEqualToString("length.valueAsString", "2px");
+shouldBe("length.value", "2");
+shouldBe("length.valueInSpecifiedUnits", "2");
+shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_PX");
+
+debug("");
+debug("Reset to 2px");
+length.valueAsString = "2px";
+
+debug("");
+debug("Try converting from px to ems, should fail as the SVGLength is not associated with a SVGSVGElement, and thus no font-size information is available");
+shouldThrow("length.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_EMS)");
+shouldBeEqualToString("length.valueAsString", "2px");
+shouldBe("length.value", "2");
+shouldBe("length.valueInSpecifiedUnits", "2");
+shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_PX");
+
+debug("");
+debug("Reset to 2px");
+length.valueAsString = "2px";
+
+debug("");
+debug("Try converting from px to exs, should fail as the SVGLength is not associated with a SVGSVGElement, and thus no font-size information is available");
+shouldThrow("length.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_EXS)");
+shouldBeEqualToString("length.valueAsString", "2px");
+shouldBe("length.value", "2");
+shouldBe("length.valueInSpecifiedUnits", "2");
+shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_PX");
+
+debug("");
+debug("Reset to 2px");
+length.valueAsString = "2px";
+
+debug("");
+debug("Convert from px to cm");
+shouldBeUndefined("length.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_CM)");
+referenceValue = Number(2 * 2.54 / cssPixelsPerInch).toFixed(7);
+shouldBeEqualToString("length.valueAsString", referenceValue + "cm");
+shouldBeEqualToString("length.valueInSpecifiedUnits.toFixed(7)", referenceValue);
+shouldBeEqualToString("length.value.toFixed(1)", "2.0");
+shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_CM");
+
+debug("");
+debug("Reset to 2px");
+length.valueAsString = "2px";
+
+debug("");
+debug("Convert from px to mm");
+shouldBeUndefined("length.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_MM)");
+referenceValue = Number(2 * 25.4 / cssPixelsPerInch).toFixed(6);
+shouldBeEqualToString("length.valueAsString", referenceValue + "mm");
+shouldBeEqualToString("length.valueInSpecifiedUnits.toFixed(6)", referenceValue);
+shouldBeEqualToString("length.value.toFixed(1)", "2.0");
+shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_MM");
+
+debug("");
+debug("Reset to 2px");
+length.valueAsString = "2px";
+
+debug("");
+debug("Convert from px to in");
+shouldBeUndefined("length.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_IN)");
+referenceValue = Number(2 / cssPixelsPerInch).toFixed(7);
+shouldBeEqualToString("length.valueAsString", referenceValue + "in");
+shouldBeEqualToString("length.valueInSpecifiedUnits.toFixed(7)", referenceValue);
+shouldBeEqualToString("length.value.toFixed(1)", "2.0");
+shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_IN");
+
+debug("");
+debug("Reset to 2px");
+length.valueAsString = "2px";
+
+debug("");
+debug("Convert from px to pt");
+shouldBeUndefined("length.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PT)");
+referenceValue = Number(2 / cssPixelsPerInch * 72);
+shouldBeEqualToString("length.valueAsString", referenceValue + "pt");
+shouldBe("length.valueInSpecifiedUnits", referenceValue.toString());
+shouldBeEqualToString("length.value.toFixed(1)", "2.0");
+shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_PT");
+
+debug("");
+debug("Reset to 2px");
+length.valueAsString = "2px";
+
+debug("");
+debug("Convert from px to pc");
+shouldBeUndefined("length.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PC)");
+referenceValue = Number(2 / cssPixelsPerInch * 6).toFixed(3);
+// Don't check valueAsString here, it's unreliable across browsers.
+shouldBeEqualToString("length.valueInSpecifiedUnits.toFixed(3)", referenceValue);
+shouldBeEqualToString("length.value.toFixed(1)", "2.0");
+shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_PC");
+
+successfullyParsed = true;
diff --git a/LayoutTests/svg/dom/script-tests/SVGLength.js b/LayoutTests/svg/dom/script-tests/SVGLength.js
new file mode 100644
index 0000000..118dd74
--- /dev/null
+++ b/LayoutTests/svg/dom/script-tests/SVGLength.js
@@ -0,0 +1,55 @@
+description("This test checks the SVGLength API");
+
+var svgElement = document.createElementNS("http://www.w3.org/2000/svg", "svg");
+var length = svgElement.createSVGLength();
+
+debug("");
+debug("Check initial length values");
+shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_NUMBER");
+shouldBe("length.value", "0");
+shouldBe("length.valueInSpecifiedUnits", "0");
+shouldBeEqualToString("length.valueAsString", "0");
+
+debug("");
+debug("Set value to be 2px");
+length.valueAsString = "2px";
+shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_PX");
+shouldBe("length.value", "2");
+shouldBe("length.valueInSpecifiedUnits", "2");
+shouldBeEqualToString("length.valueAsString", "2px");
+
+debug("");
+debug("Check invalid arguments for 'convertToSpecifiedUnits'");
+shouldThrow("length.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_UNKNOWN)");
+shouldThrow("length.convertToSpecifiedUnits(-1)");
+shouldThrow("length.convertToSpecifiedUnits(11)");
+shouldThrow("length.convertToSpecifiedUnits('aString')");
+shouldThrow("length.convertToSpecifiedUnits(length)");
+shouldThrow("length.convertToSpecifiedUnits(svgElement)");
+shouldThrow("length.convertToSpecifiedUnits()");
+shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_PX");
+shouldBe("length.value", "2");
+shouldBe("length.valueInSpecifiedUnits", "2");
+shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_PX");
+
+debug("");
+debug("Check invalid arguments for 'newValueSpecifiedUnits'");
+shouldThrow("length.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_UNKNOWN, 4)");
+shouldThrow("length.newValueSpecifiedUnits(-1, 4)");
+shouldThrow("length.newValueSpecifiedUnits(11, 4)");
+shouldThrow("length.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PX, 'aString')");
+shouldThrow("length.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PX, length)");
+shouldThrow("length.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PX, svgElement)");
+shouldThrow("length.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PX)");
+shouldThrow("length.newValueSpecifiedUnits('aString', 4)");
+shouldThrow("length.newValueSpecifiedUnits(length, 4)");
+shouldThrow("length.newValueSpecifiedUnits(svgElement, 4)");
+shouldThrow("length.newValueSpecifiedUnits('aString', 'aString')");
+shouldThrow("length.newValueSpecifiedUnits(length, length)");
+shouldThrow("length.newValueSpecifiedUnits(svgElement, svgElement)");
+shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_PX");
+shouldBe("length.value", "2");
+shouldBe("length.valueInSpecifiedUnits", "2");
+shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_PX");
+
+successfullyParsed = true;
diff --git a/LayoutTests/svg/dom/svg-length-units-expected.txt b/LayoutTests/svg/dom/svg-length-units-expected.txt
deleted file mode 100644
index 111fc82..0000000
--- a/LayoutTests/svg/dom/svg-length-units-expected.txt
+++ /dev/null
@@ -1,13 +0,0 @@
- 1
-1
-1
-1
-1
-5
-5
-5
-5
-5
-Done!
-
-
diff --git a/LayoutTests/svg/dom/svg-length-units.html b/LayoutTests/svg/dom/svg-length-units.html
deleted file mode 100644
index 3e25cea..0000000
--- a/LayoutTests/svg/dom/svg-length-units.html
+++ /dev/null
@@ -1,32 +0,0 @@
-<body>
-<svg id="foo">
-</svg>
-<pre>
-<script>
-if (window.layoutTestController)
-    layoutTestController.dumpAsText();
-
-var elmt = document.getElementById('foo');
-var len = elmt.createSVGLength();
-document.writeln(len.unitType)
-len.newValueSpecifiedUnits(0, 42);
-document.writeln(len.unitType)
-len.value = 48;
-document.writeln(len.unitType)
-len.newValueSpecifiedUnits(51168, 42);
-document.writeln(len.unitType)
-len.value = 48;
-document.writeln(len.unitType)
-len.valueAsString = "32px"
-document.writeln(len.unitType)
-len.convertToSpecifiedUnits(0)
-document.writeln(len.unitType)
-len.valueAsString = "32px"
-document.writeln(len.unitType)
-len.convertToSpecifiedUnits(51168)
-document.writeln(len.unitType)
-len.value = 48;
-document.writeln(len.unitType)
-document.writeln("Done!")
-</script>
-</pre>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 7016ed9..b01aa6a 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,73 @@
+2010-11-01  Nikolas Zimmermann  <nzimmermann at rim.com>
+
+        Reviewed by Rob Buis.
+
+        Enable StrictTypeChecking for all types using SVG(Animated)PropertyTearOff
+        https://bugs.webkit.org/show_bug.cgi?id=48715
+
+        Enable StrictTypeChecking for all readwrite attributes and function calls of all types using the new SVG(Animated)PropertyTearOff concept.
+        Also enable RequiresAllArguments=Raise for all function calls of these new types. Cover this functionality by tests for each of them.
+
+        When testing SVGLength it became obvious that quite a lot of functionality was missing.
+        Conversion from relative arguments (percentage, ems, exs) to user specified units was missing, added that functionality and tested it.
+        User units to pt conversion was wrong, fixed that.
+
+        Tests: svg/dom/SVGAnimatedAngle.html
+               svg/dom/SVGAnimatedBoolean.html
+               svg/dom/SVGAnimatedEnumeration.html
+               svg/dom/SVGAnimatedInteger.html
+               svg/dom/SVGAnimatedLength.html
+               svg/dom/SVGAnimatedLengthList.html
+               svg/dom/SVGAnimatedRect.html
+               svg/dom/SVGLength-px-with-context.html
+               svg/dom/SVGLength-px.html
+               svg/dom/SVGLength.html
+
+        * bindings/js/JSSVGLengthCustom.cpp: These SVGLength methods now take an ExceptionCode parameter, adapt to that. 
+        (WebCore::JSSVGLength::value):
+        (WebCore::JSSVGLength::setValue):
+        (WebCore::JSSVGLength::convertToSpecifiedUnits):
+        * bindings/scripts/CodeGeneratorObjC.pm: Remove FIXMEs, pass real context instead off null pointer. DOMSVGLength::value is functional now.
+        * bindings/v8/custom/V8SVGLengthCustom.cpp: These SVGLength methods now take an ExceptionCode parameter, adapt to that.
+        (WebCore::V8SVGLength::valueAccessorGetter):
+        (WebCore::V8SVGLength::valueAccessorSetter):
+        (WebCore::V8SVGLength::convertToSpecifiedUnitsCallback):
+        * rendering/style/SVGRenderStyle.h: Adapt to SVGLength API changes.
+        (WebCore::SVGRenderStyle::initialBaselineShiftValue):
+        (WebCore::SVGRenderStyle::initialKerning):
+        (WebCore::SVGRenderStyle::initialStrokeDashOffset):
+        (WebCore::SVGRenderStyle::initialStrokeWidth):
+        * svg/SVGAngle.idl: Add StrictTypeChecking, RequiresAllArguments=Raise to all methods.
+        * svg/SVGAnimatedBoolean.idl: Remove StrictTypeChecking from animVal, it's readonly so this is useless.
+        * svg/SVGAnimatedEnumeration.idl: Add StrictTypeChecking to all attributes.
+        * svg/SVGAnimatedInteger.idl: Ditto.
+        * svg/SVGLength.cpp: Implement all missing features of SVGLength. Conform to our style guide (s/.0f// etc)
+        (WebCore::lengthTypeToString):
+        (WebCore::SVGLength::SVGLength):
+        (WebCore::SVGLength::value): Throw NOT_SUPPORTED_ERR when trying to obtain to relative units, when no context is given (SVGLength created by createSVGLength()).
+        (WebCore::SVGLength::setValue): Ditto, for the setter.
+        (WebCore::SVGLength::valueAsPercentage): Use m_valueInSpecifiedUnits instead of valueInSpecifiedUnits().
+        (WebCore::SVGLength::setValueAsString): Throw SYNTAX_ERR if parsing failed.
+        (WebCore::SVGLength::valueAsString): Use makeString() instead of String and operator+.
+        (WebCore::SVGLength::newValueSpecifiedUnits): Add ExceptionCode parameter, throw NOT_SUPPORTED_ERR, if the given unit type is invalid.
+        (WebCore::SVGLength::convertToSpecifiedUnits): Ditto.
+        (WebCore::SVGLength::determineViewport): Added helper function used by convertValue*Percentage*.
+        (WebCore::SVGLength::convertValueFromUserUnitsToPercentage): Add new helper functions, used by value/setValue.
+        (WebCore::SVGLength::convertValueFromPercentageToUserUnits): Ditto.
+        (WebCore::SVGLength::convertValueFromUserUnitsToEMS): Ditto.
+        (WebCore::SVGLength::convertValueFromEMSToUserUnits): Ditto.
+        (WebCore::SVGLength::convertValueFromUserUnitsToEXS): Ditto.
+        (WebCore::SVGLength::convertValueFromEXSToUserUnits): Ditto.
+        (WebCore::SVGLength::fromCSSPrimitiveValue): Adapt to newValueSpecifiedUnits API change.
+        (WebCore::SVGLength::toCSSPrimitiveValue): Remove default switch case.
+        * svg/SVGLength.h:
+        (WebCore::SVGLength::valueInSpecifiedUnits): Inlined.
+        (WebCore::SVGLength::setValueInSpecifiedUnits): Ditto.
+        (WebCore::SVGLength::isRelative):
+        * svg/SVGLength.idl: Add StrictTypeChecking for all attributes/functions and RequiresAllArguments=Raise for all functions.
+        * svg/SVGLengthList.cpp: Adapt to SVGLength API changes.
+        (WebCore::SVGLengthList::parse):
+
 2010-10-31  Pavel Feldman  <pfeldman at chromium.org>
 
         Reviewed by Timothy Hatcher.
diff --git a/WebCore/bindings/js/JSSVGLengthCustom.cpp b/WebCore/bindings/js/JSSVGLengthCustom.cpp
index 0cc7c6d..9a9138c 100644
--- a/WebCore/bindings/js/JSSVGLengthCustom.cpp
+++ b/WebCore/bindings/js/JSSVGLengthCustom.cpp
@@ -22,22 +22,64 @@
 #if ENABLE(SVG)
 #include "JSSVGLength.h"
 
+#include <runtime/Error.h>
 #include "SVGAnimatedProperty.h"
+#include "SVGException.h"
 
 using namespace JSC;
 
 namespace WebCore {
 
-JSValue JSSVGLength::value(ExecState*) const
+JSValue JSSVGLength::value(ExecState* exec) const
 {
     SVGLength& podImp = impl()->propertyReference();
-    return jsNumber(podImp.value(impl()->contextElement()));
+    ExceptionCode ec = 0;
+    float value = podImp.value(impl()->contextElement(), ec);
+    if (ec) {
+        setDOMException(exec, ec);
+        return jsUndefined();
+    }
+
+    return jsNumber(value);
+}
+
+void JSSVGLength::setValue(ExecState* exec, JSValue value)
+{
+    if (!value.isUndefinedOrNull() && !value.isNumber() && !value.isBoolean()) {
+        throwVMTypeError(exec);
+        return;
+    }
+
+    SVGLength& podImp = impl()->propertyReference();
+
+    ExceptionCode ec = 0;
+    podImp.setValue(value.toFloat(exec), impl()->contextElement(), ec);
+    if (ec) {
+        setDOMException(exec, ec);
+        return;
+    }
+
+    impl()->commitChange();
 }
 
 JSValue JSSVGLength::convertToSpecifiedUnits(ExecState* exec)
 {
     SVGLength& podImp = impl()->propertyReference();
-    podImp.convertToSpecifiedUnits(exec->argument(0).toInt32(exec), impl()->contextElement());
+
+    // Mimic the behaviour of RequiresAllArguments=Raise.
+    if (exec->argumentCount() < 1)
+        return throwError(exec, createSyntaxError(exec, "Not enough arguments"));
+
+    unsigned short unitType = exec->argument(0).toUInt32(exec);
+    if (exec->hadException())
+        return jsUndefined();
+
+    ExceptionCode ec = 0;
+    podImp.convertToSpecifiedUnits(unitType, impl()->contextElement(), ec);
+    if (ec) {
+        setDOMException(exec, ec);
+        return jsUndefined();
+    }
 
     impl()->commitChange();
     return jsUndefined();
diff --git a/WebCore/bindings/scripts/CodeGeneratorObjC.pm b/WebCore/bindings/scripts/CodeGeneratorObjC.pm
index cd85186..73abf07 100644
--- a/WebCore/bindings/scripts/CodeGeneratorObjC.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorObjC.pm
@@ -1,4 +1,4 @@
-#
+# 
 # Copyright (C) 2005, 2006 Nikolas Zimmermann <zimmermann at kde.org>
 # Copyright (C) 2006 Anders Carlsson <andersca at mac.com> 
 # Copyright (C) 2006, 2007 Samuel Weinig <sam at webkit.org>
@@ -1246,7 +1246,7 @@ sub GenerateImplementation
 
                 # TODO: Handle special case for DOMSVGLength. We do need Custom code support for this.
                 if ($svgPropertyType eq "WebCore::SVGLength" and $attributeName eq "value") {
-                    $getterContentHead = "value(0 /* FIXME */";
+                    $getterContentHead = "value(IMPL->contextElement(), ";
                 }
             }
 
@@ -1393,7 +1393,12 @@ sub GenerateImplementation
                     if ($svgPropertyType eq "float") {
                         push(@implContent, "    podImpl = $arg;\n");
                     } else {
-                        push(@implContent, "    podImpl.$coreSetterName($arg$ec);\n");
+                        # FIXME: Special case for DOMSVGLength. We do need Custom code support for this.
+                        if ($svgPropertyType eq "WebCore::SVGLength" and $attributeName eq "value") {
+                            push(@implContent, "    podImpl.$coreSetterName($arg, IMPL->contextElement()$ec);\n");
+                        } else {
+                            push(@implContent, "    podImpl.$coreSetterName($arg$ec);\n");
+                        }
                     }
 
                     if ($hasSetterException) {
@@ -1528,8 +1533,8 @@ sub GenerateImplementation
             my $svgMatrixInverse = ($podType and $podType eq "AffineTransform" and $functionName eq "inverse");
             my $svgLengthConvertToSpecifiedUnits = ($svgPropertyType and $svgPropertyType eq "WebCore::SVGLength" and $functionName eq "convertToSpecifiedUnits");
 
+            push(@parameterNames, "IMPL->contextElement()") if $svgLengthConvertToSpecifiedUnits; 
             push(@parameterNames, "ec") if $raisesExceptions and !($svgMatrixRotateFromVector || $svgMatrixInverse);
-            push(@parameterNames, "0 /* FIXME */") if $svgLengthConvertToSpecifiedUnits; 
 
             # Handle arguments that are 'SVGProperty' based (SVGAngle/SVGLength). We need to convert from SVGPropertyTearOff<Type>* to Type,
             # to be able to call the desired WebCore function. If the conversion fails, we can't extract Type and need to raise an exception.
diff --git a/WebCore/bindings/v8/custom/V8SVGLengthCustom.cpp b/WebCore/bindings/v8/custom/V8SVGLengthCustom.cpp
index 3582a36..ec6324d 100644
--- a/WebCore/bindings/v8/custom/V8SVGLengthCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8SVGLengthCustom.cpp
@@ -35,25 +35,58 @@
 
 #include "SVGPropertyTearOff.h"
 #include "V8Binding.h"
+#include "V8BindingMacros.h"
 
 namespace WebCore {
 
 v8::Handle<v8::Value> V8SVGLength::valueAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
 {
-    INC_STATS("DOM.SVGLength.value");
+    INC_STATS("DOM.SVGLength.value._get");
     SVGPropertyTearOff<SVGLength>* wrapper = V8SVGLength::toNative(info.Holder());
     SVGLength& imp = wrapper->propertyReference();
-    return v8::Number::New(imp.value(wrapper->contextElement()));
+    ExceptionCode ec = 0;
+    float value = imp.value(wrapper->contextElement(), ec);
+    if (UNLIKELY(ec)) {
+        V8Proxy::setDOMException(ec);
+        return v8::Handle<v8::Value>();
+    }
+    return v8::Number::New(value);
+}
+
+void V8SVGLength::valueAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+{
+    INC_STATS("DOM.SVGLength.value._set");
+    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);
+    if (UNLIKELY(ec))
+        V8Proxy::setDOMException(ec);
+    else
+        wrapper->commitChange();
 }
 
 v8::Handle<v8::Value> V8SVGLength::convertToSpecifiedUnitsCallback(const v8::Arguments& args)
 {
     INC_STATS("DOM.SVGLength.convertToSpecifiedUnits");
+    if (args.Length() < 1)
+        return throwError("Not enough arguments", V8Proxy::SyntaxError);
+
     SVGPropertyTearOff<SVGLength>* wrapper = V8SVGLength::toNative(args.Holder());
     SVGLength& imp = wrapper->propertyReference();
-    imp.convertToSpecifiedUnits(toInt32(args[0]), wrapper->contextElement());
-    wrapper->commitChange();
-    return v8::Undefined();
+    ExceptionCode ec = 0;
+    EXCEPTION_BLOCK(int, unitType, toUInt32(args[0]));
+    imp.convertToSpecifiedUnits(unitType, wrapper->contextElement(), ec);
+    if (UNLIKELY(ec))
+        V8Proxy::setDOMException(ec);
+    else
+        wrapper->commitChange();
+    return v8::Handle<v8::Value>();
 }
 
 } // namespace WebCore
diff --git a/WebCore/rendering/style/SVGRenderStyle.h b/WebCore/rendering/style/SVGRenderStyle.h
index 8f0be39..7f032e7 100644
--- a/WebCore/rendering/style/SVGRenderStyle.h
+++ b/WebCore/rendering/style/SVGRenderStyle.h
@@ -92,28 +92,36 @@ public:
     static SVGLength initialBaselineShiftValue()
     {
         SVGLength length;
-        length.newValueSpecifiedUnits(LengthTypeNumber, 0);
+        ExceptionCode ec = 0;
+        length.newValueSpecifiedUnits(LengthTypeNumber, 0, ec);
+        ASSERT(!ec);
         return length;
     }
 
     static SVGLength initialKerning()
     {
         SVGLength length;
-        length.newValueSpecifiedUnits(LengthTypeNumber, 0);
+        ExceptionCode ec = 0;
+        length.newValueSpecifiedUnits(LengthTypeNumber, 0, ec);
+        ASSERT(!ec);
         return length;
     }
 
     static SVGLength initialStrokeDashOffset()
     {
         SVGLength length;
-        length.newValueSpecifiedUnits(LengthTypeNumber, 0);
+        ExceptionCode ec = 0;
+        length.newValueSpecifiedUnits(LengthTypeNumber, 0, ec);
+        ASSERT(!ec);
         return length;
     }
 
     static SVGLength initialStrokeWidth()
     {
         SVGLength length;
-        length.newValueSpecifiedUnits(LengthTypeNumber, 1);
+        ExceptionCode ec = 0;
+        length.newValueSpecifiedUnits(LengthTypeNumber, 1, ec);
+        ASSERT(!ec);
         return length;
     }
 
diff --git a/WebCore/svg/SVGAngle.idl b/WebCore/svg/SVGAngle.idl
index b36670a..be01ff9 100644
--- a/WebCore/svg/SVGAngle.idl
+++ b/WebCore/svg/SVGAngle.idl
@@ -37,10 +37,10 @@ module svg {
         attribute [ConvertNullToNullString] DOMString valueAsString
             setter raises(DOMException);
 
-        void newValueSpecifiedUnits(in unsigned short unitType, in float valueInSpecifiedUnits)
+        [StrictTypeChecking, RequiresAllArguments=Raise] void newValueSpecifiedUnits(in unsigned short unitType, in float valueInSpecifiedUnits)
             raises(DOMException);
 
-        void convertToSpecifiedUnits(in unsigned short unitType)
+        [StrictTypeChecking, RequiresAllArguments=Raise] void convertToSpecifiedUnits(in unsigned short unitType)
             raises(DOMException);
     };
 
diff --git a/WebCore/svg/SVGAnimatedBoolean.idl b/WebCore/svg/SVGAnimatedBoolean.idl
index 2591c50..3e41e3c 100644
--- a/WebCore/svg/SVGAnimatedBoolean.idl
+++ b/WebCore/svg/SVGAnimatedBoolean.idl
@@ -27,7 +27,7 @@ module svg {
 
     interface [Conditional=SVG] SVGAnimatedBoolean {
         attribute [StrictTypeChecking] boolean baseVal;
-        readonly attribute [StrictTypeChecking] boolean animVal;
+        readonly attribute boolean animVal;
     };
 
 }
diff --git a/WebCore/svg/SVGAnimatedEnumeration.idl b/WebCore/svg/SVGAnimatedEnumeration.idl
index 8a9d3b4..c0840f2 100644
--- a/WebCore/svg/SVGAnimatedEnumeration.idl
+++ b/WebCore/svg/SVGAnimatedEnumeration.idl
@@ -26,7 +26,7 @@
 module svg {
 
     interface [Conditional=SVG] SVGAnimatedEnumeration {
-        attribute unsigned short baseVal;
+        attribute [StrictTypeChecking] unsigned short baseVal;
         readonly attribute unsigned short animVal;
     };
 
diff --git a/WebCore/svg/SVGAnimatedInteger.idl b/WebCore/svg/SVGAnimatedInteger.idl
index 6ea9138..61de26c 100644
--- a/WebCore/svg/SVGAnimatedInteger.idl
+++ b/WebCore/svg/SVGAnimatedInteger.idl
@@ -26,8 +26,7 @@
 module svg {
 
     interface [Conditional=SVG] SVGAnimatedInteger {
-                 attribute long baseVal
-                     /*setter raises(DOMException)*/;
+        attribute [StrictTypeChecking] long baseVal;
         readonly attribute long animVal;
     };
 
diff --git a/WebCore/svg/SVGLength.cpp b/WebCore/svg/SVGLength.cpp
index a8cfb4e..f8381bf 100644
--- a/WebCore/svg/SVGLength.cpp
+++ b/WebCore/svg/SVGLength.cpp
@@ -27,14 +27,13 @@
 #include "CSSHelper.h"
 #include "FloatConversion.h"
 #include "FrameView.h"
-#include "NotImplemented.h"
 #include "RenderObject.h"
 #include "RenderView.h"
 #include "SVGParserUtilities.h"
 #include "SVGSVGElement.h"
 
-#include <math.h>
-#include <wtf/Assertions.h>
+#include <wtf/MathExtras.h>
+#include <wtf/text/StringConcatenate.h>
 
 namespace WebCore {
 
@@ -83,6 +82,7 @@ static inline String lengthTypeToString(SVGLengthType type)
         return "pc";
     }
 
+    ASSERT_NOT_REACHED();
     return String();
 }
 
@@ -126,10 +126,11 @@ inline SVGLengthType stringToLengthType(const UChar*& ptr, const UChar* end)
 }
 
 SVGLength::SVGLength(SVGLengthMode mode, const String& valueAsString)
-    : m_valueInSpecifiedUnits(0.0f)
+    : m_valueInSpecifiedUnits(0)
     , m_unit(storeUnit(mode, LengthTypeNumber))
 {
-    setValueAsString(valueAsString);
+    ExceptionCode ec = 0;
+    setValueAsString(valueAsString, ec);
 }
 
 SVGLength::SVGLength(const SVGLength& other)
@@ -156,35 +157,24 @@ SVGLengthType SVGLength::unitType() const
 
 float SVGLength::value(const SVGElement* context) const
 {
-    SVGLengthType type = extractType(m_unit);
-    if (type == LengthTypeUnknown)
-        return 0.0f;
+    ExceptionCode ec = 0;
+    return value(context, ec);
+}
 
-    switch (type) {
+float SVGLength::value(const SVGElement* context, ExceptionCode& ec) const
+{
+    switch (extractType(m_unit)) {
+    case LengthTypeUnknown:
+        ec = NOT_SUPPORTED_ERR;
+        return 0;
     case LengthTypeNumber:
         return m_valueInSpecifiedUnits;
     case LengthTypePercentage:
-        return SVGLength::PercentageOfViewport(m_valueInSpecifiedUnits / 100.0f, context, extractMode(m_unit));
+        return convertValueFromPercentageToUserUnits(m_valueInSpecifiedUnits / 100, context, ec);
     case LengthTypeEMS:
+        return convertValueFromEMSToUserUnits(m_valueInSpecifiedUnits, context, ec);
     case LengthTypeEXS:
-    {
-        RenderStyle* style = 0;
-        if (context && context->renderer())
-            style = context->renderer()->style();
-        if (style) {
-            float useSize = style->fontSize();
-            ASSERT(useSize > 0);
-            if (type == LengthTypeEMS)
-                return m_valueInSpecifiedUnits * useSize;
-            else {
-                float xHeight = style->font().xHeight();
-                // Use of ceil allows a pixel match to the W3Cs expected output of coords-units-03-b.svg
-                // if this causes problems in real world cases maybe it would be best to remove this
-                return m_valueInSpecifiedUnits * ceilf(xHeight);
-            }
-        }
-        return 0.0f;
-    }
+        return convertValueFromEXSToUserUnits(m_valueInSpecifiedUnits, context, ec);
     case LengthTypePX:
         return m_valueInSpecifiedUnits;
     case LengthTypeCM:
@@ -194,31 +184,45 @@ float SVGLength::value(const SVGElement* context) const
     case LengthTypeIN:
         return m_valueInSpecifiedUnits * cssPixelsPerInch;
     case LengthTypePT:
-        return m_valueInSpecifiedUnits / 72.0f * cssPixelsPerInch;
+        return m_valueInSpecifiedUnits / 72 * cssPixelsPerInch;
     case LengthTypePC:
-        return m_valueInSpecifiedUnits / 6.0f * cssPixelsPerInch;
-    default:
-        break;
+        return m_valueInSpecifiedUnits / 6 * cssPixelsPerInch;
     }
 
     ASSERT_NOT_REACHED();
-    return 0.0f;
+    return 0;
 }
 
-void SVGLength::setValue(float value)
+void SVGLength::setValue(float value, const SVGElement* context, ExceptionCode& ec)
 {
-    SVGLengthType type = extractType(m_unit);
-    ASSERT(type != LengthTypeUnknown);
-
-    switch (type) {
+    switch (extractType(m_unit)) {
+    case LengthTypeUnknown:
+        ec = NOT_SUPPORTED_ERR;
+        break;
     case LengthTypeNumber:
         m_valueInSpecifiedUnits = value;
         break;
     case LengthTypePercentage:
+    {
+        float result = convertValueFromUserUnitsToPercentage(value, context, ec);
+        if (!ec)
+            m_valueInSpecifiedUnits = result; 
+        break;
+    }
     case LengthTypeEMS:
+    {
+        float result = convertValueFromUserUnitsToEMS(value, context, ec);
+        if (!ec)
+            m_valueInSpecifiedUnits = result;
+        break;
+    }
     case LengthTypeEXS:
-        notImplemented();
+    {
+        float result = convertValueFromUserUnitsToEXS(value, context, ec);
+        if (!ec)
+            m_valueInSpecifiedUnits = result; 
         break;
+    }
     case LengthTypePX:
         m_valueInSpecifiedUnits = value;
         break;
@@ -232,97 +236,104 @@ void SVGLength::setValue(float value)
         m_valueInSpecifiedUnits = value / cssPixelsPerInch;
         break;
     case LengthTypePT:
-        m_valueInSpecifiedUnits = value * 72.0f / cssPixelsPerInch;
+        m_valueInSpecifiedUnits = value * 72 / cssPixelsPerInch;
         break;
     case LengthTypePC:
-        m_valueInSpecifiedUnits = value / 6.0f * cssPixelsPerInch;
-        break;
-    default:
+        m_valueInSpecifiedUnits = value * 6 / cssPixelsPerInch;
         break;
     }
 }
 
-void SVGLength::setValueInSpecifiedUnits(float value)
-{
-    m_valueInSpecifiedUnits = value;
-}
-
-float SVGLength::valueInSpecifiedUnits() const
-{
-    return m_valueInSpecifiedUnits;
-}
-
 float SVGLength::valueAsPercentage() const
 {
     // 100% = 100.0 instead of 1.0 for historical reasons, this could eventually be changed
     if (extractType(m_unit) == LengthTypePercentage)
-        return valueInSpecifiedUnits() / 100.0f;
+        return m_valueInSpecifiedUnits / 100;
 
-    return valueInSpecifiedUnits();
+    return m_valueInSpecifiedUnits;
 }
 
-bool SVGLength::setValueAsString(const String& s)
+void SVGLength::setValueAsString(const String& string, ExceptionCode& ec)
 {
-    if (s.isEmpty())
-        return false;
+    if (string.isEmpty())
+        return;
 
-    float convertedNumber = 0.0f;
-    const UChar* ptr = s.characters();
-    const UChar* end = ptr + s.length();
+    float convertedNumber = 0;
+    const UChar* ptr = string.characters();
+    const UChar* end = ptr + string.length();
 
-    if (!parseNumber(ptr, end, convertedNumber, false))
-        return false;
+    if (!parseNumber(ptr, end, convertedNumber, false)) {
+        ec = SYNTAX_ERR;
+        return;
+    }
 
     SVGLengthType type = stringToLengthType(ptr, end);
-    if (type == LengthTypeUnknown)
-        return false;
+    if (type == LengthTypeUnknown) {
+        ec = SYNTAX_ERR;
+        return;
+    }
 
     m_unit = storeUnit(extractMode(m_unit), type);
     m_valueInSpecifiedUnits = convertedNumber;
-    return true;
 }
 
 String SVGLength::valueAsString() const
 {
-    return String::number(m_valueInSpecifiedUnits) + lengthTypeToString(extractType(m_unit));
+    return makeString(String::number(m_valueInSpecifiedUnits), lengthTypeToString(extractType(m_unit)));
 }
 
-void SVGLength::newValueSpecifiedUnits(unsigned short type, float value)
+void SVGLength::newValueSpecifiedUnits(unsigned short type, float value, ExceptionCode& ec)
 {
-    if (type == LengthTypeUnknown || type > LengthTypePC)
+    if (type == LengthTypeUnknown || type > LengthTypePC) {
+        ec = NOT_SUPPORTED_ERR;
         return;
+    }
 
-    m_unit = storeUnit(extractMode(m_unit), (SVGLengthType) type);
+    m_unit = storeUnit(extractMode(m_unit), static_cast<SVGLengthType>(type));
     m_valueInSpecifiedUnits = value;
 }
 
-void SVGLength::convertToSpecifiedUnits(unsigned short type, const SVGElement* context)
+void SVGLength::convertToSpecifiedUnits(unsigned short type, const SVGElement* context, ExceptionCode& ec)
 {
-    if (type == LengthTypeUnknown || type > LengthTypePC)
+    if (type == LengthTypeUnknown || type > LengthTypePC) {
+        ec = NOT_SUPPORTED_ERR;
         return;
+    }
 
-    float valueInUserUnits = value(context);
-    m_unit = storeUnit(extractMode(m_unit), (SVGLengthType) type);
-    setValue(valueInUserUnits);
+    float valueInUserUnits = value(context, ec);
+    if (ec)
+        return;
+
+    unsigned int originalUnitAndType = m_unit;    
+    m_unit = storeUnit(extractMode(m_unit), static_cast<SVGLengthType>(type));
+    setValue(valueInUserUnits, context, ec);
+    if (!ec)
+        return;
+
+    // Eventually restore old unit and type
+    m_unit = originalUnitAndType;
 }
 
-float SVGLength::PercentageOfViewport(float value, const SVGElement* context, SVGLengthMode mode)
+bool SVGLength::determineViewport(const SVGElement* context, float& width, float& height) const
 {
-    ASSERT(context);
-
-    float width = 0.0f, height = 0.0f;
-    SVGElement* viewportElement = context->viewportElement();
+    if (!context)
+        return false;
 
-    // PercentageOfViewport() is used to resolve all relative-positioned values within a SVG document (fragment)
-    Document* doc = context->document();
-    if (doc->documentElement() == context) {
-        // Resolve value against outermost <svg> element
-        if (RenderView* view = toRenderView(doc->renderer())) {
+    // Take size from outermost <svg> element.
+    Document* document = context->document();
+    if (document->documentElement() == context) {
+        if (RenderView* view = toRenderView(document->renderer())) {
             width = view->viewWidth();
             height = view->viewHeight();
-         }
-    } else if (viewportElement && viewportElement->isSVG()) {
-        // Resolve value against nearest viewport element (common case: inner <svg> elements)
+            return true;
+        }
+
+        return false;
+    }
+
+    // Resolve value against nearest viewport element (common case: inner <svg> elements)
+    SVGElement* viewportElement = context->viewportElement();
+    if (viewportElement && viewportElement->isSVG()) {
         const SVGSVGElement* svg = static_cast<const SVGSVGElement*>(viewportElement);
         if (svg->hasAttribute(SVGNames::viewBoxAttr)) {
             width = svg->viewBox().width();
@@ -331,25 +342,127 @@ float SVGLength::PercentageOfViewport(float value, const SVGElement* context, SV
             width = svg->width().value(svg);
             height = svg->height().value(svg);
         }
-    } else if (context->parent() && !context->parent()->isSVGElement()) {
-        // Resolve value against enclosing non-SVG RenderBox
-        if (RenderObject* renderer = context->renderer()) {
-            if (renderer->isBox()) {
-                RenderBox* box = toRenderBox(renderer);
-                width = box->width();
-                height = box->height();
-            }
-        }
+
+        return true;
     }
+    
+    // Resolve value against enclosing non-SVG RenderBox
+    if (!context->parent() || context->parent()->isSVGElement())
+        return false;
 
-    if (mode == LengthModeWidth)
+    RenderObject* renderer = context->renderer();
+    if (!renderer || !renderer->isBox())
+        return false;
+
+    RenderBox* box = toRenderBox(renderer);
+    width = box->width();
+    height = box->height();
+    return true;
+}
+
+float SVGLength::convertValueFromUserUnitsToPercentage(float value, const SVGElement* context, ExceptionCode& ec) const
+{
+    float width = 0;
+    float height = 0;
+    if (!determineViewport(context, width, height)) {
+        ec = NOT_SUPPORTED_ERR;
+        return 0;
+    }
+
+    switch (extractMode(m_unit)) {
+    case LengthModeWidth:
+        return value / width * 100;
+    case LengthModeHeight:
+        return value / height * 100;
+    case LengthModeOther:
+        return value / (sqrtf((width * width + height * height) / 2)) * 100;
+    };
+
+    ASSERT_NOT_REACHED();
+    return 0;
+}
+
+float SVGLength::convertValueFromPercentageToUserUnits(float value, const SVGElement* context, ExceptionCode& ec) const
+{
+    float width = 0;
+    float height = 0;
+    if (!determineViewport(context, width, height)) {
+        ec = NOT_SUPPORTED_ERR;
+        return 0;
+    }
+
+    switch (extractMode(m_unit)) {
+    case LengthModeWidth:
         return value * width;
-    else if (mode == LengthModeHeight)
+    case LengthModeHeight:
         return value * height;
-    else if (mode == LengthModeOther)
-        return value * sqrtf(powf(width, 2) + powf(height, 2)) / sqrtf(2.0f);
+    case LengthModeOther:
+        return value * sqrtf((width * width + height * height) / 2);
+    };
 
-    return 0.0f;
+    ASSERT_NOT_REACHED();
+    return 0;
+}
+
+float SVGLength::convertValueFromUserUnitsToEMS(float value, const SVGElement* context, ExceptionCode& ec) const
+{
+    if (!context || !context->renderer() || !context->renderer()->style()) {
+        ec = NOT_SUPPORTED_ERR;
+        return 0;
+    }
+
+    RenderStyle* style = context->renderer()->style();
+    float fontSize = style->fontSize();
+    if (!fontSize) {
+        ec = NOT_SUPPORTED_ERR;
+        return 0;
+    }
+
+    return value / fontSize;
+}
+
+float SVGLength::convertValueFromEMSToUserUnits(float value, const SVGElement* context, ExceptionCode& ec) const
+{
+    if (!context || !context->renderer() || !context->renderer()->style()) {
+        ec = NOT_SUPPORTED_ERR;
+        return 0;
+    }
+
+    RenderStyle* style = context->renderer()->style();
+    return value * style->fontSize();
+}
+
+float SVGLength::convertValueFromUserUnitsToEXS(float value, const SVGElement* context, ExceptionCode& ec) const
+{
+    if (!context || !context->renderer() || !context->renderer()->style()) {
+        ec = NOT_SUPPORTED_ERR;
+        return 0;
+    }
+
+    RenderStyle* style = context->renderer()->style();
+
+    // Use of ceil allows a pixel match to the W3Cs expected output of coords-units-03-b.svg
+    // if this causes problems in real world cases maybe it would be best to remove this
+    float xHeight = ceilf(style->font().xHeight());
+    if (!xHeight) {
+        ec = NOT_SUPPORTED_ERR;
+        return 0;
+    }
+
+    return value / xHeight;
+}
+
+float SVGLength::convertValueFromEXSToUserUnits(float value, const SVGElement* context, ExceptionCode& ec) const
+{
+    if (!context || !context->renderer() || !context->renderer()->style()) {
+        ec = NOT_SUPPORTED_ERR;
+        return 0;
+    }
+
+    RenderStyle* style = context->renderer()->style();
+    // Use of ceil allows a pixel match to the W3Cs expected output of coords-units-03-b.svg
+    // if this causes problems in real world cases maybe it would be best to remove this
+    return value * ceilf(style->font().xHeight());
 }
 
 SVGLength SVGLength::fromCSSPrimitiveValue(CSSPrimitiveValue* value)
@@ -397,8 +510,12 @@ SVGLength SVGLength::fromCSSPrimitiveValue(CSSPrimitiveValue* value)
     if (svgType == LengthTypeUnknown)
         return SVGLength();
 
+    ExceptionCode ec = 0;
     SVGLength length;
-    length.newValueSpecifiedUnits(svgType, value->getFloatValue());
+    length.newValueSpecifiedUnits(svgType, value->getFloatValue(), ec);
+    if (ec)    
+        return SVGLength();
+
     return length;
 }
 
@@ -438,8 +555,6 @@ PassRefPtr<CSSPrimitiveValue> SVGLength::toCSSPrimitiveValue(const SVGLength& le
     case LengthTypePC:
         cssType = CSSPrimitiveValue::CSS_PC;
         break;
-    default:
-        ASSERT_NOT_REACHED();
     };
 
     return CSSPrimitiveValue::create(length.valueInSpecifiedUnits(), cssType);
diff --git a/WebCore/svg/SVGLength.h b/WebCore/svg/SVGLength.h
index a0551f7..ccd22ee 100644
--- a/WebCore/svg/SVGLength.h
+++ b/WebCore/svg/SVGLength.h
@@ -22,7 +22,8 @@
 #define SVGLength_h
 
 #if ENABLE(SVG)
-#include "PlatformString.h"
+#include "ExceptionCode.h"
+#include <wtf/text/WTFString.h>
 
 namespace WebCore {
 
@@ -76,32 +77,43 @@ public:
     bool operator!=(const SVGLength&) const;
 
     float value(const SVGElement* context) const;
-    void setValue(float);
+    float value(const SVGElement* context, ExceptionCode&) const;
+    void setValue(float, const SVGElement* context, ExceptionCode&);
+
+    float valueInSpecifiedUnits() const { return m_valueInSpecifiedUnits; }
+    void setValueInSpecifiedUnits(float value) { m_valueInSpecifiedUnits = value; }
 
-    float valueInSpecifiedUnits() const;
-    void setValueInSpecifiedUnits(float);
-    
     float valueAsPercentage() const;
 
     String valueAsString() const;
-    bool setValueAsString(const String&);
+    void setValueAsString(const String&, ExceptionCode&);
 
-    void newValueSpecifiedUnits(unsigned short, float valueInSpecifiedUnits);
-    void convertToSpecifiedUnits(unsigned short, const SVGElement* context);
+    void newValueSpecifiedUnits(unsigned short, float valueInSpecifiedUnits, ExceptionCode&);
+    void convertToSpecifiedUnits(unsigned short, const SVGElement* context, ExceptionCode&);
 
     // Helper functions
-    static float PercentageOfViewport(float value, const SVGElement* context, SVGLengthMode);
-
     inline bool isRelative() const
     {
         SVGLengthType type = unitType();
-        return (type == LengthTypePercentage || type == LengthTypeEMS || type == LengthTypeEXS);
+        return type == LengthTypePercentage || type == LengthTypeEMS || type == LengthTypeEXS;
     }
 
     static SVGLength fromCSSPrimitiveValue(CSSPrimitiveValue*);
     static PassRefPtr<CSSPrimitiveValue> toCSSPrimitiveValue(const SVGLength&);
 
 private:
+    bool determineViewport(const SVGElement* context, float& width, float& height) const;
+
+    float convertValueFromPercentageToUserUnits(float value, const SVGElement* context, ExceptionCode&) const;
+    float convertValueFromUserUnitsToPercentage(float value, const SVGElement* context, ExceptionCode&) const;
+
+    float convertValueFromUserUnitsToEMS(float value, const SVGElement* context, ExceptionCode&) const;
+    float convertValueFromEMSToUserUnits(float value, const SVGElement* context, ExceptionCode&) const;
+
+    float convertValueFromUserUnitsToEXS(float value, const SVGElement* context, ExceptionCode&) const;
+    float convertValueFromEXSToUserUnits(float value, const SVGElement* context, ExceptionCode&) const;
+
+private:
     float m_valueInSpecifiedUnits;
     unsigned int m_unit;
 };
diff --git a/WebCore/svg/SVGLength.idl b/WebCore/svg/SVGLength.idl
index 166019e..0e6807f 100644
--- a/WebCore/svg/SVGLength.idl
+++ b/WebCore/svg/SVGLength.idl
@@ -37,14 +37,20 @@ module svg {
         const unsigned short SVG_LENGTHTYPE_PC         = 10;
 
         readonly attribute unsigned short unitType;
-        attribute [CustomGetter] float value;
-        attribute float valueInSpecifiedUnits;
-        attribute [ConvertNullToNullString] DOMString valueAsString;
+        attribute [Custom, StrictTypeChecking] float value
+            setter raises(DOMException),
+            getter raises(DOMException);
 
-        void newValueSpecifiedUnits(in unsigned short unitType, 
-                                    in float valueInSpecifiedUnits);
+        attribute [StrictTypeChecking] float valueInSpecifiedUnits;
+        attribute [ConvertNullToNullString, StrictTypeChecking] DOMString valueAsString
+            setter raises(DOMException);
 
-        [Custom] void convertToSpecifiedUnits(in unsigned short unitType);
+        [StrictTypeChecking, RequiresAllArguments=Raise] void newValueSpecifiedUnits(in unsigned short unitType, 
+                                                         in float valueInSpecifiedUnits)
+            raises(DOMException);
+
+        [Custom, StrictTypeChecking, RequiresAllArguments=Raise] void convertToSpecifiedUnits(in unsigned short unitType)
+            raises(DOMException);
     };
 
 }
diff --git a/WebCore/svg/SVGLengthList.cpp b/WebCore/svg/SVGLengthList.cpp
index 3ab7c1a..a05ea4b 100644
--- a/WebCore/svg/SVGLengthList.cpp
+++ b/WebCore/svg/SVGLengthList.cpp
@@ -31,6 +31,7 @@ namespace WebCore {
 void SVGLengthList::parse(const String& value, SVGLengthMode mode)
 {
     clear();
+    ExceptionCode ec = 0;
 
     const UChar* ptr = value.characters();
     const UChar* end = ptr + value.length();
@@ -40,8 +41,13 @@ void SVGLengthList::parse(const String& value, SVGLengthMode mode)
             ptr++;
         if (ptr == start)
             break;
+
         SVGLength length(mode);
-        if (!length.setValueAsString(String(start, ptr - start)))
+        String valueString(start, ptr - start);
+        if (valueString.isEmpty())
+            return;
+        length.setValueAsString(valueString, ec);
+        if (ec)
             return;
         append(length);
         skipOptionalSpacesOrDelimiter(ptr, end);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list