5 <script src=
"../resources/js-test.js"></script>
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>
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>
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>
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>
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>
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>
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>
32 description("Test for Embed and Object for bug 32292: Unable to focus on embedded plugins such as Flash via javascript focus().");
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());
47 document
.addEventListener("DOMContentLoaded", RunTest
, false);