Closed Bug 2097799 Opened 5 days ago Closed 3 days ago

sibling-count() interacts poorly with cached properties sharing

Categories

(Core :: CSS Parsing and Computation, defect)

defect

Tracking

()

RESOLVED FIXED
163 Branch
Tracking Status
firefox163 --- fixed

People

(Reporter: dshin, Assigned: dshin)

References

Details

Attachments

(1 file, 1 external file)

Attached file Testcase from codepen —

(Original testcase from https://codepen.io/editor/alowpoly/pen/01a207e3-387b-74f5-aeb7-4668bae6b3d9)

Fairly sure this is a style sharing issue, because they style fine if there's only one <ul>, and the issue flips if the ordering is changed.

Hm, actually, these checks exist. Digging a bit further

Ah, it's another cache here, I think

Yeah, adding something like this

if style.flags.contains(ComputedValueFlags::USES_SIBLING_COUNT) {
  return false;
}

around here makes it work as expected.

... This optimization shares non-inherited properties from the matching rule node, but I wonder about some of these. Sibling-using functions likely shouldn't be shared, but could, say, random() end up being the same value when used on non-inherited property?

EDIT: Ah, they set the rule cache condition as uncachable 1 2

Summary: sibling-count() interacts poorly with style sharing → sibling-count() interacts poorly with cached properties sharing
Assignee: nobody → dshin
Blocks: 2098201
Pushed by dshin@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/0531e55b0acc https://hg.mozilla.org/integration/autoland/rev/60ca54ac468c Mark sibling-count() using styles as uncacheable for rule cache. r=firefox-style-system-reviewers,emilio
Status: NEW → RESOLVED
Closed: 3 days ago
Resolution: --- → FIXED
Target Milestone: --- → 163 Branch

Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/65814 for changes under testing/web-platform/tests

Upstream PR merged by moz-wptsync-bot

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: