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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/dom/HTMLDocument/active-element-gets-unforcusable-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/HTMLDocument/active-element-gets-unforcusable.html
diff --git a/LayoutTests/fast/dom/HTMLDocument/active-element-gets-unforcusable.html b/LayoutTests/fast/dom/HTMLDocument/active-element-gets-unforcusable.html
new file mode 100644
index 0000000000000000000000000000000000000000..7e06b359e47d2f7421202f56b388f73528b16f1e
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLDocument/active-element-gets-unforcusable.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<body>
+<script src="../../js/resources/js-test-pre.js"></script>
+
+<div id="f1">
+ <div tabindex="1" id="div1"></div>
+</div>
+
+<script type="text/javascript">
+description('Making a focused element invisible should make it blur.');
+jsTestIsAsync = true;
+var focusTarget = document.getElementById('div1');
+var testStage = 0;
+
+document.body.onload = function() {
+ focusTarget.focus();
+
+ shouldBe('document.activeElement', 'focusTarget', true);
+ debug('===> Setting display:none');
+ f1.style.display = 'none';
+
+ setTimeout(function() {
+ testFailed('Timeout: Didn\'t loose focus.');
+ finishJSTest();
+ }, 1000);
+};
+
+focusTarget.addEventListener('blur', function() {
+ debug('Event: blur');
+ shouldBe('document.activeElement', 'document.body');
+ testPassed('The focusTarget element lost focus.');
+
+ debug('');
+ if (testStage++ == 0) {
+ f1.style.display = 'block';
+ focusTarget.focus();
+ shouldBe('document.activeElement', 'focusTarget', true);
+ debug('===> Setting visibility:hidden');
+ f1.style.visibility = 'hidden';
+ } else
+ finishJSTest();
+}, false);
+
+</script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
« 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