RenderEmbeddedObject::isReplacementObscured is wrong if an obscuring element has...
[WebKit-https.git] / LayoutTests / plugins / focus.html
1 fast/events/tabindex-focus-blur-all.html<!DOCTYPE html>
2 <html>
3 <head>
4 <meta charset="utf-8">
5 <script src="../fast/js/resources/js-test-pre.js"></script>
6 </head>
7 <body>
8 <p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=32292">bug 32292</a>:
9 "Unable to focus on embedded plugins such as Flash via javascript focus()"</p>
10 <p>This tests focusing Embeds and Objects. See LayoutTests/java for Applet elements.</p>
11 <div id=embedOwner>
12 <embed id="embedElem" type="application/x-webkit-test-netscape" width=100 height=100 shouldFocus=true></embed>
13 <object id="objectElem" type="application/x-webkit-test-netscape" windowedPlugin="false" width=100 height=100 shouldFocus=true></object>
14
15 <embed id="embedElemWithFallbackContents" type="application/x-webkit-test-netscape" width=100 height=100 shouldFocus=true>Fallback contents.</embed>
16 <object id="objectElemWithFallbackContents" type="application/x-webkit-test-netscape" windowedPlugin="false" width=100 height=100 shouldFocus=true>Fallback contents.</object>
17
18 <embed id="noPluginEmbedElem" type="application/x-no-such-plugin" windowedPlugin="false" width=100 height=100 shouldFocus=false></embed>
19 <object id="noPluginObjectElem" type="application/x-no-such-plugin" windowedPlugin="false" width=100 height=100 shouldFocus=false></object>
20
21 <embed id="noPluginEmbedElemWithFallbackContents" type="application/x-no-such-plugin" windowedPlugin="false" width=100 height=100 shouldFocus=false>Fallback contents.</embed>
22 <object id="noPluginObjectElemWithFallbackContents" type="application/x-no-such-plugin" windowedPlugin="false" width=100 height=100 shouldFocus=false>Fallback contents.</object>
23
24 <embed id="noPluginEmbedElemWithTabindex" type="application/x-no-such-plugin" windowedPlugin="false" width=100 height=100 tabindex=-1 shouldFocus=true></embed>
25 <object id="noPluginObjectElemWithTabindex" type="application/x-no-such-plugin" windowedPlugin="false" width=100 height=100 tabindex=-1 shouldFocus=true></object>
26
27 <embed id="noPluginEmbedElemWithContenteditable" type="application/x-no-such-plugin" windowedPlugin="false" width=100 height=100 contenteditable=true shouldFocus=true></embed>
28 <object id="noPluginObjectElemWithContenteditable" type="application/x-no-such-plugin" windowedPlugin="false" width=100 height=100 contenteditable=true shouldFocus=true></object>
29 </div>
30 <script>
31
32 description("Test for Embed and Object for bug 32292: Unable to focus on embedded plugins such as Flash via javascript focus().");
33
34 function RunTest() {
35     var owner = document.getElementById("embedOwner");
36     for (var i = 0; i < owner.childNodes.length; ++i) {
37         pluginElement = owner.childNodes[i];
38         if (pluginElement.id) {
39             pluginElement.focus();
40             shouldBe('"' + pluginElement.id + '"; document.activeElement === pluginElement',
41                 pluginElement.getAttribute("shouldFocus").toString());
42             pluginElement.blur();
43         }
44     }
45 }
46
47 document.addEventListener("DOMContentLoaded", RunTest, false);
48
49 </script>
50 <script src="../fast/js/resources/js-test-post.js"></script>
51 </body>
52 </html>