blob: 5a35e1b074946298c0c80f06f46d03f382c09bb1 [file] [log] [blame]
<?xml version="1.0"?>
<svg xmlns="http://www.w3.org/2000/svg" id="svg" width="600" height="400">
<foreignObject>
<html xmlns="http://www.w3.org/1999/xhtml">
<div id="log">
This tests to make sure that baseVal and animVal are tied when animation is not enabled:
</div>
</html>
</foreignObject>
<script type="text/javascript">
<![CDATA[
function log(message) {
var logDiv = document.getElementById('log');
var newDiv = document.createElementNS("http://www.w3.org/1999/xhtml",'div');
newDiv.appendChild(document.createTextNode(message));
logDiv.appendChild(newDiv);
}
var svg = document.getElementById('svg');
if (svg.x && svg.x.baseVal && svg.x.animVal) {
log("svg.x.baseVal.value = " + svg.x.baseVal.value);
log("svg.x.animVal.value = " + svg.x.animVal.value);
log("setting svg.x.baseVal.value = 10");
svg.x.baseVal.value = 10;
log("svg.x.baseVal.value = " + svg.x.baseVal.value);
log("svg.x.animVal.value = " + svg.x.animVal.value);
if ((svg.x.baseVal.value == svg.x.animVal.value) && (svg.x.animVal.value == 10))
log("SUCCESS (1 of 2)");
else
log("FAILED");
log("setting svg.x.animVal.value = 5");
svg.x.animVal.value = 5;
log("svg.x.baseVal.value = " + svg.x.baseVal.value);
log("svg.x.animVal.value = " + svg.x.animVal.value);
if ((svg.x.baseVal.value == svg.x.animVal.value) && (svg.x.animVal.value == 5))
log("SUCCESS (2 of 2)");
else
log("FAILED");
} else {
log("FAILED, svg.x, svg.x.baseVal or svg.x.animVal undefined.")
}
]]>
</script>
</svg>