blob: f6cc1c6d072fb3cb94708065d2bbe2f462620fa1 [file] [log] [blame]
* Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
* for details. All rights reserved. Use of this source code is governed by a
* BSD-style license that can be found in the LICENSE file.
* @description Making a focused element invisible should make it blur.
import "dart:html";
import "../../../../Utils/expect.dart";
import "../../../../Utils/async_utils.dart";
import "../../../testcommon.dart";
main() {
<div id="f1">
<div tabindex="1" id="div1"></div>
''', treeSanitizer: new NullTreeSanitizer());
var focusTarget = document.getElementById('div1');
var testStage = 0;
shouldBe(document.activeElement, focusTarget, true);
focusTarget.addEventListener('blur', (_) {
debug('Event: blur');
shouldBe(document.activeElement, document.body);
testPassed('The focusTarget element lost focus.');
if (testStage++ == 0) {
var f1 = document.getElementById('f1'); = 'block';
shouldBe(document.activeElement, focusTarget, true);
debug('===> Setting visibility:hidden'); = 'hidden';
}, false);
debug('===> Setting display:none');
var f1 = document.getElementById('f1');
asyncStart(); = 'none';