focusblur.html revision 9a76bc095233b0cb0be3a913f5913bfc72c38b6c
0N/A filter: (window.location.search.match(/[?&]filter=([^&]+)/) || [])[1] || 'min',
0N/A if (Y.isWindowInFocus()) {
0N/A Assert.isTrue(foo, "simple focus fails, container should pickup the focus event");
0N/A Assert.areEqual(Y.one('#button-1'), target, "the target is the incorrect node, should be the actual focus target");
1667N/A Assert.areEqual(Y.one('#container'), boundEl, "the default scope should be the bound element");
2157N/A Assert.isTrue(foo, "simple focus fails, container should pickup the focus event");
2157N/A Assert.areEqual(Y.one('#button-1'), target, "the target is the incorrect node, should be the actual focus target");
0N/A Assert.areEqual(Y.one('#container'), boundEl, "the default scope should be the bound element");
var handle = Y.on('focus', onFocus, '#container');
if (Y.isWindowInFocus()) {
Y.one('#button-1').focus();
Assert.isTrue(foo, "simple focus fails, container should pickup the focus event");
Y.one('#button-1').blur();
Y.one('#button-1').focus();
Assert.isFalse(foo, "container should not pickup the focus event after listener is removed");
Y.one('#button-1').blur();
Y.log("Window is not focused.", "warn", "TestRunner");
if (Y.isWindowInFocus()) {
Y.on('focus', onFocus, '#container');
Y.one('#button-1').focus();
Assert.isTrue(foo, "simple focus fails, container should pickup the focus event");
Y.Event.purgeElement('#container', false, 'focus');
Y.one('#button-1').blur();
Y.one('#button-1').focus();
Assert.isFalse(foo, "container should not pickup the focus event after listener has been purged");
Y.log("Window is not focused.", "warn", "TestRunner");
body = Y.one('body'),
container = Y.one('#container');
from.push(this);
if (Y.isWindowInFocus()) {
container.on('focus', onFocus);
doc.on('focus', onFocus);
body.on('focus', onFocus);
Y.one('#anchor-1').focus();
Y.ArrayAssert.itemsAreSame([container, body, doc], from, "Incorrect bubble order");
Y.log("Window is not focused.", "warn", "TestRunner");
target = e.target;
if (Y.isWindowInFocus()) {
Y.on('blur', onBlur, '#container');
Y.one('#button-1').focus();
Y.one('#button-1').blur();
Assert.isTrue(foo, "simple blur fails, container should pickup the focus event");
Assert.areEqual(target, Y.one('#button-1'), "the target is the incorrect node, should be the actual blur target");
Y.one('#button-1').focus();
Y.one('#text-1').focus();
Assert.isTrue(foo, "simple blur fails, container should pickup the focus event");
Assert.areEqual(target, Y.one('#button-1'), "the target is the incorrect node, should be the actual blur target");
Y.log("Window is not focused.", "warn", "TestRunner");
if (Y.isWindowInFocus()) {
var handle = Y.on('blur', onBlur, '#container');
Y.one('#button-1').focus();
Y.one('#button-1').blur();
Assert.isTrue(foo, "simple focus fails, container should pickup the focus event");
Y.one('#button-1').focus();
Y.one('#text-1').focus();
Assert.isFalse(foo, "container should not pickup the blur event after listener has been removed");
Y.log("Window is not focused.", "warn", "TestRunner");
if (Y.isWindowInFocus()) {
Y.on('blur', onBlur, '#container');
Y.one('#button-1').focus();
Y.one('#button-1').blur();
Assert.isTrue(foo, "simple focus fails, container should pickup the focus event");
Y.Event.purgeElement('#container', false, 'blur');
Y.one('#button-1').focus();
Y.one('#text-1').focus();
Assert.isFalse(foo, "container should not pickup the blur event after listener has been purged");
Y.log("Window is not focused.", "warn", "TestRunner");
Y.Test.Runner.setName("EventFocusBlur");