Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jquery
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
jquery
Commits
bdf05d89
Commit
bdf05d89
authored
Jul 25, 2007
by
John Resig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a fix for relative // - $("//div",this) (bug #1418)
parent
a65a811c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
selector.js
src/selector/selector.js
+1
-1
selectorTest.js
src/selector/selectorTest.js
+2
-1
No files found.
src/selector/selector.js
View file @
bdf05d89
...
@@ -99,7 +99,7 @@ jQuery.extend({
...
@@ -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
...
...
src/selector/selectorTest.js
View file @
bdf05d89
...
@@ -183,8 +183,9 @@ test("pseudo (:) selectors", function() {
...
@@ -183,8 +183,9 @@ test("pseudo (:) selectors", function() {
});
});
test
(
"basic xpath"
,
function
()
{
test
(
"basic xpath"
,
function
()
{
expect
(
1
5
);
expect
(
1
6
);
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"
]
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment