Opened 14 years ago
Closed 13 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)
Change History (6)
comment:1 follow-up: 3 Changed 14 years ago by
comment:2 Changed 14 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
Closed for inactivity; reopen with a test case if the problem still exists.
Changed 14 years ago by
Attachment: | index.html added |
---|
tested xhtml strict proof for 4224 (add jquery-1.3.2.min.js yourself)
comment:3 Changed 14 years ago by
Resolution: | invalid |
---|---|
Status: | closed → reopened |
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 14 years ago by
Component: | unfilled → selector |
---|
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 13 years ago by
Resolution: | → wontfix |
---|---|
Status: | reopened → closed |
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.
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?