Make sure that [name=foo] and #id selectors don't use the native methods on XML documents (since id and name attributes may not be defined by a DTD and will return nothing instead. Fixes jQuery bug #3945.
This commit is contained in:
parent
f9a5849723
commit
7d9d210540
2 changed files with 15 additions and 9 deletions
|
@ -21,11 +21,15 @@ test("element", function() {
|
|||
});
|
||||
|
||||
if ( location.protocol != "file:" ) {
|
||||
test("Element Selector with underscore", function() {
|
||||
expect(1);
|
||||
test("XML Document Selectors", function() {
|
||||
expect(5);
|
||||
stop();
|
||||
jQuery.get("data/with_fries.xml", function(xml) {
|
||||
equals( jQuery("foo_bar", xml).length, 1, "Element Selector with underscore" );
|
||||
equals( jQuery("property[name=prop2]", xml).length, 1, "Attribute selector with name" );
|
||||
equals( jQuery("[name=prop2]", xml).length, 1, "Attribute selector with name" );
|
||||
equals( jQuery("#seite1", xml).length, 1, "Attribute selector with name" );
|
||||
equals( jQuery("component#seite1", xml).length, 1, "Attribute selector with name" );
|
||||
start();
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue