Closed
Bug 1290224
Opened 8 years ago
Closed 8 years ago
stylo: Support nsStyleSheetService
Categories
(Core :: CSS Parsing and Computation, defect)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
People
(Reporter: bholley, Assigned: heycam)
References
Details
AFAICT this is used only by XPCOM addons [1], as well as Firefox Hello [2]. Cameron, can you confirm that there's no other reason we'd need to support this?
Presumably not super high priority, but probably not hard either.
[1] https://dxr.mozilla.org/addons/search?q=loadAndRegisterSheet&redirect=true
[2] https://dxr.mozilla.org/mozilla-central/source/browser/extensions/loop/bootstrap.js#1432
Reporter | ||
Updated•8 years ago
|
Flags: needinfo?(cam)
Assignee | ||
Comment 1•8 years ago
|
||
(In reply to Bobby Holley (:bholley) (busy with Stylo) from comment #0)
> AFAICT this is used only by XPCOM addons [1], as well as Firefox Hello [2].
> Cameron, can you confirm that there's no other reason we'd need to support
> this?
Yes I think that's right. (There are a couple of mochitests that use the interface too, e.g. to check that we correctly parse certain constructs in UA sheets and not in content sheets.)
Flags: needinfo?(cam)
Comment 2•8 years ago
|
||
At least style system mochitest "test_addSheet.html" relies on nsStyleSheetService::PreloadSheet being able to create ServoStyleSheet.
I think making it create the correct object is probably not hard, but the tricky part is how can we know whether we should create CSSStyleSheet or ServoStyleSheet. Probably always create ServoStyleSheet when stylo is enabled?
Blocks: stylo-style-mochitest
Assignee | ||
Comment 3•8 years ago
|
||
As far as I can see, preloadSheet is basically designed to be used just with nsIDOMWindowUtils.addSheet. We could do something like this: have a new concrete class PreloadedSheet that implements nsIDOMStyleSheet, which can own a Gecko CSSStyleSheet and a ServoStyleSheet. PreloadedSheet could default to creating a ServoStyleSheet is the pref is set, but if later we pass a PreloadedSheet to nsIDOMWindowUtils.addSheet, we can just create the CSSStyleSheet at that point.
We might be lucky enough not to need to implement any of the nsIDOM(CSS)StyleSheet accessors. Actually, looking at DXR, there are surprisingly few uses of preloadSheet in extensions. I think we could just change the API not to return an nsIDOMStyleSheet, but something more opaque, which all you can usefully do with is pass to addSheet.
Comment 5•8 years ago
|
||
Also
layout/style/chrome/test_moz_document_rules.html
layout/style/browser_newtab_share_rule_processors.js
Reporter | ||
Updated•8 years ago
|
Updated•8 years ago
|
Reporter | ||
Comment 7•8 years ago
|
||
This is done now I think.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•