OLD | NEW |
1 <body style="background-image:url(http://www.google.com/intl/en_ALL/images/logo.
gif); | 1 <body style="background-image:url(http://www.google.com/intl/en_ALL/images/logo.
gif); |
2 background-repeat:repeat" | 2 background-repeat:repeat" |
3 onload="SetPluginSize(400, 400)"> | 3 onload="SetPluginSize(400, 400)"> |
4 | 4 |
5 <script type="text/javascript"> | 5 <script type="text/javascript"> |
6 isPluginDefaultSize = true; | 6 isPluginDefaultSize = true; |
7 | 7 |
8 function Test() { | |
9 var plugin = document.getElementById('plugin'); | |
10 // Confirm that this no longer segfaults. | |
11 alert(plugin.toString(new Array(10))); | |
12 | |
13 // Confirm that the renderer doesn't crash when the plugin module goes away | |
14 // while waiting for the reply to the HasPropery sync message. | |
15 plugin.removePluginWhenHasPropertyCalled; | |
16 } | |
17 | |
18 function SetPluginSize(width, height) { | 8 function SetPluginSize(width, height) { |
19 plugin = document.getElementById('plugin'); | 9 plugin = document.getElementById('plugin'); |
20 size = document.getElementById('size'); | 10 size = document.getElementById('size'); |
21 plugin.width = width; | 11 plugin.width = width; |
22 plugin.height = height; | 12 plugin.height = height; |
23 size.innerHTML = "Height: " + plugin.height + ' Width: ' + plugin.width; | |
24 } | 13 } |
25 | 14 |
26 function ToggleSize() { | 15 function ToggleSize() { |
27 if (!isPluginDefaultSize) { | 16 if (!isPluginDefaultSize) { |
28 SetPluginSize(400, 400); | 17 SetPluginSize(400, 400); |
29 isPluginDefaultSize = true; | 18 isPluginDefaultSize = true; |
30 } else { | 19 } else { |
31 SetPluginSize(1000, 800); | 20 SetPluginSize(1000, 800); |
32 isPluginDefaultSize = false; | 21 isPluginDefaultSize = false; |
33 } | 22 } |
34 } | 23 } |
35 </script> | 24 </script> |
36 | 25 |
37 <button onclick='Test()'>Test</button> | 26 <button onclick='ToggleSize()'>Toggle Size</button><br> |
38 <button onclick='ToggleSize()'>Toggle Size</button> | |
39 <div id="fps" style="background-color:white; font-weight:bold; padding:4px; wi
dth:200px;">FPS GOES HERE</div> | |
40 <div id="size" style="background-color:white; font-weight:bold; padding:4px; w
idth:200px;"></div> | |
41 <object id="plugin" type="application/x-ppapi-example" width="400" height="400
" border="2px"></object> | 27 <object id="plugin" type="application/x-ppapi-example" width="400" height="400
" border="2px"></object> |
42 <hr> | |
43 </body> | 28 </body> |
OLD | NEW |