zimmermann@webkit.org | 6238d76 | 2008-03-01 13:46:29 +0000 | [diff] [blame] | 1 | // [Name] SVGForeignObjectElement-svgdom-width-prop.js |
oliver@apple.com | 312d73e | 2008-04-03 20:30:05 +0000 | [diff] [blame^] | 2 | // [Expected rendering result] 'Test passed' text - and a series of PASS mesages |
zimmermann@webkit.org | 6238d76 | 2008-03-01 13:46:29 +0000 | [diff] [blame] | 3 | |
| 4 | description("Tests dynamic updates of the 'width' property of the SVGForeignObjectElement object") |
| 5 | createSVGTestCase(); |
| 6 | |
| 7 | var foreignObjectElement = createSVGElement("foreignObject"); |
| 8 | foreignObjectElement.setAttribute("x", "100"); |
| 9 | foreignObjectElement.setAttribute("y", "80"); |
oliver@apple.com | 312d73e | 2008-04-03 20:30:05 +0000 | [diff] [blame^] | 10 | foreignObjectElement.setAttribute("width", "0"); |
zimmermann@webkit.org | 6238d76 | 2008-03-01 13:46:29 +0000 | [diff] [blame] | 11 | foreignObjectElement.setAttribute("height", "150"); |
| 12 | |
| 13 | var htmlDivElement = document.createElementNS(xhtmlNS, "xhtml:div"); |
| 14 | htmlDivElement.setAttribute("style", "background-color: green; color: white; text-align: center"); |
| 15 | htmlDivElement.textContent = "Test passed"; |
| 16 | |
| 17 | foreignObjectElement.appendChild(htmlDivElement); |
| 18 | rootSVGElement.appendChild(foreignObjectElement); |
| 19 | |
oliver@apple.com | 312d73e | 2008-04-03 20:30:05 +0000 | [diff] [blame^] | 20 | shouldBe("foreignObjectElement.width.baseVal.value", "0"); |
zimmermann@webkit.org | 6238d76 | 2008-03-01 13:46:29 +0000 | [diff] [blame] | 21 | |
| 22 | function executeTest() { |
| 23 | foreignObjectElement.width.baseVal.value = "150"; |
| 24 | shouldBe("foreignObjectElement.width.baseVal.value", "150"); |
| 25 | |
oliver@apple.com | 312d73e | 2008-04-03 20:30:05 +0000 | [diff] [blame^] | 26 | waitForClickEvent(foreignObjectElement); |
| 27 | triggerUpdate(); |
zimmermann@webkit.org | 6238d76 | 2008-03-01 13:46:29 +0000 | [diff] [blame] | 28 | } |
| 29 | |
oliver@apple.com | 312d73e | 2008-04-03 20:30:05 +0000 | [diff] [blame^] | 30 | executeTest(); |
| 31 | var successfullyParsed = true; |