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

Side by Side Diff: LayoutTests/fast/events/frame-click-clear-focus.html

Issue 57813008: Clicking a non-focusable element in an inactive frame should clear focus in the frame. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/fast/events/frame-click-clear-focus-expected.txt » ('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 <html>
3 <body>
4 <script src="../../resources/js-test.js"></script>
5 <iframe id="frame1" src="data:text/html,<input>" width="800" height="600"></ifra me>
6 <iframe id="frame2" src="data:text/html,<input>" width="800" height="600"></ifra me>
7 <script>
8 description('Make sure that clicking on an inactive frame clears existing elemen t focus.');
9 jsTestIsAsync = true;
10 var doc;
11 var innerInput;
12 window.onload = function() {
13 doc = window.frames['frame1'].document;
14 innerInput = doc.querySelector('input');
15 innerInput.focus();
16 debug('===> Making a frame with a focused element inactive.');
17 window.frames['frame2'].focus();
18 // The following check is not important. activeElement is innerInput in IE,
19 // and is body in Firefox in this case.
20 shouldBe('doc.activeElement', 'innerInput');
21
22 debug('===> Making the frame active again clicking by a non-focusable elemen t.');
23 var iframe1 = document.getElementById('frame1');
24 eventSender.mouseMoveTo(iframe1.offsetLeft + iframe1.offsetWidth / 2, iframe 1.offsetTop + iframe1.offsetHeight / 2);
25 eventSender.mouseDown();
26 eventSender.mouseUp();
27 shouldBe('doc.activeElement', 'doc.body');
28 finishJSTest();
29 };
30 </script>
31 </body>
32 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/events/frame-click-clear-focus-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698