Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / svg / custom / baseval-animval-equality.svg
blob662a266f9fdec8d80211871c91cbe70af27f80df
1 <?xml version="1.0"?>
2 <svg xmlns="http://www.w3.org/2000/svg" id="svg" width="600" height="400">
3 <foreignObject width="100%" height="100%">
4 <html xmlns="http://www.w3.org/1999/xhtml">
5 <div id="log">
6 This tests to make sure that baseVal and animVal are tied when animation is not enabled:
7 </div>
8 </html>
9 </foreignObject>
10 <script type="text/javascript">
11 <![CDATA[
12 if (window.testRunner)
13 window.testRunner.dumpAsText();
15 function log(message) {
16 var logDiv = document.getElementById('log');
17 var newDiv = document.createElementNS("http://www.w3.org/1999/xhtml",'div');
18 newDiv.appendChild(document.createTextNode(message));
19 logDiv.appendChild(newDiv);
21 var svg = document.getElementById('svg');
22 if (svg.x && svg.x.baseVal && svg.x.animVal) {
23 log("svg.x.baseVal.value = " + svg.x.baseVal.value);
24 log("svg.x.animVal.value = " + svg.x.animVal.value);
25 log("setting svg.x.baseVal.value = 10");
26 svg.x.baseVal.value = 10;
27 log("svg.x.baseVal.value = " + svg.x.baseVal.value);
28 log("svg.x.animVal.value = " + svg.x.animVal.value);
29 if ((svg.x.baseVal.value == svg.x.animVal.value) && (svg.x.animVal.value == 10))
30 log("SUCCESS (1 of 2)");
31 else
32 log("FAILED");
33 log("setting svg.x.animVal.value = 5");
34 try {
35 svg.x.animVal.value = 5;
36 } catch(e) {
37 log("caught exception: " + e.message);
39 log("svg.x.baseVal.value = " + svg.x.baseVal.value);
40 log("svg.x.animVal.value = " + svg.x.animVal.value);
41 if ((svg.x.baseVal.value == svg.x.animVal.value) && (svg.x.animVal.value == 10))
42 log("SUCCESS (2 of 2)");
43 else
44 log("FAILED");
45 } else {
46 log("FAILED, svg.x, svg.x.baseVal or svg.x.animVal undefined.")
48 ]]>
49 </script>
50 </svg>