blob: d7782dbb3dd3fd3ee8ef7ceaae8fa64e37c68786 [file] [log] [blame]
<svg xmlns="http://www.w3.org/2000/svg" onload="runTest()">
<script type="text/javascript">
<![CDATA[
if (window.testRunner)
testRunner.dumpAsText();
function log(string) {
var newDiv = document.createElementNS("http://www.w3.org/1999/xhtml", "div");
newDiv.textContent = string;
document.getElementById('log').appendChild(newDiv);
}
function runTest()
{
var polyline = document.getElementById("poly");
var attr = polyline.getAttributeNode("points");
if (attr.value != "0 0 10 10") {
log("FAIL: Initial 'points' value differs");
return;
}
polyline.setAttribute("points", "10 0 10 10");
if (attr.value != "10 0 10 10") {
log("FAIL: Updating points attribute failed, changes not reflected in existing 'Attr' object");
return;
}
var points = polyline.points;
var point = document.rootElement.createSVGPoint();
point.x = 20;
point.y = 20;
points.appendItem(point);
// The attribute node is not in sync, should this be fixed? Opera handles it like us.
if (polyline.getAttribute("points") != "10 0 10 10 20 20") {
log("FAIL: Modification via SVG DOM not reflected in XML DOM");
return;
}
log("SUCCESS");
}
]]>
</script>
<foreignObject y="200" width="600" height="400">
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<div id="log">
</div>
</body>
</html>
</foreignObject>
<polyline id="poly" points="0 0 10 10"/>
</svg>