Closed Bug 1858362 Opened 1 year ago Closed 1 year ago

Style invalidation after call to CSS.registerProperty

Categories

(Core :: CSS Parsing and Computation, defect)

defect

Tracking

()

RESOLVED FIXED
120 Branch
Tracking Status
firefox120 --- fixed

People

(Reporter: fredw, Assigned: fredw)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

See the attached testcase, after CSS.registerProperty calls, --my-visibility and --my-display should use initial values hidden and none respectively so the "FAIL" messages shouldn't show up. This works in WebKit and Chrome.

There is a similar WPT registered-property-change-style-001.html test in interop 2023 that has always been failing in Firefox: https://wpt.fyi/results/css/css-properties-values-api/registered-property-change-style-001.html?label=master&label=experimental&product=chrome&product=firefox&product=safari&aligned&view=interop&q=label%3Ainterop-2023-property

Same test using @property instead. This currently works in Firefox.

@Emilio: I guess I need to add some invalidation call in Servo_RegisterCustomProperty. I can investigate later, but do you have some quick hints about how to do that?

Flags: needinfo?(emilio)

You want a block like this but in the caller (probably only when RegisterProperty succeeds.

Instead of RestyleSubtree I think RecascadeSubtree would be enough to pick up the initial values.

Flags: needinfo?(emilio)

Call to CSS.registerProperty may result in rendering changes compared
to when variables were interpreted as unregistered custom properties.
Ensure we recascade style for the whole document tree.

This was already covered by WPTs but add a more direct check for
paint and reflow.

Assignee: nobody → fwang
Status: NEW → ASSIGNED
Pushed by fred.wang@free.fr: https://hg.mozilla.org/integration/autoland/rev/8dbb04b2762b Style invalidation after call to CSS.registerProperty. r=emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/42481 for changes under testing/web-platform/tests
Upstream PR was closed without merging

It seems more tests pass after the recent changes Zach landed.

Flags: needinfo?(fwang)
Pushed by fred.wang@free.fr: https://hg.mozilla.org/integration/autoland/rev/1b47cd29b7c3 Style invalidation after call to CSS.registerProperty. r=emilio
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 120 Branch
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: