Closed Bug 1698132 Opened 5 years ago Closed 5 years ago

Improve caching behaviour of -moz-bool-pref

Categories

(Core :: CSS Parsing and Computation, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
89 Branch
Tracking Status
firefox89 --- fixed

People

(Reporter: mconley, Assigned: emilio)

References

Details

Attachments

(1 file)

In bug 1697315, I added some CSS rules that use moz-bool-pref for a preference browser.proton.enabled. I ended up tripping a test failure in browser_preferences_usage.js, because apparently I was accessing that preference too often during startup.

That's not exactly expected. From our experience using moz-bool-pref, the preference should be read once and cached somehow. Generally, preference flips have not affected moz-bool-pref until restart. It's not clear to me how that caching works, and why it's not working in this case - though perhaps it's related to the fact that the moz-bool-pref read was occurring within checkbox.css, which is a CSS stylesheet scoped to a custom element.

See Also: → 1697315

I just hit the same for browser.proton.urlbar in Bug 1698834. I'll have to add another exception until it merges with the main pref.

This means that dynamic changes will be handled correctly, we can use
StaticPrefs, etc.

Assignee: nobody → emilio
Status: NEW → ASSIGNED

So -moz-bool-pref as is is wontfix, I think, but we can do better for specific prefs, and after the patch above adding these is relatively straight-forward (basically, defining the relevant token / pref pair in StaticAtoms / StaticPrefList.

Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b5e5ac2c512c Convert proton pref checks from @supports rules to media features. r=Gijs
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 89 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: