Reviewed by Oliver.

Fixes: http://bugs.webkit.org/show_bug.cgi?id=17568 (SVGForeignObjectElement can't react to width/height SVG DOM changes)

As the bug title says, fix all dynamic update problems that occour with SVGForeignObjectElement.

Tests: svg/dynamic-updates/SVGForeignObjectElement-dom-height-attr.html
	   svg/dynamic-updates/SVGForeignObjectElement-dom-width-attr.html
	   svg/dynamic-updates/SVGForeignObjectElement-dom-x-attr.html
	   svg/dynamic-updates/SVGForeignObjectElement-dom-y-attr.html
	   svg/dynamic-updates/SVGForeignObjectElement-svgdom-height-prop.html
	   svg/dynamic-updates/SVGForeignObjectElement-svgdom-width-prop.html
	   svg/dynamic-updates/SVGForeignObjectElement-svgdom-x-prop.html
	   svg/dynamic-updates/SVGForeignObjectElement-svgdom-y-prop.html


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@30695 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/svg/dynamic-updates/SVGForeignObjectElement-dom-height-attr-expected.txt b/LayoutTests/svg/dynamic-updates/SVGForeignObjectElement-dom-height-attr-expected.txt
new file mode 100644
index 0000000..881e0af
--- /dev/null
+++ b/LayoutTests/svg/dynamic-updates/SVGForeignObjectElement-dom-height-attr-expected.txt
@@ -0,0 +1,14 @@
+SVG 1.1 dynamic update tests
+
+Test passed
+Tests dynamic updates of the 'height' attribute of the SVGForeignObjectElement object
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS foreignObjectElement.getAttribute('height') is "0"
+PASS foreignObjectElement.getAttribute('height') is "150"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/svg/dynamic-updates/SVGForeignObjectElement-dom-height-attr.html b/LayoutTests/svg/dynamic-updates/SVGForeignObjectElement-dom-height-attr.html
new file mode 100644
index 0000000..6986373
--- /dev/null
+++ b/LayoutTests/svg/dynamic-updates/SVGForeignObjectElement-dom-height-attr.html
@@ -0,0 +1,15 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
+<script src="resources/SVGTestCase.js"></script>
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<h1>SVG 1.1 dynamic update tests</h1>
+<p id="description"></p>
+<div id="console"></div>
+<script src="resources/SVGForeignObjectElement-dom-height-attr.js"></script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/svg/dynamic-updates/SVGForeignObjectElement-dom-width-attr-expected.txt b/LayoutTests/svg/dynamic-updates/SVGForeignObjectElement-dom-width-attr-expected.txt
new file mode 100644
index 0000000..37c531c
--- /dev/null
+++ b/LayoutTests/svg/dynamic-updates/SVGForeignObjectElement-dom-width-attr-expected.txt
@@ -0,0 +1,14 @@
+SVG 1.1 dynamic update tests
+
+Test passed
+Tests dynamic updates of the 'width' attribute of the SVGForeignObjectElement object
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS foreignObjectElement.getAttribute('width') is "0"
+PASS foreignObjectElement.getAttribute('width') is "150"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/svg/dynamic-updates/SVGForeignObjectElement-dom-width-attr.html b/LayoutTests/svg/dynamic-updates/SVGForeignObjectElement-dom-width-attr.html
new file mode 100644
index 0000000..f409cff
--- /dev/null
+++ b/LayoutTests/svg/dynamic-updates/SVGForeignObjectElement-dom-width-attr.html
@@ -0,0 +1,15 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
+<script src="resources/SVGTestCase.js"></script>
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<h1>SVG 1.1 dynamic update tests</h1>
+<p id="description"></p>
+<div id="console"></div>
+<script src="resources/SVGForeignObjectElement-dom-width-attr.js"></script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/svg/dynamic-updates/SVGForeignObjectElement-dom-x-attr-expected.txt b/LayoutTests/svg/dynamic-updates/SVGForeignObjectElement-dom-x-attr-expected.txt
new file mode 100644
index 0000000..295c0fe
--- /dev/null
+++ b/LayoutTests/svg/dynamic-updates/SVGForeignObjectElement-dom-x-attr-expected.txt
@@ -0,0 +1,14 @@
+SVG 1.1 dynamic update tests
+
+Test passed
+Tests dynamic updates of the 'x' attribute of the SVGForeignObjectElement object
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS foreignObjectElement.getAttribute('x') is "-100"
+PASS foreignObjectElement.getAttribute('x') is "100"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/svg/dynamic-updates/SVGForeignObjectElement-dom-x-attr.html b/LayoutTests/svg/dynamic-updates/SVGForeignObjectElement-dom-x-attr.html
new file mode 100644
index 0000000..f8b365d
--- /dev/null
+++ b/LayoutTests/svg/dynamic-updates/SVGForeignObjectElement-dom-x-attr.html
@@ -0,0 +1,15 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
+<script src="resources/SVGTestCase.js"></script>
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<h1>SVG 1.1 dynamic update tests</h1>
+<p id="description"></p>
+<div id="console"></div>
+<script src="resources/SVGForeignObjectElement-dom-x-attr.js"></script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/svg/dynamic-updates/SVGForeignObjectElement-dom-y-attr-expected.txt b/LayoutTests/svg/dynamic-updates/SVGForeignObjectElement-dom-y-attr-expected.txt
new file mode 100644
index 0000000..676eae2
--- /dev/null
+++ b/LayoutTests/svg/dynamic-updates/SVGForeignObjectElement-dom-y-attr-expected.txt
@@ -0,0 +1,14 @@
+SVG 1.1 dynamic update tests
+
+Test passed
+Tests dynamic updates of the 'y' attribute of the SVGForeignObjectElement object
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS foreignObjectElement.getAttribute('y') is "-80"
+PASS foreignObjectElement.getAttribute('y') is "80"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/svg/dynamic-updates/SVGForeignObjectElement-dom-y-attr.html b/LayoutTests/svg/dynamic-updates/SVGForeignObjectElement-dom-y-attr.html
new file mode 100644
index 0000000..1216bc7
--- /dev/null
+++ b/LayoutTests/svg/dynamic-updates/SVGForeignObjectElement-dom-y-attr.html
@@ -0,0 +1,15 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
+<script src="resources/SVGTestCase.js"></script>
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<h1>SVG 1.1 dynamic update tests</h1>
+<p id="description"></p>
+<div id="console"></div>
+<script src="resources/SVGForeignObjectElement-dom-y-attr.js"></script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/svg/dynamic-updates/SVGForeignObjectElement-svgdom-height-prop-expected.txt b/LayoutTests/svg/dynamic-updates/SVGForeignObjectElement-svgdom-height-prop-expected.txt
new file mode 100644
index 0000000..db38144
--- /dev/null
+++ b/LayoutTests/svg/dynamic-updates/SVGForeignObjectElement-svgdom-height-prop-expected.txt
@@ -0,0 +1,14 @@
+SVG 1.1 dynamic update tests
+
+Test passed
+Tests dynamic updates of the 'height' property of the SVGForeignObjectElement object
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS foreignObjectElement.height.baseVal.value is 0
+PASS foreignObjectElement.height.baseVal.value is 150
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/svg/dynamic-updates/SVGForeignObjectElement-svgdom-height-prop.html b/LayoutTests/svg/dynamic-updates/SVGForeignObjectElement-svgdom-height-prop.html
new file mode 100644
index 0000000..4a352ae
--- /dev/null
+++ b/LayoutTests/svg/dynamic-updates/SVGForeignObjectElement-svgdom-height-prop.html
@@ -0,0 +1,15 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
+<script src="resources/SVGTestCase.js"></script>
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<h1>SVG 1.1 dynamic update tests</h1>
+<p id="description"></p>
+<div id="console"></div>
+<script src="resources/SVGForeignObjectElement-svgdom-height-prop.js"></script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/svg/dynamic-updates/SVGForeignObjectElement-svgdom-width-prop-expected.txt b/LayoutTests/svg/dynamic-updates/SVGForeignObjectElement-svgdom-width-prop-expected.txt
new file mode 100644
index 0000000..34ecbb1
--- /dev/null
+++ b/LayoutTests/svg/dynamic-updates/SVGForeignObjectElement-svgdom-width-prop-expected.txt
@@ -0,0 +1,14 @@
+SVG 1.1 dynamic update tests
+
+Test passed
+Tests dynamic updates of the 'width' property of the SVGForeignObjectElement object
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS foreignObjectElement.width.baseVal.value is 0
+PASS foreignObjectElement.width.baseVal.value is 150
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/svg/dynamic-updates/SVGForeignObjectElement-svgdom-width-prop.html b/LayoutTests/svg/dynamic-updates/SVGForeignObjectElement-svgdom-width-prop.html
new file mode 100644
index 0000000..20e7ed6
--- /dev/null
+++ b/LayoutTests/svg/dynamic-updates/SVGForeignObjectElement-svgdom-width-prop.html
@@ -0,0 +1,15 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
+<script src="resources/SVGTestCase.js"></script>
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<h1>SVG 1.1 dynamic update tests</h1>
+<p id="description"></p>
+<div id="console"></div>
+<script src="resources/SVGForeignObjectElement-svgdom-width-prop.js"></script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/svg/dynamic-updates/SVGForeignObjectElement-svgdom-x-prop-expected.txt b/LayoutTests/svg/dynamic-updates/SVGForeignObjectElement-svgdom-x-prop-expected.txt
new file mode 100644
index 0000000..d21f255
--- /dev/null
+++ b/LayoutTests/svg/dynamic-updates/SVGForeignObjectElement-svgdom-x-prop-expected.txt
@@ -0,0 +1,14 @@
+SVG 1.1 dynamic update tests
+
+Test passed
+Tests dynamic updates of the 'x' property of the SVGForeignObjectElement object
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS foreignObjectElement.x.baseVal.value is -100
+PASS foreignObjectElement.x.baseVal.value is 100
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/svg/dynamic-updates/SVGForeignObjectElement-svgdom-x-prop.html b/LayoutTests/svg/dynamic-updates/SVGForeignObjectElement-svgdom-x-prop.html
new file mode 100644
index 0000000..80d53ae
--- /dev/null
+++ b/LayoutTests/svg/dynamic-updates/SVGForeignObjectElement-svgdom-x-prop.html
@@ -0,0 +1,15 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
+<script src="resources/SVGTestCase.js"></script>
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<h1>SVG 1.1 dynamic update tests</h1>
+<p id="description"></p>
+<div id="console"></div>
+<script src="resources/SVGForeignObjectElement-svgdom-x-prop.js"></script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/svg/dynamic-updates/SVGForeignObjectElement-svgdom-y-prop-expected.txt b/LayoutTests/svg/dynamic-updates/SVGForeignObjectElement-svgdom-y-prop-expected.txt
new file mode 100644
index 0000000..6dc8fdf
--- /dev/null
+++ b/LayoutTests/svg/dynamic-updates/SVGForeignObjectElement-svgdom-y-prop-expected.txt
@@ -0,0 +1,14 @@
+SVG 1.1 dynamic update tests
+
+Test passed
+Tests dynamic updates of the 'y' property of the SVGForeignObjectElement object
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS foreignObjectElement.y.baseVal.value is -80
+PASS foreignObjectElement.y.baseVal.value is 80
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/svg/dynamic-updates/SVGForeignObjectElement-svgdom-y-prop.html b/LayoutTests/svg/dynamic-updates/SVGForeignObjectElement-svgdom-y-prop.html
new file mode 100644
index 0000000..e447e35
--- /dev/null
+++ b/LayoutTests/svg/dynamic-updates/SVGForeignObjectElement-svgdom-y-prop.html
@@ -0,0 +1,15 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
+<script src="resources/SVGTestCase.js"></script>
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<h1>SVG 1.1 dynamic update tests</h1>
+<p id="description"></p>
+<div id="console"></div>
+<script src="resources/SVGForeignObjectElement-svgdom-y-prop.js"></script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/svg/dynamic-updates/resources/SVGForeignObjectElement-dom-height-attr.js b/LayoutTests/svg/dynamic-updates/resources/SVGForeignObjectElement-dom-height-attr.js
new file mode 100644
index 0000000..adc58b1
--- /dev/null
+++ b/LayoutTests/svg/dynamic-updates/resources/SVGForeignObjectElement-dom-height-attr.js
@@ -0,0 +1,31 @@
+// [Name] SVGForeignObjectElement-dom-height-attr.js
+// [Expected rendering result] 'Test passed' text - and a series of PASS mesages
+
+description("Tests dynamic updates of the 'height' attribute of the SVGForeignObjectElement object")
+createSVGTestCase();
+
+var foreignObjectElement = createSVGElement("foreignObject");
+foreignObjectElement.setAttribute("x", "100");
+foreignObjectElement.setAttribute("y", "80");
+foreignObjectElement.setAttribute("width", "150");
+foreignObjectElement.setAttribute("height", "0");
+
+var htmlDivElement = document.createElementNS(xhtmlNS, "xhtml:div");
+htmlDivElement.setAttribute("style", "background-color: green; color: white; text-align: center");
+htmlDivElement.textContent = "Test passed";
+
+foreignObjectElement.appendChild(htmlDivElement);
+rootSVGElement.appendChild(foreignObjectElement);
+
+shouldBeEqualToString("foreignObjectElement.getAttribute('height')", "0");
+
+function executeTest() {
+    foreignObjectElement.setAttribute("height", "150");
+    shouldBeEqualToString("foreignObjectElement.getAttribute('height')", "150");
+
+    waitForClickEvent(foreignObjectElement);
+    triggerUpdate();
+}
+
+executeTest();
+var successfullyParsed = true;
diff --git a/LayoutTests/svg/dynamic-updates/resources/SVGForeignObjectElement-dom-width-attr.js b/LayoutTests/svg/dynamic-updates/resources/SVGForeignObjectElement-dom-width-attr.js
new file mode 100644
index 0000000..453526c
--- /dev/null
+++ b/LayoutTests/svg/dynamic-updates/resources/SVGForeignObjectElement-dom-width-attr.js
@@ -0,0 +1,31 @@
+// [Name] SVGForeignObjectElement-dom-width-attr.js
+// [Expected rendering result] 'Test passed' text - and a series of PASS mesages
+
+description("Tests dynamic updates of the 'width' attribute of the SVGForeignObjectElement object")
+createSVGTestCase();
+
+var foreignObjectElement = createSVGElement("foreignObject");
+foreignObjectElement.setAttribute("x", "100");
+foreignObjectElement.setAttribute("y", "80");
+foreignObjectElement.setAttribute("width", "0");
+foreignObjectElement.setAttribute("height", "150");
+
+var htmlDivElement = document.createElementNS(xhtmlNS, "xhtml:div");
+htmlDivElement.setAttribute("style", "background-color: green; color: white; text-align: center");
+htmlDivElement.textContent = "Test passed";
+
+foreignObjectElement.appendChild(htmlDivElement);
+rootSVGElement.appendChild(foreignObjectElement);
+
+shouldBeEqualToString("foreignObjectElement.getAttribute('width')", "0");
+
+function executeTest() {
+    foreignObjectElement.setAttribute("width", "150");
+    shouldBeEqualToString("foreignObjectElement.getAttribute('width')", "150");
+
+    waitForClickEvent(foreignObjectElement);
+    triggerUpdate();
+}
+
+executeTest();
+var successfullyParsed = true;
diff --git a/LayoutTests/svg/dynamic-updates/resources/SVGForeignObjectElement-dom-x-attr.js b/LayoutTests/svg/dynamic-updates/resources/SVGForeignObjectElement-dom-x-attr.js
new file mode 100644
index 0000000..4cbae01
--- /dev/null
+++ b/LayoutTests/svg/dynamic-updates/resources/SVGForeignObjectElement-dom-x-attr.js
@@ -0,0 +1,31 @@
+// [Name] SVGForeignObjectElement-dom-x-attr.js
+// [Expected rendering result] 'Test passed' text - and a series of PASS mesages
+
+description("Tests dynamic updates of the 'x' attribute of the SVGForeignObjectElement object")
+createSVGTestCase();
+
+var foreignObjectElement = createSVGElement("foreignObject");
+foreignObjectElement.setAttribute("x", "-100");
+foreignObjectElement.setAttribute("y", "80");
+foreignObjectElement.setAttribute("width", "150");
+foreignObjectElement.setAttribute("height", "150");
+
+var htmlDivElement = document.createElementNS(xhtmlNS, "xhtml:div");
+htmlDivElement.setAttribute("style", "background-color: green; color: white; text-align: center");
+htmlDivElement.textContent = "Test passed";
+
+foreignObjectElement.appendChild(htmlDivElement);
+rootSVGElement.appendChild(foreignObjectElement);
+
+shouldBeEqualToString("foreignObjectElement.getAttribute('x')", "-100");
+
+function executeTest() {
+    foreignObjectElement.setAttribute("x", "100");
+    shouldBeEqualToString("foreignObjectElement.getAttribute('x')", "100");
+
+    waitForClickEvent(foreignObjectElement);
+    triggerUpdate();
+}
+
+executeTest();
+var successfullyParsed = true;
diff --git a/LayoutTests/svg/dynamic-updates/resources/SVGForeignObjectElement-dom-y-attr.js b/LayoutTests/svg/dynamic-updates/resources/SVGForeignObjectElement-dom-y-attr.js
new file mode 100644
index 0000000..69e5ed4
--- /dev/null
+++ b/LayoutTests/svg/dynamic-updates/resources/SVGForeignObjectElement-dom-y-attr.js
@@ -0,0 +1,31 @@
+// [Name] SVGForeignObjectElement-dom-y-attr.js
+// [Expected rendering result] 'Test passed' text - and a series of PASS mesages
+
+description("Tests dynamic updates of the 'y' attribute of the SVGForeignObjectElement object")
+createSVGTestCase();
+
+var foreignObjectElement = createSVGElement("foreignObject");
+foreignObjectElement.setAttribute("x", "100");
+foreignObjectElement.setAttribute("y", "-80");
+foreignObjectElement.setAttribute("width", "150");
+foreignObjectElement.setAttribute("height", "150");
+
+var htmlDivElement = document.createElementNS(xhtmlNS, "xhtml:div");
+htmlDivElement.setAttribute("style", "background-color: green; color: white; text-align: center");
+htmlDivElement.textContent = "Test passed";
+
+foreignObjectElement.appendChild(htmlDivElement);
+rootSVGElement.appendChild(foreignObjectElement);
+
+shouldBeEqualToString("foreignObjectElement.getAttribute('y')", "-80");
+
+function executeTest() {
+    foreignObjectElement.setAttribute("y", "80");
+    shouldBeEqualToString("foreignObjectElement.getAttribute('y')", "80");
+
+    waitForClickEvent(foreignObjectElement);
+    triggerUpdate();
+}
+
+executeTest();
+var successfullyParsed = true;
diff --git a/LayoutTests/svg/dynamic-updates/resources/SVGForeignObjectElement-svgdom-height-prop.js b/LayoutTests/svg/dynamic-updates/resources/SVGForeignObjectElement-svgdom-height-prop.js
new file mode 100644
index 0000000..ccf644c
--- /dev/null
+++ b/LayoutTests/svg/dynamic-updates/resources/SVGForeignObjectElement-svgdom-height-prop.js
@@ -0,0 +1,31 @@
+// [Name] SVGForeignObjectElement-svgdom-height-prop.js
+// [Expected rendering result] 'Test passed' text - and a series of PASS mesages
+
+description("Tests dynamic updates of the 'height' property of the SVGForeignObjectElement object")
+createSVGTestCase();
+
+var foreignObjectElement = createSVGElement("foreignObject");
+foreignObjectElement.setAttribute("x", "100");
+foreignObjectElement.setAttribute("y", "80");
+foreignObjectElement.setAttribute("width", "150");
+foreignObjectElement.setAttribute("height", "0");
+
+var htmlDivElement = document.createElementNS(xhtmlNS, "xhtml:div");
+htmlDivElement.setAttribute("style", "background-color: green; color: white; text-align: center");
+htmlDivElement.textContent = "Test passed";
+
+foreignObjectElement.appendChild(htmlDivElement);
+rootSVGElement.appendChild(foreignObjectElement);
+
+shouldBe("foreignObjectElement.height.baseVal.value", "0");
+
+function executeTest() {
+    foreignObjectElement.height.baseVal.value = "150";
+    shouldBe("foreignObjectElement.height.baseVal.value", "150");
+
+    waitForClickEvent(foreignObjectElement);
+    triggerUpdate();
+}
+
+executeTest();
+var successfullyParsed = true;
diff --git a/LayoutTests/svg/dynamic-updates/resources/SVGForeignObjectElement-svgdom-width-prop.js b/LayoutTests/svg/dynamic-updates/resources/SVGForeignObjectElement-svgdom-width-prop.js
new file mode 100644
index 0000000..6b7ea87
--- /dev/null
+++ b/LayoutTests/svg/dynamic-updates/resources/SVGForeignObjectElement-svgdom-width-prop.js
@@ -0,0 +1,31 @@
+// [Name] SVGForeignObjectElement-svgdom-width-prop.js
+// [Expected rendering result] 'Test passed' text - and a series of PASS mesages
+
+description("Tests dynamic updates of the 'width' property of the SVGForeignObjectElement object")
+createSVGTestCase();
+
+var foreignObjectElement = createSVGElement("foreignObject");
+foreignObjectElement.setAttribute("x", "100");
+foreignObjectElement.setAttribute("y", "80");
+foreignObjectElement.setAttribute("width", "0");
+foreignObjectElement.setAttribute("height", "150");
+
+var htmlDivElement = document.createElementNS(xhtmlNS, "xhtml:div");
+htmlDivElement.setAttribute("style", "background-color: green; color: white; text-align: center");
+htmlDivElement.textContent = "Test passed";
+
+foreignObjectElement.appendChild(htmlDivElement);
+rootSVGElement.appendChild(foreignObjectElement);
+
+shouldBe("foreignObjectElement.width.baseVal.value", "0");
+
+function executeTest() {
+    foreignObjectElement.width.baseVal.value = "150";
+    shouldBe("foreignObjectElement.width.baseVal.value", "150");
+
+    waitForClickEvent(foreignObjectElement);
+    triggerUpdate();
+}
+
+executeTest();
+var successfullyParsed = true;
diff --git a/LayoutTests/svg/dynamic-updates/resources/SVGForeignObjectElement-svgdom-x-prop.js b/LayoutTests/svg/dynamic-updates/resources/SVGForeignObjectElement-svgdom-x-prop.js
new file mode 100644
index 0000000..5a54140
--- /dev/null
+++ b/LayoutTests/svg/dynamic-updates/resources/SVGForeignObjectElement-svgdom-x-prop.js
@@ -0,0 +1,31 @@
+// [Name] SVGForeignObjectElement-svgdom-x-prop.js
+// [Expected rendering result] 'Test passed' text - and a series of PASS mesages
+
+description("Tests dynamic updates of the 'x' property of the SVGForeignObjectElement object")
+createSVGTestCase();
+
+var foreignObjectElement = createSVGElement("foreignObject");
+foreignObjectElement.setAttribute("x", "-100");
+foreignObjectElement.setAttribute("y", "80");
+foreignObjectElement.setAttribute("width", "150");
+foreignObjectElement.setAttribute("height", "150");
+
+var htmlDivElement = document.createElementNS(xhtmlNS, "xhtml:div");
+htmlDivElement.setAttribute("style", "background-color: green; color: white; text-align: center");
+htmlDivElement.textContent = "Test passed";
+
+foreignObjectElement.appendChild(htmlDivElement);
+rootSVGElement.appendChild(foreignObjectElement);
+
+shouldBe("foreignObjectElement.x.baseVal.value", "-100");
+
+function executeTest() {
+    foreignObjectElement.x.baseVal.value = "100";
+    shouldBe("foreignObjectElement.x.baseVal.value", "100");
+
+    waitForClickEvent(foreignObjectElement);
+    triggerUpdate();
+}
+
+executeTest();
+var successfullyParsed = true;
diff --git a/LayoutTests/svg/dynamic-updates/resources/SVGForeignObjectElement-svgdom-y-prop.js b/LayoutTests/svg/dynamic-updates/resources/SVGForeignObjectElement-svgdom-y-prop.js
new file mode 100644
index 0000000..5655d8a
--- /dev/null
+++ b/LayoutTests/svg/dynamic-updates/resources/SVGForeignObjectElement-svgdom-y-prop.js
@@ -0,0 +1,31 @@
+// [Name] SVGForeignObjectElement-svgdom-y-prop.js
+// [Expected rendering result] 'Test passed' text - and a series of PASS mesages
+
+description("Tests dynamic updates of the 'y' property of the SVGForeignObjectElement object")
+createSVGTestCase();
+
+var foreignObjectElement = createSVGElement("foreignObject");
+foreignObjectElement.setAttribute("x", "100");
+foreignObjectElement.setAttribute("y", "-80");
+foreignObjectElement.setAttribute("width", "150");
+foreignObjectElement.setAttribute("height", "150");
+
+var htmlDivElement = document.createElementNS(xhtmlNS, "xhtml:div");
+htmlDivElement.setAttribute("style", "background-color: green; color: white; text-align: center");
+htmlDivElement.textContent = "Test passed";
+
+foreignObjectElement.appendChild(htmlDivElement);
+rootSVGElement.appendChild(foreignObjectElement);
+
+shouldBe("foreignObjectElement.y.baseVal.value", "-80");
+
+function executeTest() {
+    foreignObjectElement.y.baseVal.value = "80";
+    shouldBe("foreignObjectElement.y.baseVal.value", "80");
+
+    waitForClickEvent(foreignObjectElement);
+    triggerUpdate();
+}
+
+executeTest();
+var successfullyParsed = true;
diff --git a/LayoutTests/svg/dynamic-updates/resources/SVGTestCase.js b/LayoutTests/svg/dynamic-updates/resources/SVGTestCase.js
index c05ef10..eeeb5cc 100644
--- a/LayoutTests/svg/dynamic-updates/resources/SVGTestCase.js
+++ b/LayoutTests/svg/dynamic-updates/resources/SVGTestCase.js
@@ -1,5 +1,6 @@
 var svgNS = "http://www.w3.org/2000/svg";
 var xlinkNS = "http://www.w3.org/1999/xlink";
+var xhtmlNS = "http://www.w3.org/1999/xhtml";
 
 var rootSVGElement;