RenderEmbeddedObject::isReplacementObscured is wrong if an obscuring element has...
[WebKit-https.git] / LayoutTests / plugins / layout-in-beforeload-listener-affects-plugin-loading.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4     <script>
5         if (window.testRunner) {
6             testRunner.dumpAsText();
7             testRunner.waitUntilDone();
8         }
9         
10         window._beforeloadReceivedForEmbed = false;
11         
12         document.addEventListener("beforeload", function(event) {
13             if (document.getElementsByTagName("object")[0] == event.target) {
14                 // trigger a layout
15                 event.target.offsetWidth;
16                 return;
17             }
18             
19             _beforeloadReceivedForEmbed = document.getElementsByTagName("embed")[0] == event.target;
20         }, true);
21         
22         function test() {
23             // The <embed> should load as a post-layout task that executes in
24             // the current run loop iteration. Queue a task to check if the
25             // <embed>'s beforeload event fired.
26             window.setTimeout(function() {
27                 console.log(_beforeloadReceivedForEmbed ? "PASS" : "FAIL");
28                 if (window.testRunner)
29                     testRunner.notifyDone();
30             }, 0);
31         }
32     </script>
33 </head>
34 <body onload="test();">
35     <!-- Test that performing layout in a beforeload listener does not affect
36          plug-in loading. See http://webkit.org/b/77167 for details. This test
37          requires TestNetscapePlugIn so it must be run in DumpRenderTree. -->
38     <object>
39         <embed type="application/x-webkit-test-netscape">
40     </object>
41 </body>
42 </html>