Closed Bug 1360399 Opened 4 years ago Closed 4 years ago

Don't deduplicate revalidation selectors.

Categories

(Core :: CSS Parsing and Computation, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: emilio, Assigned: emilio)

References

Details

Attachments

(2 files)

It's unfortunate, but it's a correctness issue. I was looking at the expectations update here:

 * https://hg.mozilla.org/integration/autoland/rev/659cddddd434

And investigating it I realised that it's wrong to coalesce selectors like that, because we keep the bloom filter flags.

So in the test cases disabled, we have a selector that looks like this:

msub > :not(:first-child),
msup > :not(:first-child),
msubsup > :not(:first-child),
mmultiscripts > :not(:first-child) {
    -moz-script-level: +1;
    -moz-math-display: inline;
}

And an element that looks like this:

<msubsup><mi></mi><mi></msubsup>

We're only inserting the first selector msub > :not(:first-child) into the set, so when we're going to match the <mi> elements we fast-reject it in both cases due to the bloom filter, so they share style.

I can't see an easy way to fix this keeping the deduplication. If we keep it, we need to remove the bloom filter optimization, which means that we'd trash the cache for every first-child in the document (the :not(:first-child) effectively becomes a global rule).
Comment on attachment 8862678 [details]
Bug 1360399: Don't deduplicate revalidation selectors.

https://reviewboard.mozilla.org/r/134548/#review137510

Nice find! Sorry for screwing that up.
Attachment #8862678 - Flags: review?(bobbyholley) → review+
Tests were re-enabled (accidentally?) in bug 1351548. Patch at https://github.com/servo/servo/commit/7a556a7f03a64d8cf3d128590bf5bbc66813137f
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.