Setting any of the <object> element plugin controlling attributes does not have any...
[WebKit-https.git] / LayoutTests / svg / as-object / svg-in-object-dynamic-attribute-change.html
1 <!DOCTYPE html>
2 <html>
3 <body>
4   <object id="object1" data="resources/lime100x100.svg">
5     <img src="resources/red100x100.svg">
6   </object>
7   <object id="object2" type="image/svg+xml" data="resources/red100x100.svg">
8     <img src="resources/red100x100.svg">
9   </object>
10   <object width="100px" height="100px" id="object3">
11     <img src="resources/red100x100.svg">
12   </object>
13   <object id="object4" type="dummy">
14     <img src="resources/red100x100.svg">
15   </object>
16   <object id="object5" type="dummy">
17     <img src="resources/red100x100.svg">
18   </object>
19   <object id="object6" type="image/svg+xml" data="resources/red100x100.svg">
20     <img src="resources/lime100x100.svg">
21   </object>
22   <script>
23     function onObjectLoad() {
24       if (!window.testRunner)
25         return;
26         
27       if (typeof onObjectLoad.counter == 'undefined')
28         onObjectLoad.counter = 0;
29     
30       if (++onObjectLoad.counter == 4)
31         testRunner.notifyDone();
32     }
33  
34     window.addEventListener("load", function() {
35       if (window.testRunner)
36         testRunner.waitUntilDone();
37
38       // change the 'type' attribute
39       var object1 = document.getElementById("object1");
40       object1.setAttribute("type", "image/svg+xml");
41
42       // change the 'data' attribute
43       var object2 = document.getElementById("object2");
44       object2.onload = onObjectLoad;
45       object2.setAttribute("data", "resources/lime100x100.svg");
46
47       // change the 'data' attribute
48       var object3 = document.getElementById("object3");
49       object3.onload = onObjectLoad;
50       object3.setAttribute("data", "resources/lime100x100.html");
51
52       // change the 'type' then the 'data' attributes of an image object
53       var object4 = document.getElementById("object4");
54       object4.onload = onObjectLoad;
55       object4.setAttribute("type", "image/png");
56       object4.setAttribute("data", "resources/lime100x100.png");
57
58       // change the 'data' then the 'type' attributes of an image object
59       var object5 = document.getElementById("object5");
60       object5.onload = onObjectLoad;
61       object5.setAttribute("data", "resources/lime100x100.png");
62       object5.setAttribute("type", "image/png");
63
64       // object rederer fallback
65       var object6 = document.getElementById("object6");
66       object6.setAttribute("type", "dummy");
67     });
68   </script>
69 </body>
70 </html>