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

Side by Side Diff: LayoutTests/fast/frames/frame-focus-send-blur.html

Issue 238023004: Focusing iframe window should trigger blur event for oldframe's focused element (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: incorporated review comments Created 6 years, 8 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 | LayoutTests/fast/frames/frame-focus-send-blur-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 id='input'>" ></iframe>
6 <iframe id="frame2" src="data:text/html,<div>This is a iframe element</div>"></i frame>
7 <script>
8 description('Make sure that moving focus on an inactive frame fires blur event o n existing element focus.');
9 var doc;
10 var input;
11 window.onload = function()
12 {
13 var frame1 = document.getElementById('frame1');
14 var frame2 = document.getElementById('frame2');
15
16 doc = frame1.contentDocument;
17 input = doc.querySelector('input');
18 input.onblur = function() {
19 testPassed('A blur event was dispatched on frame1 input element.');
20 }
21 input.onfocus = function() {
22 testPassed('A focus event was dispatched on frame1 input element.');
23 }
24 input.focus();
25
26 debug('===> Making a first frame with a focused element inactive by focus() for second frame.');
27 frame2.contentWindow.focus();
28 shouldBe('frame1.contentDocument.activeElement', 'input');
29 debug('===> Making the first frame active again by focus() for first frame.' );
30 frame1.contentWindow.focus();
31 shouldBe('frame1.contentDocument.activeElement', 'input');
32 }
33 </script>
34 </body>
35 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/frames/frame-focus-send-blur-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698