Bug Tracker

Opened 11 years ago

Closed 10 years ago

#4224 closed bug (wontfix)

selecting with space does not go deep

Reported by: Sjeiti Owned by:
Priority: major Milestone: 1.4
Component: selector Version: 1.3.2
Keywords: selector space Cc:
Blocked by: Blocking:

Description

with a deep list <ul><li>a</li><li>b<ul><li>ba</li><ul></li><ul> $("li").length returns 3 (correct) $("body>ul li").length returns 2 (incorrect)

looks like space is read as >

Attachments (1)

index.html (607 bytes) - added by Sjeiti 10 years ago.
tested xhtml strict proof for 4224 (add jquery-1.3.2.min.js yourself)

Download all attachments as: .zip

Change History (6)

comment:1 Changed 11 years ago by dmethvin

Is that your actual HTML? It's not well formed because it's missing closing tags. Can you put together a complete test case and attach it?

comment:2 Changed 11 years ago by dmethvin

Resolution: invalid
Status: newclosed

Closed for inactivity; reopen with a test case if the problem still exists.

Changed 10 years ago by Sjeiti

Attachment: index.html added

tested xhtml strict proof for 4224 (add jquery-1.3.2.min.js yourself)

comment:3 in reply to:  1 Changed 10 years ago by Sjeiti

Resolution: invalid
Status: closedreopened

Ah well, error in the post. But the bug is there. See the attached file. I just checked more thouroughly; the bug occurs in Firefox and IE. Chrome and Safari seem to do just fine.

comment:4 Changed 10 years ago by dmethvin

Component: unfilledselector

It looks like the problem is in Sizzle's dirNodeCheck function. It assumes that once it finds a matching ancestor element it can stop looking, but actually I think it needs to continue up the tree to (in this case) find the ul under the body rather than just the inner ul.

comment:5 Changed 10 years ago by john

Resolution: wontfix
Status: reopenedclosed

Unfortunately it's not something that can be easily fixed. The selector would have to be broken into sub-parts and be re-queried as it goes up the tree. It would be both very expensive to run and would have a ton of overhead for most selectors. Unfortunately I think this is one case that we kind of have to punt on given the selector engine style that we choose :-/ Unfortunate, I know.

Note: See TracTickets for help on using tickets.