Closed Bug 1870812 Opened 2 years ago Closed 2 years ago

Add CSS_REGISTERED_PROPERTIES resource

Categories

(DevTools :: Inspector: Rules, task)

task

Tracking

(firefox124 fixed)

RESOLVED FIXED
124 Branch
Tracking Status
firefox124 --- fixed

People

(Reporter: nchevobbe, Assigned: nchevobbe)

References

Details

Attachments

(1 file)

Since custom properties are tied to a given document it makes sense to have them as resources

Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED

Emilio, Zach, I'm adding an event listener on StyleSheetApplicableStateChanged¹ where the callback calls InspectorUtils.getCSSRegisteredProperties to retrieve the registered properties added in the stylesheet, but in some cases, it looks like the property aren't registered yet (at least on MacOS on TRY: https://treeherder.mozilla.org/logviewer?job_id=442251180&repo=try&lineNumber=4808-4849).
If I wait ~10ms then I do get the registered properties from the new stylesheet, but I'd rather avoid waiting for some arbitrary duration (just waiting for next tick isn't enough).

Is this something expected, and if so, would you have something in mind so we could fix it?


¹ we might have similar issue with StyleSheetRemoved, not sure though

Flags: needinfo?(zach)
Flags: needinfo?(emilio)

Yes. Change this code to call UpdateStylistIfNeeded.

Flags: needinfo?(emilio)

(In reply to Emilio Cobos Álvarez (:emilio) from comment #3)

Yes. Change this code to call UpdateStylistIfNeeded.

thanks, TV jobs are happy with this change now :)

Glad it's working!

Flags: needinfo?(zach)
Pushed by nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/41fd454b843a [devtools] Add CSS_REGISTERED_PROPERTIES resource. r=devtools-reviewers,ochameau.

ah yes, need to handle no eft

Flags: needinfo?(nchevobbe)
Pushed by nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8913eab3409d [devtools] Add CSS_REGISTERED_PROPERTIES resource. r=devtools-reviewers,ochameau.
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 124 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: