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

Side by Side Diff: LayoutTests/fast/dom/HTMLDocument/active-element-gets-unforcusable.html

Issue 14248006: A focused element should lose focus when it becomes unfocusable. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add a FIXME comment Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/fast/dom/HTMLDocument/active-element-gets-unforcusable-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 <body>
3 <script src="../../js/resources/js-test-pre.js"></script>
4
5 <div id="f1">
6 <div tabindex="1" id="div1"></div>
7 </div>
8
9 <script type="text/javascript">
10 description('Making a focused element invisible should make it blur.');
11 jsTestIsAsync = true;
12 var focusTarget = document.getElementById('div1');
13 var testStage = 0;
14
15 document.body.onload = function() {
16 focusTarget.focus();
17
18 shouldBe('document.activeElement', 'focusTarget', true);
19 debug('===> Setting display:none');
20 f1.style.display = 'none';
21
22 setTimeout(function() {
23 testFailed('Timeout: Didn\'t loose focus.');
24 finishJSTest();
25 }, 1000);
26 };
27
28 focusTarget.addEventListener('blur', function() {
29 debug('Event: blur');
30 shouldBe('document.activeElement', 'document.body');
31 testPassed('The focusTarget element lost focus.');
32
33 debug('');
34 if (testStage++ == 0) {
35 f1.style.display = 'block';
36 focusTarget.focus();
37 shouldBe('document.activeElement', 'focusTarget', true);
38 debug('===> Setting visibility:hidden');
39 f1.style.visibility = 'hidden';
40 } else
41 finishJSTest();
42 }, false);
43
44 </script>
45 <script src="../../js/resources/js-test-post.js"></script>
46 </body>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/dom/HTMLDocument/active-element-gets-unforcusable-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698