Stop using xml-stylesheet processing instructions for styling non-test xhtml documents
Categories
(Firefox :: General, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox120 | --- | fixed |
People
(Reporter: Gijs, Assigned: mossop)
References
(Blocks 1 open bug)
Details
Attachments
(5 files)
These are getting misformatted by prettier v3, and it's about time we stop using them anyway. link
elements are more widely recognized by tooling, and have more features than XML PIs.
(For instance, using "normal" link
elements with their media
attributes would provide a neat way to e.g. include platform-specific styles in a way that doesn't require ifdefs or media queries combined with @import in a single shared sheet.)
It's worth noting that not all our consumers live in markup, cf. https://searchfox.org/mozilla-central/rev/d265ec4f5fdcb5ad0c06636c5ac010ef4ff7eb89/toolkit/modules/SubDialog.sys.mjs#111-121 .
Reporter | ||
Comment 1•1 year ago
|
||
Logan, I don't suppose you'd be interested in picking this up given how it relates to bug 1857834? ("No, I don't have time" or w/e is fine, no pressure. :-) )
Comment 2•1 year ago
|
||
I'm not sure I know enough about the inner workings of these XHTML documents to do this justice, unfortunately.
Updated•1 year ago
|
Assignee | ||
Updated•1 year ago
|
Assignee | ||
Updated•1 year ago
|
Assignee | ||
Comment 4•1 year ago
|
||
Attempt to find other link elements in the document and insert the injected
stylesheets after those. Strictly speaking we could probably just insert them
at the end of the document but this at least keeps them together with other
link elements to aid in inspecting. Falls back to using the XML processing
instruction in hte unlikely case that no other link elements are present.
Assignee | ||
Comment 5•1 year ago
|
||
The automated scripts requires an already present namespace prefix for the
xhtml namespace so just manually add those for documents that don't already have
one.
Depends on D190679
Assignee | ||
Comment 6•1 year ago
|
||
The result of running the automated script available at https://github.com/Mossop/depi
Depends on D190680
Assignee | ||
Comment 7•1 year ago
|
||
Manually re-apply comments and spacing that existed prior to the automated
changes.
Depends on D190681
Assignee | ||
Comment 9•1 year ago
|
||
Improves the logic to always insert stylesheets as link elements regardless of
whether it is into a html document or not. In order for the ordering to be
correct the insertion must occur after existing link elements in the document
have been parsed so the theme-switching.js
script must always be loaded after
link elements. The storage client appears to be the only existing document where
that wasn't already the case.
Assignee | ||
Updated•1 year ago
|
Comment 10•1 year ago
|
||
bugherder |
Assignee | ||
Updated•1 year ago
|
Comment 11•1 year ago
|
||
Comment 12•1 year ago
|
||
Backed out for causing for causing dt failures on browser_theme_switching.js & Mn failures at test_element_state_chrome.py
Backout link: https://hg.mozilla.org/integration/autoland/rev/ee6b5dc47ec451962b3c7c27e1480d1a94177c63
Comment 13•1 year ago
|
||
Comment 14•1 year ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/5dd474fcfe1f
https://hg.mozilla.org/mozilla-central/rev/86eaaa793b27
https://hg.mozilla.org/mozilla-central/rev/fcfb26498574
https://hg.mozilla.org/mozilla-central/rev/0cf1d9d7091d
Assignee | ||
Updated•1 year ago
|
Description
•