Added a fix for relative // - $("//div",this) (bug #1418)
This commit is contained in:
parent
a65a811ce0
commit
bdf05d890f
2 changed files with 3 additions and 2 deletions
|
@ -99,7 +99,7 @@ jQuery.extend({
|
||||||
|
|
||||||
// Handle the common XPath // expression
|
// Handle the common XPath // expression
|
||||||
if ( !t.indexOf("//") ) {
|
if ( !t.indexOf("//") ) {
|
||||||
context = context.documentElement;
|
//context = context.documentElement;
|
||||||
t = t.substr(2,t.length);
|
t = t.substr(2,t.length);
|
||||||
|
|
||||||
// And the / root expression
|
// And the / root expression
|
||||||
|
|
|
@ -183,8 +183,9 @@ test("pseudo (:) selectors", function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
test("basic xpath", function() {
|
test("basic xpath", function() {
|
||||||
expect(15);
|
expect(16);
|
||||||
ok( jQuery.find("//*").length >= 30, "All Elements (//*)" );
|
ok( jQuery.find("//*").length >= 30, "All Elements (//*)" );
|
||||||
|
ok( jQuery.find("//div", q("main")[0])[0] = q("foo")[0], "All Relative (#main//div)" );
|
||||||
t( "All Div Elements", "//div", ["main","foo"] );
|
t( "All Div Elements", "//div", ["main","foo"] );
|
||||||
t( "Absolute Path", "/html/body", ["body"] );
|
t( "Absolute Path", "/html/body", ["body"] );
|
||||||
t( "Absolute Path w/ *", "/* /body", ["body"] );
|
t( "Absolute Path w/ *", "/* /body", ["body"] );
|
||||||
|
|
Loading…
Reference in a new issue