Rubber-stamped by Brady Eidson.
[webbrowser.git] / LayoutTests / svg / custom / poly-points-attribute-changes.svg
blob1857695f4fcab89b24ea77b61885783b66648c25
1 <svg xmlns="http://www.w3.org/2000/svg" onload="runTest()">
2 <script type="text/javascript">
3 <![CDATA[
4 if (window.layoutTestController)
5 layoutTestController.dumpAsText();
7 function log(string) {
8 var newDiv = document.createElementNS("http://www.w3.org/1999/xhtml", "div");
9 newDiv.textContent = string;
10 document.getElementById('log').appendChild(newDiv);
13 function runTest()
15 var polyline = document.getElementById("poly");
16 var attr = polyline.getAttributeNode("points");
17 if (attr.value != "0 0 10 10") {
18 log("FAIL: Initial 'points' value differs");
19 return;
21 polyline.setAttribute("points", "10 0 10 10");
22 if (attr.value != "10 0 10 10") {
23 log("FAIL: Updating points attribute failed, changes not reflected in existing 'Attr' object");
24 return;
26 var points = polyline.points;
27 var point = document.rootElement.createSVGPoint();
28 point.x = 20;
29 point.y = 20;
30 points.appendItem(point);
31 // The attribute node is not in sync, should this be fixed? Opera handles it like us.
32 if (polyline.getAttribute("points") != "10 0 10 10 20 20") {
33 log("FAIL: Modification via SVG DOM not reflected in XML DOM");
34 return;
36 log("SUCCESS");
38 ]]>
39 </script>
40 <foreignObject y="200" width="600" height="400">
41 <html xmlns="http://www.w3.org/1999/xhtml">
42 <body>
43 <div id="log">
44 </div>
45 </body>
46 </html>
47 </foreignObject>
48 <polyline id="poly" points="0 0 10 10"/>
49 </svg>