1.1.2
----
+* Fixed IE ID selectors selecting by the name attribute.
* Change: Events are now internally stored in elem.$events rather than elem.events (due to a nasty bug relating to DOM 0 expandos).
+* .attr('href') is now consistent in all browsers.
* @href is now consistent in all browsers.
* Fixed the slideDown flickering bug.
* Having a \r endline in $("...") caused a never-ending loop.
});\r
\r
test("attr(String)", function() {\r
- expect(14);\r
+ expect(15);\r
ok( $('#text1').attr('value') == "Test", 'Check for value attribute' );\r
ok( $('#text1').attr('type') == "text", 'Check for type attribute' );\r
ok( $('#radio1').attr('type') == "radio", 'Check for type attribute' );\r
ok( $('#name').attr('name') == "name", 'Check for name attribute' );\r
ok( $('#text1').attr('name') == "action", 'Check for name attribute' );\r
ok( $('#form').attr('action').indexOf("formaction") >= 0, 'Check for action attribute' );\r
- //equals( "#2", $('#anchor2').attr('href'), 'Check for non-absolute href (an anchor)' ); This fails in IE because the _config.fixture is reloaded using innerHTML\r
+ \r
+ $('<a id="tAnchor5"></a>').attr('href', '#5').appendTo('#main'); // using innerHTML in IE causes href attribute to be serialized to the full path\r
+ ok( $('#tAnchor5').attr('href') == "#5", 'Check for non-absolute href (an anchor)' );\r
+ \r
stop();\r
$.get("data/dashboard.xml", function(xml) {\r
ok( $("locations", xml).attr("class") == "foo", "Check class attribute in XML document" );\r
\r
reset();\r
$("#sap").append(document.getElementById('form'));\r
- ok( $("#sap>form").size() == 1, "Check for appending a form" );\r
+ ok( $("#sap>form").size() == 1, "Check for appending a form" ); // Bug #910\r
\r
});\r
\r
if ( m[1] == "#" && ret[ret.length-1].getElementById ) {
// Optimization for HTML document case
var oid = ret[ret.length-1].getElementById(m[2]);
+
+ // Do a quick check for the existence of the actual ID attribute
+ // to avoid selecting by the name attribute in IE
+ if ( jQuery.browser.msie && oid && oid.id != m[2] )
+ oid = jQuery('[@id="'+m[2]+'"]', ret[ret.length-1])[0];
// Do a quick check for node name (where applicable) so
// that div#foo searches will be really fast
- ret = r = oid &&
- (!m[3] || jQuery.nodeName(oid, m[3])) ? [oid] : [];
+ ret = r = oid && (!m[3] || jQuery.nodeName(oid, m[3])) ? [oid] : [];
} else {
// Pre-compile a regular expression to handle class searches
});\r
\r
test("expressions - id", function() {\r
- expect(11);\r
+ expect(13);\r
t( "ID Selector", "#body", ["body"] );\r
t( "ID Selector w/ Element", "body#body", ["body"] );\r
t( "ID Selector w/ Element", "ul#first", [] );\r
t( "All Children of ID", "#foo/*", ["sndp", "en", "sap"] );\r
t( "All Children of ID with no children", "#firstUL/*", [] );\r
\r
- t( "ID selector with non-existant ancestor", "#asdfasdf #foobar", [] );\r
+ $('<a name="tName1">tName1 A</a><a name="tName2">tName2 A</a><div id="tName1">tName1 Div</div>').appendTo('#main');\r
+ ok( $("#tName1")[0].id == 'tName1', "ID selector with same value for a name attribute" );\r
+ ok( $("#tName2").length == 0, "ID selector non-existing but name attribute on an A tag" );\r
+ \r
+ t( "ID selector with non-existant ancestor", "#asdfasdf #foobar", [] ); // bug #986\r
});\r
\r
\r