| 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() { | 8 function Test() { |
| 9 plugin = document.getElementById('plugin'); | 9 plugin = document.getElementById('plugin'); |
| 10 // Confirm that this no longer segfaults. | 10 // Confirm that this no longer segfaults. |
| 11 alert(plugin.toString(new Array(10))); | 11 alert(plugin.toString(new Array(10))); |
| 12 } | 12 } |
| 13 | 13 |
| 14 function SetPluginSize(width, height) { | 14 function SetPluginSize(width, height) { |
| 15 plugin = document.getElementById('plugin'); | 15 plugin = document.getElementById('plugin'); |
| 16 size = document.getElementById('size'); | 16 size = document.getElementById('size'); |
| 17 plugin.width = width; | 17 plugin.width = width; |
| 18 plugin.height = height; | 18 plugin.height = height; |
| 19 size.innerHTML = "Height: " + plugin.width + ' Width: ' + plugin.height; | 19 size.innerHTML = "Height: " + plugin.height + ' Width: ' + plugin.width; |
| 20 } | 20 } |
| 21 | 21 |
| 22 function ToggleSize() { | 22 function ToggleSize() { |
| 23 if (!isPluginDefaultSize) { | 23 if (!isPluginDefaultSize) { |
| 24 SetPluginSize(400, 400); | 24 SetPluginSize(400, 400); |
| 25 isPluginDefaultSize = true; | 25 isPluginDefaultSize = true; |
| 26 } else { | 26 } else { |
| 27 SetPluginSize(1000, 800); | 27 SetPluginSize(1000, 800); |
| 28 isPluginDefaultSize = false; | 28 isPluginDefaultSize = false; |
| 29 } | 29 } |
| 30 } | 30 } |
| 31 </script> | 31 </script> |
| 32 | 32 |
| 33 <button onclick='Test()'>Test</button> | 33 <button onclick='Test()'>Test</button> |
| 34 <button onclick='ToggleSize()'>Toggle Size</button> | 34 <button onclick='ToggleSize()'>Toggle Size</button> |
| 35 <div id="fps" style="background-color:white; font-weight:bold; padding:4px; wi
dth:200px;">FPS GOES HERE</div> | 35 <div id="fps" style="background-color:white; font-weight:bold; padding:4px; wi
dth:200px;">FPS GOES HERE</div> |
| 36 <div id="size" style="background-color:white; font-weight:bold; padding:4px; w
idth:200px;"></div> | 36 <div id="size" style="background-color:white; font-weight:bold; padding:4px; w
idth:200px;"></div> |
| 37 <object id="plugin" type="application/x-ppapi-example" width="400" height="400
" border="2px"></object> | 37 <object id="plugin" type="application/x-ppapi-example" width="400" height="400
" border="2px"></object> |
| 38 <hr> | 38 <hr> |
| 39 </body> | 39 </body> |
| OLD | NEW |