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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/inert/inert-focus-in-frames.html

Issue 2088453002: Implement the inert attribute (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert histograms.xml Created 3 years, 6 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
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../../resources/testharness.js"></script>
5 <script src="../../../resources/testharnessreport.js"></script>
6 </head>
7 <body>
8
9 <div inert>
10 <iframe height=400 width=600 id="main-iframe">
11 <frameset rows="*" cols="50,50">
12 <frame src="resources/inert-focus-in-frames-frame1.html">
13 <frame src='data:text/html,<div id="frame2-div" class="target" tabindex="0"> Hello</div>'>
14 </frameset>
15 </iframe>
16 </div>
17
18 <script>
19 setup({ explicit_done: true });
20
21 framesLoaded = 0;
22 numFrames = 4;
23 var mainIframe = document.getElementById('main-iframe');
24
25 function frameLoaded() {
26 framesLoaded++;
27 if (framesLoaded == numFrames) {
28 test(function() {
29 var frame1 = mainIframe.contentWindow.frames[0].document;
30 var target1 = frame1.querySelector('.target');
31 testCantFocus(target1);
32 var iframe = frame1.querySelector('iframe').contentDocument;
33 testCantFocus(iframe.querySelector('.target'));
34 }, "Focus can't go into frames or iframes in inert subtree");
35 done();
36 }
37 }
38
39 function testCantFocus(element) {
40 focusedElement = null;
41 element.addEventListener('focus', function() { focusedElement = element; }, false);
42 element.focus();
43 theElement = element;
44 assert_false(focusedElement === theElement);
45 }
46
47 mainIframe.contentDocument.write(mainIframe.textContent);
48 mainIframe.contentDocument.close();
49
50 mainIframe.contentWindow.frames[1].window.onload = frameLoaded;
51
52 window.onload = frameLoaded;
53 </script>
54 </body>
55 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698