r3218 committed - core tests: a few comments about failing tests, a few fixes for existi...
Revision: 3218
Author: joern.zaefferer
Date: Tue Sep 15 01:35:46 2009
Log: core tests: a few comments about failing tests, a few fixes for
existing tests, mostly messages; primary remaining issue is that both
$("area").is(":visible") and $("area").is(":hidden") return true, which is
most likely a bug in jQuery core
http://code.google.com/p/jquery-ui/source/detail?r=3218
Modified:
/trunk/tests/unit/core/core.html
/trunk/tests/unit/core/selector.js
=======================================
--- /trunk/tests/unit/core/core.html Fri Sep 11 11:30:23 2009
+++ /trunk/tests/unit/core/core.html Tue Sep 15 01:35:46 2009
@@ -24,22 +24,22 @@
<input type="radio" id="visibleAncestor-inputTypeRadio" />
<input type="button" id="visibleAncestor-inputTypeButton" />
<input type="hidden" id="visibleAncestor-inputTypeHidden" />
- <button id="visibleAncestor-button"></button>
+ <button id="visibleAncestor-button">x</button>
<select id="visibleAncestor-select">
<option>option</option>
</select>
- <textarea id="visibleAncestor-textarea"></textarea>
- <object id="visibleAncestor-object"></object>
+ <textarea id="visibleAncestor-textarea">x</textarea>
+ <object id="visibleAncestor-object">xxx</object>
<a href="#" id="visibleAncestor-anchorWithHref">anchor</a>
<a id="visibleAncestor-anchorWithoutHref">anchor</a>
<map>
<area href="#" id="visibleAncestor-areaWithHref" alt="" />
<area id="visibleAncestor-areaWithoutHref" alt="" />
</map>
- <span id="visibleAncestor-span"></span>
- <div id="visibleAncestor-div"></div>
- <span id="visibleAncestor-spanWithTabindex" tabindex="1"></span>
- <div id="visibleAncestor-divWithNegativeTabindex" tabindex="-1"></div>
+ <span id="visibleAncestor-span">x</span>
+ <div id="visibleAncestor-div">x</div>
+ <span id="visibleAncestor-spanWithTabindex" tabindex="1">x</span>
+ <div id="visibleAncestor-divWithNegativeTabindex" tabindex="-1">x</div>
</div>
<div>
=======================================
--- /trunk/tests/unit/core/selector.js Tue Sep 1 01:16:10 2009
+++ /trunk/tests/unit/core/selector.js Tue Sep 15 01:35:46 2009
@@ -6,19 +6,19 @@
module("core - selectors");
function isFocusable(selector, msg) {
- ok($(selector).is(':focusable'), msg);
+ ok($(selector).is(':focusable'), msg + " - selector " + selector + " is
focusable");
}
function isNotFocusable(selector, msg) {
- ok($(selector).length && !$(selector).is(':focusable'), msg);
+ ok($(selector).length && !$(selector).is(':focusable'), msg + " -
selector " + selector + " is not focusable");
}
function isTabbable(selector, msg) {
- ok($(selector).is(':tabbable'), msg);
+ ok($(selector).is(':tabbable'), msg + " - selector " + selector + " is
tabbable");
}
function isNotTabbable(selector, msg) {
- ok($(selector).length && !$(selector).is(':tabbable'), msg);
+ ok($(selector).length && !$(selector).is(':tabbable'), msg + " -
selector " + selector + " is not tabbable");
}
test("data", function() {
@@ -93,6 +93,7 @@
isFocusable('#visibleAncestor-object', 'object');
isFocusable('#visibleAncestor-anchorWithHref', 'anchor with href');
isNotFocusable('#visibleAncestor-anchorWithoutHref', 'anchor without
href');
+ // fails: $("map").is(":visible") and $("map").is(":hidden") both return
true
isFocusable('#visibleAncestor-areaWithHref', 'area with href');
isNotFocusable('#visibleAncestor-areaWithoutHref', 'area without href');
isNotFocusable('#visibleAncestor-span', 'span');
@@ -131,7 +132,7 @@
isNotFocusable('#visibilityHidden-span', 'span with tabindex, visibility:
hidden');
});
-test("focusable - natively tabbable with various tabindex", function() {
+test("focusable - natively focusable with various tabindex", function() {
expect(4);
isFocusable('#inputTabindex0', 'input, tabindex 0');
@@ -140,7 +141,7 @@
isFocusable('#inputTabindex-50', 'input, tabindex -50');
});
-test("focusable - not natively tabbable with various tabindex",
function() {
+test("focusable - not natively focusable with various tabindex",
function() {
expect(4);
isFocusable('#spanTabindex0', 'span, tabindex 0');
@@ -173,6 +174,7 @@
isTabbable('#visibleAncestor-object', 'object');
isTabbable('#visibleAncestor-anchorWithHref', 'anchor with href');
isNotTabbable('#visibleAncestor-anchorWithoutHref', 'anchor without
href');
+ // fails: $("map").is(":visible") and $("map").is(":hidden") both return
true
isTabbable('#visibleAncestor-areaWithHref', 'area with href');
isNotTabbable('#visibleAncestor-areaWithoutHref', 'area without href');
isNotTabbable('#visibleAncestor-span', 'span');
@@ -201,10 +203,12 @@
isNotTabbable('#displayNoneAncestor-input', 'input, display: none
parent');
isNotTabbable('#displayNoneAncestor-span', 'span with tabindex, display:
none parent');
+ // fails: element hidden by parent-visibility-hidden is still visible
according to :visible
isNotTabbable('#visibilityHiddenAncestor-input', 'input, visibility:
hidden parent');
isNotTabbable('#visibilityHiddenAncestor-span', 'span with tabindex,
visibility: hidden parent');
isNotTabbable('#displayNone-input', 'input, display: none');
+ // fails: element hidden by parent-visibility-hidden is still visible
according to :visible
isNotTabbable('#visibilityHidden-input', 'input, visibility: hidden');
isNotTabbable('#displayNone-span', 'span with tabindex, display: none');