Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(160)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/focus-navigation-in-plugin.html

Issue 2129863002: Handle focusability for plugin elements which has browsing context (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use super class. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/dom/resources/plugin-focus-subframe.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script>
4 <input id="outer-before">
5 <object data="resources/plugin-focus-subframe.html" type="text/html" id="obj"></ object>
6 <embed src="resources/plugin-focus-subframe.html" type="text/html" id="emb"></em bed>
7 <input id="outer-after">
8 <script>
9 function PressTab() {
10 eventSender.keyDown('\t');
11 }
12
13 function PressShiftTab() {
14 eventSender.keyDown('\t', ['shiftKey']);
15 }
16
17 function testFocusNavigation() {
18 test(() => {
19 var before = document.querySelector('#outer-before');
20 var after = document.querySelector('#outer-after');
21
22 before.focus();
23
24 // 'plugin-focus-subframe.html' has 2 focus areas.
25 var expected = ['outer-before', 'obj', 'obj', 'emb', 'emb', 'outer-after'] ;
26
27 var i;
28 for (i = 0; i < 5; ++i) {
29 assert_equals(document.activeElement.id, expected[i]);
30 PressTab();
31 }
32 assert_equals(document.activeElement, after, '#after');
33
34 expected.reverse();
35 for (i = 0; i < 5; ++i) {
36 assert_equals(document.activeElement.id, expected[i]);
37 PressShiftTab();
38 }
39 assert_equals(document.activeElement, before, '#before');
40
41 }, "Focus should navigate to <option>/<embed>");
42 }
43
44 if (window.testRunner) {
45 window.addEventListener('load', testFocusNavigation, false);
46 }
47 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/dom/resources/plugin-focus-subframe.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698