Commit 6238d76f authored by zimmermann@webkit.org's avatar zimmermann@webkit.org

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
parent 43e8eb12
2008-03-01 Nikolas Zimmermann <zimmermann@kde.org>
Reviewed by Oliver.
Add new set of dynamic updates tests, this time for SVGForeignObjectElement.
* platform/mac-leopard/svg/dynamic-updates/SVGForeignObjectElement-dom-height-attr-expected.checksum: Added.
* platform/mac-leopard/svg/dynamic-updates/SVGForeignObjectElement-dom-height-attr-expected.png: Added.
* platform/mac-leopard/svg/dynamic-updates/SVGForeignObjectElement-dom-width-attr-expected.checksum: Added.
* platform/mac-leopard/svg/dynamic-updates/SVGForeignObjectElement-dom-width-attr-expected.png: Added.
* platform/mac-leopard/svg/dynamic-updates/SVGForeignObjectElement-dom-x-attr-expected.checksum: Added.
* platform/mac-leopard/svg/dynamic-updates/SVGForeignObjectElement-dom-x-attr-expected.png: Added.
* platform/mac-leopard/svg/dynamic-updates/SVGForeignObjectElement-dom-y-attr-expected.checksum: Added.
* platform/mac-leopard/svg/dynamic-updates/SVGForeignObjectElement-dom-y-attr-expected.png: Added.
* platform/mac-leopard/svg/dynamic-updates/SVGForeignObjectElement-svgdom-height-prop-expected.checksum: Added.
* platform/mac-leopard/svg/dynamic-updates/SVGForeignObjectElement-svgdom-height-prop-expected.png: Added.
* platform/mac-leopard/svg/dynamic-updates/SVGForeignObjectElement-svgdom-width-prop-expected.checksum: Added.
* platform/mac-leopard/svg/dynamic-updates/SVGForeignObjectElement-svgdom-width-prop-expected.png: Added.
* platform/mac-leopard/svg/dynamic-updates/SVGForeignObjectElement-svgdom-x-prop-expected.checksum: Added.
* platform/mac-leopard/svg/dynamic-updates/SVGForeignObjectElement-svgdom-x-prop-expected.png: Added.
* platform/mac-leopard/svg/dynamic-updates/SVGForeignObjectElement-svgdom-y-prop-expected.checksum: Added.
* platform/mac-leopard/svg/dynamic-updates/SVGForeignObjectElement-svgdom-y-prop-expected.png: Added.
* svg/dynamic-updates/SVGForeignObjectElement-dom-height-attr-expected.txt: Added.
* svg/dynamic-updates/SVGForeignObjectElement-dom-height-attr.html: Added.
* svg/dynamic-updates/SVGForeignObjectElement-dom-width-attr-expected.txt: Added.
* svg/dynamic-updates/SVGForeignObjectElement-dom-width-attr.html: Added.
* svg/dynamic-updates/SVGForeignObjectElement-dom-x-attr-expected.txt: Added.
* svg/dynamic-updates/SVGForeignObjectElement-dom-x-attr.html: Added.
* svg/dynamic-updates/SVGForeignObjectElement-dom-y-attr-expected.txt: Added.
* svg/dynamic-updates/SVGForeignObjectElement-dom-y-attr.html: Added.
* svg/dynamic-updates/SVGForeignObjectElement-svgdom-height-prop-expected.txt: Added.
* svg/dynamic-updates/SVGForeignObjectElement-svgdom-height-prop.html: Added.
* svg/dynamic-updates/SVGForeignObjectElement-svgdom-width-prop-expected.txt: Added.
* svg/dynamic-updates/SVGForeignObjectElement-svgdom-width-prop.html: Added.
* svg/dynamic-updates/SVGForeignObjectElement-svgdom-x-prop-expected.txt: Added.
* svg/dynamic-updates/SVGForeignObjectElement-svgdom-x-prop.html: Added.
* svg/dynamic-updates/SVGForeignObjectElement-svgdom-y-prop-expected.txt: Added.
* svg/dynamic-updates/SVGForeignObjectElement-svgdom-y-prop.html: Added.
* svg/dynamic-updates/resources/SVGForeignObjectElement-dom-height-attr.js: Added.
* svg/dynamic-updates/resources/SVGForeignObjectElement-dom-width-attr.js: Added.
* svg/dynamic-updates/resources/SVGForeignObjectElement-dom-x-attr.js: Added.
* svg/dynamic-updates/resources/SVGForeignObjectElement-dom-y-attr.js: Added.
* svg/dynamic-updates/resources/SVGForeignObjectElement-svgdom-height-prop.js: Added.
* svg/dynamic-updates/resources/SVGForeignObjectElement-svgdom-width-prop.js: Added.
* svg/dynamic-updates/resources/SVGForeignObjectElement-svgdom-x-prop.js: Added.
* svg/dynamic-updates/resources/SVGForeignObjectElement-svgdom-y-prop.js: Added.
* svg/dynamic-updates/resources/SVGTestCase.js: Add xhtml namespace 'xhtmlNS'.
2008-02-29 Dan Bernstein <mitz@apple.com>
Rubber-stamped by Sam Weinig.
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
<!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>
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
<!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>
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
<!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>
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
<!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>
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
<!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>
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
<!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>
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
<!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>
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
<!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>
// [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;
// [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;
// [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;
// [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;
// [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;
// [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;
// [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;
// [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");<