Closed Bug 77519 Opened 25 years ago Closed 23 years ago

[FIXr][CSS3] incorrect matching in SelectorMatches()

Categories

(Core :: CSS Parsing and Computation, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla1.4beta

People

(Reporter: glazou, Assigned: bzbarsky)

Details

(Keywords: css3)

Attachments

(1 file, 1 obsolete file)

Looking back at the code of SelectorMatches for 60290, I discovered two errors in the code. I am responsible for these errors since they come from or should have been fixed by :not() integration a) an unknown pseudo-class generates result = localFalse instead of PR_FALSE b) negated ID and class selectors matching is incorrect, in particular in case of multiple negated ID and class selectors in same sequence of simple selectors.
Status: NEW → ASSIGNED
Keywords: correctness, css3
patch attached ; pierre and marc, can you r= and sr= please ?
Daniel, do we now have testcases for this? I'm curious why it was not caught before.
Same here. If we didn't catch it before, my guess is that everybody got confused with the localTrue/localFalse vs PR_TRUE/PR_FALSE again. It was the same problem last time around in bug 71647. I would like to have testcases that go through all the paths in the code. Hopefully there won't be many other cases to check, so it would be nice to put them all under the same place, attached to this bug for instance.
Pierre is right for the first part, it comes from my localFalse/localTrue thing again. And I apologize again. The second one is not related directly to that. In fact I missed something in the selection code for IDs and classes, that's all (but that's a lot). Both had no incidence on existing stylesheets and existing testcases and that's why it was hard to see it. To see it, you have to have a test with a) a non-existing pseudo-class like |:foobar| for instance b) multiple negated ID or classes selectors in the same sequence of simple selectors; for instance |p:not(.warning):not(.important)|
moving to moz1.0 to get it off the un-milestoned list, move it to the appropriate milestone when you are ready
Priority: -- → P3
Target Milestone: --- → mozilla1.0
Bugs targeted at mozilla1.0 without the mozilla1.0 keyword moved to mozilla1.0.1 (you can query for this string to delete spam or retrieve the list of bugs I've moved)
Target Milestone: mozilla1.0 → mozilla1.0.1
ping? Daniel, could you attach a testcase that fails with the current code?
At least part of this patch was superseded by bug 83616.
OK, issue (b) from comment 0 was resolved by bug 83616. Issue (a) is more or less a non-issue -- the only case in which that code would be hit is if the CSS parser messes up. Attaching updated patch covering that case, though.
Attachment #32136 - Attachment is obsolete: true
Attachment #122418 - Flags: superreview?(dbaron)
Attachment #122418 - Flags: review?(glazman)
Attachment #122418 - Flags: superreview?(dbaron) → superreview+
I should just take this.
Assignee: glazman → bz-bugspam
Status: ASSIGNED → NEW
Priority: P3 → P2
Summary: [CSS3] incorrect matching in SelectorMatches() → [FIX][CSS3] incorrect matching in SelectorMatches()
Target Milestone: mozilla1.0.1 → mozilla1.4beta
Comment on attachment 122418 [details] [diff] [review] glazou's patch updated to tip r=glazman
Attachment #122418 - Flags: review?(glazman) → review+
Comment on attachment 122418 [details] [diff] [review] glazou's patch updated to tip Could this please be approved for 1.4b? This just makes sure we have saner behavior in an error case.
Attachment #122418 - Flags: approval1.4b?
Summary: [FIX][CSS3] incorrect matching in SelectorMatches() → [FIXr][CSS3] incorrect matching in SelectorMatches()
Comment on attachment 122418 [details] [diff] [review] glazou's patch updated to tip a=sspitzer, but it might be too late for 1.4 beta.
Attachment #122418 - Flags: approval1.4b? → approval1.4b+
Comment on attachment 122418 [details] [diff] [review] glazou's patch updated to tip It is too late. Changing approval from 1.4b to 1.4.
Attachment #122418 - Flags: approval1.4b+ → approval1.4+
Checked in for 1.4 final.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: