Style editor should use utils.getAllStyleSheets(document) to get all stylesheets

RESOLVED WORKSFORME

Status

()

Firefox
Developer Tools: Style Editor
RESOLVED WORKSFORME
5 years ago
4 years ago

People

(Reporter: miker, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

The style editor should use utils.getAllStyleSheets(document) to get all stylesheets for a document. We currently try to get them all but are often missing a few and this API has been created for this purpose.

Please note that getAllStyleSheets() also returns chrome stylesheets so if devtools.chrome.enabled is set to true we should probably include them as well.
This is DOMUtils.getAllStyleSheets, right?

What specific cases does the style editor (StyleSheetsActor.getStyleSheets) get wrong?

DOMUtils.getAllStyleSheets on the other hand

* doesn't give you sheets imported using @import
* just duplicates sheets that are imported twice (which may be what you want, it depends)
* gives you chrome stylesheets (which may not be what you want) and doesn't make it easy to work out which is which
Flags: needinfo?(mratcliffe)
(In reply to Joe Walker [:jwalker] from comment #1)
> This is DOMUtils.getAllStyleSheets, right?
> 
> What specific cases does the style editor (StyleSheetsActor.getStyleSheets)
> get wrong?
> 
> DOMUtils.getAllStyleSheets on the other hand
> 
> * doesn't give you sheets imported using @import
> * just duplicates sheets that are imported twice (which may be what you
> want, it depends)
> * gives you chrome stylesheets (which may not be what you want) and doesn't
> make it easy to work out which is which

Agreed, we were randomly missing stylesheets when this bug was logged but discovery is running smoothly these days.
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Flags: needinfo?(mratcliffe)
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.