Skip to main content

Bug Tracker

Side navigation

#4224 closed bug (wontfix)

Opened February 23, 2009 08:25PM UTC

Closed December 05, 2009 05:51AM UTC

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 (0.6 KB) - added by Sjeiti June 23, 2009 03:46PM UTC.

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

Change History (5)

Changed February 23, 2009 11:53PM UTC by dmethvin comment:1

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?

Changed May 16, 2009 01:37AM UTC by dmethvin comment:2

resolution: → invalid
status: newclosed

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

Changed June 23, 2009 03:51PM UTC by Sjeiti comment:3

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.

Changed August 07, 2009 04:27PM UTC by dmethvin comment:4

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.

Changed December 05, 2009 05:51AM UTC by john comment:5

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.