Opened 14 years ago
Closed 14 years ago
#3848 closed bug (fixed)
Child selector bug
Reported by: | LosT | Owned by: | john |
---|---|---|---|
Priority: | undecided | Milestone: | 1.3.1 |
Component: | selector | Version: | 1.3 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Child selector in the attached file has a very strange (and buggy) behaviour, it's broken by markup which shouldn't interfere.
Broken in: FF3, IE6/7, Opera 9 Works in: Safari 3, Opera 10
jQuery 1.2.6 was fine
Attachments (3)
Change History (16)
comment:1 Changed 14 years ago by
comment:2 Changed 14 years ago by
Sorry, I was in a hurry and I uploaded the wrong files. I just reuploaded them.
My issue is that the selector (.m2>li>b) should add the red background only on the first "test" (B tag) and not on all three Bs inside. The strange thing is that this behaviour is triggered by a B outside the first ul that should be checked (the one with class m2). Without that all goes fine.
comment:4 Changed 14 years ago by
I re-uploded the files without the styles, sorry for thet, it was a mistake.
comment:10 Changed 14 years ago by
i also have this problem using
$('div.editable > div').css('border','green 1px solid');
all divs on the page are given a green border, whereas
$('.editable > div').css('border','green 1px solid');
works
comment:11 Changed 14 years ago by
Milestone: | 1.3 → 1.3.1 |
---|---|
need: | Review → Test Case |
Version: | 1.2.6 → 1.3 |
Changed 14 years ago by
Attachment: | test-case-adamh.html added |
---|
Should alert("Yay, it works"); alerts, "WHY AM I SELECTED?"
comment:12 Changed 14 years ago by
Added my own test case, which I am guessing is the same bug (or at least closely related)
comment:13 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Thanks for the test cases, everyone. It was a rather obscure bug, but I just fixed it: http://github.com/jeresig/sizzle/commit/ecb9808024ccb7de6948423df6fc43664be509e6
Will be merging in to jQuery shortly.
It works for me, in both cases the expected element is selected. But the coloring is a bit misleading.