Commit f9ef91d6 authored by Mike Sherov's avatar Mike Sherov Committed by Dave Methvin

Fix #10943, tabindex not set properly on clone in IE7. Close gh-937.

This is only a unit test fix because the bug was tangentially fixed by a different commit
parent c3b1367f
...@@ -654,41 +654,46 @@ test("prop('tabindex')", function() { ...@@ -654,41 +654,46 @@ test("prop('tabindex')", function() {
equal(jQuery("#linkWithNoHrefWithNegativeTabIndex").prop("tabindex"), -1, "anchor without href, no tabindex set"); equal(jQuery("#linkWithNoHrefWithNegativeTabIndex").prop("tabindex"), -1, "anchor without href, no tabindex set");
}); });
test("prop('tabindex', value)", function() { test("prop('tabindex', value)", 10, function() {
expect(9);
var element = jQuery("#divWithNoTabIndex"),
clone;
var element = jQuery("#divWithNoTabIndex");
equal(element.prop("tabindex"), undefined, "start with no tabindex"); equal(element.prop("tabindex"), undefined, "start with no tabindex");
// set a positive string // set a positive string
element.prop("tabindex", "1"); element.prop( "tabindex", "1" );
equal(element.prop("tabindex"), 1, "set tabindex to 1 (string)"); equal( element.prop("tabindex"), 1, "set tabindex to 1 (string)" );
// set a zero string // set a zero string
element.prop("tabindex", "0"); element.prop( "tabindex", "0" );
equal(element.prop("tabindex"), 0, "set tabindex to 0 (string)"); equal( element.prop("tabindex"), 0, "set tabindex to 0 (string)" );
// set a negative string // set a negative string
element.prop("tabindex", "-1"); element.prop( "tabindex", "-1" );
equal(element.prop("tabindex"), -1, "set tabindex to -1 (string)"); equal( element.prop("tabindex"), -1, "set tabindex to -1 (string)" );
// set a positive number // set a positive number
element.prop("tabindex", 1); element.prop( "tabindex", 1 );
equal(element.prop("tabindex"), 1, "set tabindex to 1 (number)"); equal( element.prop("tabindex"), 1, "set tabindex to 1 (number)" );
// set a zero number // set a zero number
element.prop("tabindex", 0); element.prop( "tabindex", 0 );
equal(element.prop("tabindex"), 0, "set tabindex to 0 (number)"); equal( element.prop("tabindex"), 0, "set tabindex to 0 (number)" );
// set a negative number // set a negative number
element.prop("tabindex", -1); element.prop( "tabindex", -1 );
equal(element.prop("tabindex"), -1, "set tabindex to -1 (number)"); equal( element.prop("tabindex"), -1, "set tabindex to -1 (number)" );
element = jQuery("#linkWithTabIndex"); element = jQuery("#linkWithTabIndex");
equal(element.prop("tabindex"), 2, "start with tabindex 2"); equal( element.prop("tabindex"), 2, "start with tabindex 2" );
element.prop( "tabindex", -1 );
equal( element.prop("tabindex"), -1, "set negative tabindex" );
element.prop("tabindex", -1); clone = element.clone();
equal(element.prop("tabindex"), -1, "set negative tabindex"); clone.prop( "tabindex", 1 );
equal( clone[ 0 ].getAttribute("tabindex"), 1, "set tabindex on cloned element" );
}); });
test("removeProp(String)", function() { test("removeProp(String)", function() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment