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

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

Issue 2883033003: Propagate inert state to OOPIFs when a modal dialog is active (Closed)
Patch Set: Rebase only Created 3 years, 7 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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../../resources/js-test.js"></script> 4 <script src="../../resources/js-test.js"></script>
5 <script> 5 <script>
6 description('Tests inert node focusing across frames and iframes.'); 6 description('Tests inert node focusing across frames and iframes.');
7 if (window.testRunner) 7 if (window.testRunner)
8 testRunner.waitUntilDone(); 8 testRunner.waitUntilDone();
9 </script> 9 </script>
10 </head> 10 </head>
(...skipping 21 matching lines...) Expand all
32 theElement = element; 32 theElement = element;
33 shouldBe('"' + element.id + '"; focusedElement === theElement', expected); 33 shouldBe('"' + element.id + '"; focusedElement === theElement', expected);
34 } 34 }
35 35
36 function test() { 36 function test() {
37 debug('Opening a modal dialog in frame1. It blocks other nodes in its docume nt.'); 37 debug('Opening a modal dialog in frame1. It blocks other nodes in its docume nt.');
38 var frame1 = mainIframe.contentWindow.frames[0].document; 38 var frame1 = mainIframe.contentWindow.frames[0].document;
39 frame1.querySelector('dialog').showModal(); 39 frame1.querySelector('dialog').showModal();
40 40
41 testFocus(frame1.querySelector('.target'), false); 41 testFocus(frame1.querySelector('.target'), false);
42 var iframe = frame1.querySelector('iframe').contentDocument; 42 var iframe = frame1.querySelector('#iframe1').contentDocument;
43 testFocus(iframe.querySelector('.target'), false); 43 testFocus(iframe.querySelector('.target'), false);
44 44
45 debug('Even a modal dialog in the iframe is blocked by the modal dialog in t he parent frame1.'); 45 debug('Even a modal dialog in the iframe is blocked by the modal dialog in t he parent frame1.');
46 iframe.querySelector('dialog').showModal(); 46 iframe.querySelector('dialog').showModal();
47 testFocus(iframe.querySelector('button'), false); 47 testFocus(iframe.querySelector('button'), false);
48 48
49 debug('An iframe within a modal dialog can still be focused.');
50 var dialogIframe = frame1.querySelector('#iframe-in-dialog').contentDocument ;
51 testFocus(dialogIframe.querySelector('.target'), true);
52
49 debug('A modal dialog does not block nodes in a sibling frame.'); 53 debug('A modal dialog does not block nodes in a sibling frame.');
50 var frame2 = mainIframe.contentWindow.frames[1].document; 54 var frame2 = mainIframe.contentWindow.frames[1].document;
51 testFocus(frame2.querySelector('.target'), true); 55 testFocus(frame2.querySelector('.target'), true);
52 56
53 debug('Closing the dialog in frame1. The modal dialog in the iframe does not block nodes in its parent.'); 57 debug('Closing the dialog in frame1. The modal dialog in the iframe does not block nodes in its parent.');
54 frame1.querySelector('dialog').close(); 58 frame1.querySelector('dialog').close();
55 testFocus(iframe.querySelector('.target'), false); 59 testFocus(iframe.querySelector('.target'), false);
56 testFocus(frame1.querySelector('.target'), true); 60 testFocus(frame1.querySelector('.target'), true);
57 61
58 if (window.testRunner) 62 if (window.testRunner)
59 testRunner.notifyDone(); 63 testRunner.notifyDone();
60 } 64 }
61 65
62 var mainIframe = document.getElementById('main-iframe'); 66 var mainIframe = document.getElementById('main-iframe');
63 mainIframe.contentDocument.write(mainIframe.textContent); 67 mainIframe.contentDocument.write(mainIframe.textContent);
64 mainIframe.contentDocument.close(); 68 mainIframe.contentDocument.close();
65 69
66 mainIframe.contentWindow.frames[1].window.onload = frameLoaded; 70 mainIframe.contentWindow.frames[1].window.onload = frameLoaded;
67 71
68 window.onload = frameLoaded; 72 window.onload = frameLoaded;
69 </script> 73 </script>
70 </body> 74 </body>
71 </html> 75 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698