blob: 6b7ea877ce061b68f2ed34650b3d1823feda5f96 [file] [log] [blame]
zimmermann@webkit.org6238d762008-03-01 13:46:29 +00001// [Name] SVGForeignObjectElement-svgdom-width-prop.js
oliver@apple.com312d73e2008-04-03 20:30:05 +00002// [Expected rendering result] 'Test passed' text - and a series of PASS mesages
zimmermann@webkit.org6238d762008-03-01 13:46:29 +00003
4description("Tests dynamic updates of the 'width' property of the SVGForeignObjectElement object")
5createSVGTestCase();
6
7var foreignObjectElement = createSVGElement("foreignObject");
8foreignObjectElement.setAttribute("x", "100");
9foreignObjectElement.setAttribute("y", "80");
oliver@apple.com312d73e2008-04-03 20:30:05 +000010foreignObjectElement.setAttribute("width", "0");
zimmermann@webkit.org6238d762008-03-01 13:46:29 +000011foreignObjectElement.setAttribute("height", "150");
12
13var htmlDivElement = document.createElementNS(xhtmlNS, "xhtml:div");
14htmlDivElement.setAttribute("style", "background-color: green; color: white; text-align: center");
15htmlDivElement.textContent = "Test passed";
16
17foreignObjectElement.appendChild(htmlDivElement);
18rootSVGElement.appendChild(foreignObjectElement);
19
oliver@apple.com312d73e2008-04-03 20:30:05 +000020shouldBe("foreignObjectElement.width.baseVal.value", "0");
zimmermann@webkit.org6238d762008-03-01 13:46:29 +000021
22function executeTest() {
23 foreignObjectElement.width.baseVal.value = "150";
24 shouldBe("foreignObjectElement.width.baseVal.value", "150");
25
oliver@apple.com312d73e2008-04-03 20:30:05 +000026 waitForClickEvent(foreignObjectElement);
27 triggerUpdate();
zimmermann@webkit.org6238d762008-03-01 13:46:29 +000028}
29
oliver@apple.com312d73e2008-04-03 20:30:05 +000030executeTest();
31var successfullyParsed = true;