aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorWeston Ruter <weston@xwp.co>2015-08-04 16:46:58 -0700
committerScott González <scott.gonzalez@gmail.com>2015-09-24 08:13:59 -0400
commit0db243a7369bc1e642a83d8b84be9437c360f7e2 (patch)
tree367b1b2bc448bc2f507ab7da4bca54f686a2a41d /tests
parent6308a261fd5d1be2362863e6a59fede4420d9f8c (diff)
downloadjquery-ui-0db243a7369bc1e642a83d8b84be9437c360f7e2.tar.gz
jquery-ui-0db243a7369bc1e642a83d8b84be9437c360f7e2.zip
Core: Remove ancestor visibility requirement from `:focusable` selector
* Check computed visibility in addition to :visible * Add tests for nested visibility override Fixes #14596 Closes gh-1583
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/core/core.html5
-rw-r--r--tests/unit/core/selector.js10
2 files changed, 13 insertions, 2 deletions
diff --git a/tests/unit/core/core.html b/tests/unit/core/core.html
index 366eecebe..5a089aa7b 100644
--- a/tests/unit/core/core.html
+++ b/tests/unit/core/core.html
@@ -80,6 +80,11 @@
<div id="visibilityHiddenAncestor" style="visibility: hidden;">
<input id="visibilityHiddenAncestor-input">
<span tabindex="1" id="visibilityHiddenAncestor-span">.</span>
+
+ <span id="nestedVisibilityOverrideAncestor" style="visibility: visible">
+ <input id="nestedVisibilityOverrideAncestor-input">
+ <span tabindex="1" id="nestedVisibilityOverrideAncestor-span">.</span>
+ </span>
</div>
<span tabindex="1" id="displayNone-span" style="display: none;">.</span>
diff --git a/tests/unit/core/selector.js b/tests/unit/core/selector.js
index c0a0f4888..ffae7e024 100644
--- a/tests/unit/core/selector.js
+++ b/tests/unit/core/selector.js
@@ -125,7 +125,7 @@ test( "focusable - disabled elements", function() {
} );
test( "focusable - hidden styles", function() {
- expect( 8 );
+ expect( 10 );
isNotFocusable( "#displayNoneAncestor-input", "input, display: none parent" );
isNotFocusable( "#displayNoneAncestor-span", "span with tabindex, display: none parent" );
@@ -133,6 +133,9 @@ test( "focusable - hidden styles", function() {
isNotFocusable( "#visibilityHiddenAncestor-input", "input, visibility: hidden parent" );
isNotFocusable( "#visibilityHiddenAncestor-span", "span with tabindex, visibility: hidden parent" );
+ isFocusable( "#nestedVisibilityOverrideAncestor-input", "input, visibility: visible parent but visibility: hidden grandparent" );
+ isFocusable( "#nestedVisibilityOverrideAncestor-span", "span with tabindex, visibility: visible parent but visibility: hidden grandparent " );
+
isNotFocusable( "#displayNone-input", "input, display: none" );
isNotFocusable( "#visibilityHidden-input", "input, visibility: hidden" );
@@ -210,7 +213,7 @@ test( "tabbable - disabled elements", function() {
} );
test( "tabbable - hidden styles", function() {
- expect( 8 );
+ expect( 10 );
isNotTabbable( "#displayNoneAncestor-input", "input, display: none parent" );
isNotTabbable( "#displayNoneAncestor-span", "span with tabindex, display: none parent" );
@@ -218,6 +221,9 @@ test( "tabbable - hidden styles", function() {
isNotTabbable( "#visibilityHiddenAncestor-input", "input, visibility: hidden parent" );
isNotTabbable( "#visibilityHiddenAncestor-span", "span with tabindex, visibility: hidden parent" );
+ isTabbable( "#nestedVisibilityOverrideAncestor-input", "input, visibility: visible parent but visibility: hidden grandparent" );
+ isTabbable( "#nestedVisibilityOverrideAncestor-span", "span with tabindex, visibility: visible parent but visibility: hidden grandparent " );
+
isNotTabbable( "#displayNone-input", "input, display: none" );
isNotTabbable( "#visibilityHidden-input", "input, visibility: hidden" );