3 <script src=
"../../../resources/js-test.js"></script>
6 <div tabindex=
"1" id=
"div1"></div>
9 <script type=
"text/javascript">
10 description('Making a focused element invisible should make it blur.');
12 var focusTarget
= document
.getElementById('div1');
15 document
.body
.onload = function() {
18 shouldBe('document.activeElement', 'focusTarget', true);
19 debug('===> Setting display:none');
20 f1
.style
.display
= 'none';
22 setTimeout(function() {
23 testFailed('Timeout: Didn\'t loose focus.');
28 focusTarget
.addEventListener('blur', function() {
30 shouldBe('document.activeElement', 'document.body');
31 testPassed('The focusTarget element lost focus.');
34 if (testStage
++ == 0) {
35 f1
.style
.display
= 'block';
37 shouldBe('document.activeElement', 'focusTarget', true);
38 debug('===> Setting visibility:hidden');
39 f1
.style
.visibility
= 'hidden';