diff --git a/tests/unit/core/core.html b/tests/unit/core/core.html index e259f3270..41c8db827 100644 --- a/tests/unit/core/core.html +++ b/tests/unit/core/core.html @@ -112,6 +112,11 @@ . +
+ + +
+
.
diff --git a/tests/unit/core/selector.js b/tests/unit/core/selector.js index 7876cdd07..f30ad17be 100644 --- a/tests/unit/core/selector.js +++ b/tests/unit/core/selector.js @@ -157,6 +157,12 @@ test("focusable - area elements", function() { isNotFocusable('#areaNoImg', 'not associated with an image'); }); +test( "focusable - dimensionless parent with overflow", function() { + expect( 1 ); + + isFocusable( "#dimensionlessParent", "input" ); +}); + test("tabbable - visible, enabled elements", function() { expect(18); @@ -236,4 +242,10 @@ test("tabbable - area elements", function() { isNotTabbable('#areaNoImg', 'not associated with an image'); }); +test( "tabbable - dimensionless parent with overflow", function() { + expect( 1 ); + + isTabbable( "#dimensionlessParent", "input" ); +}); + })(jQuery); diff --git a/ui/jquery.ui.core.js b/ui/jquery.ui.core.js index e569eea42..2e9d53ae3 100644 --- a/ui/jquery.ui.core.js +++ b/ui/jquery.ui.core.js @@ -198,10 +198,10 @@ function focusable( element, isTabIndexNotNaN ) { } function visible( element ) { - return !$( element ).parents().andSelf().filter(function() { - return $.css( this, "visibility" ) === "hidden" || - $.expr.filters.hidden( this ); - }).length; + return $.expr.filters.visible( element ) && + !$( element ).parents().andSelf().filter(function() { + return $.css( this, "visibility" ) === "hidden"; + }).length; } $.extend( $.expr[ ":" ], {