| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 | 2 |
| 3 <html> | 3 <html> |
| 4 <head> | 4 <head> |
| 5 | 5 |
| 6 <style type="text/css"> | 6 <style type="text/css"> |
| 7 #transform { | 7 #transform { |
| 8 -webkit-transform: rotateZ(0deg) rotateX(0deg) rotateY(0deg); | 8 -webkit-transform: rotateZ(0deg) rotateX(0deg) rotateY(0deg); |
| 9 } | 9 } |
| 10 </style> | 10 </style> |
| 11 | 11 |
| 12 <script src="../../resources/run-after-display.js"></script> |
| 12 <script> | 13 <script> |
| 13 if (window.testRunner) | 14 if (window.testRunner) { |
| 14 testRunner.dumpAsText(); | 15 testRunner.dumpAsText(); |
| 16 testRunner.waitUntilDone(); |
| 17 } |
| 15 | 18 |
| 16 var paintCount = 0; | 19 var paintCount = 0; |
| 17 | 20 |
| 18 function onLoad() | 21 function onLoad() |
| 19 { | 22 { |
| 20 testRunner.display(); | 23 runAfterDisplay(function() { |
| 21 paintCount = 0; | 24 paintCount = 0; |
| 22 document.getElementById('testPlugin').invalidateRect(0, 0, 200, 200); | 25 document.getElementById('testPlugin').invalidateRect(0, 0, 200, 200); |
| 23 testRunner.displayInvalidatedRegion(); | 26 runAfterDisplay(function() { |
| 24 if (paintCount > 0) | 27 if (paintCount > 0) |
| 25 document.getElementById('result').innerHTML = "SUCCESS"; | 28 document.getElementById('result').innerHTML = "SUCCESS"; |
| 29 if (window.testRunner) |
| 30 testRunner.notifyDone(); |
| 31 }); |
| 32 }); |
| 26 } | 33 } |
| 27 | 34 |
| 28 function didPaint() | 35 function didPaint() |
| 29 { | 36 { |
| 30 paintCount++; | 37 paintCount++; |
| 31 } | 38 } |
| 32 </script> | 39 </script> |
| 33 </head> | 40 </head> |
| 34 <body onload="onLoad();"> | 41 <body onload="onLoad();"> |
| 35 This tests that NPN_InvalidateRect works correctly. | 42 This tests that NPN_InvalidateRect works correctly. |
| 36 | 43 |
| 37 <div id="result">FAILURE</div> | 44 <div id="result">FAILURE</div> |
| 38 | 45 |
| 39 <!-- force this page to be composited --> | 46 <!-- force this page to be composited --> |
| 40 <div id="transform"> | 47 <div id="transform"> |
| 41 </div> | 48 </div> |
| 42 | 49 |
| 43 <!-- Move the plugin to the middle of the page. This ensures that invalidate()
will invalidate the correct region. --> | 50 <!-- Move the plugin to the middle of the page. This ensures that invalidate()
will invalidate the correct region. --> |
| 44 <div style="position: absolute; left: 300px; top: 300px; height: 400px; width:
400px; padding: 1em;"> | 51 <div style="position: absolute; left: 300px; top: 300px; height: 400px; width:
400px; padding: 1em;"> |
| 45 | 52 |
| 46 <embed id="testPlugin" type="application/x-webkit-test-netscape" width="200"
height="200" onpaintevent="didPaint()" windowedPlugin="false"></embed> | 53 <embed id="testPlugin" type="application/x-webkit-test-netscape" width="200"
height="200" onpaintevent="didPaint()" windowedPlugin="false"></embed> |
| 47 | 54 |
| 48 </div> | 55 </div> |
| 49 </body> | 56 </body> |
| 50 </html> | 57 </html> |
| OLD | NEW |