Closed Bug 1857999 Opened 1 year ago Closed 1 year ago

Stop using xml-stylesheet processing instructions for styling non-test xhtml documents

Categories

(Firefox :: General, task)

Desktop
All
task

Tracking

()

RESOLVED FIXED
120 Branch
Tracking Status
firefox120 --- fixed

People

(Reporter: Gijs, Assigned: mossop)

References

(Blocks 2 open bugs)

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 .

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. :-) )

Blocks: 1857834
Flags: needinfo?(loganrosen)
Blocks: 1858003

I'm not sure I know enough about the inner workings of these XHTML documents to do this justice, unfortunately.

Flags: needinfo?(loganrosen)
Assignee: nobody → dtownsend
No longer blocks: 1592334
Duplicate of this bug: 1592334

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.

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

The result of running the automated script available at https://github.com/Mossop/depi

Depends on D190680

Manually re-apply comments and spacing that existed prior to the automated
changes.

Depends on D190681

Pushed by dtownsend@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c25b3a0b864c SubDialog should insert stylesheets as link elements. r=Gijs,settings-reviewers

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.

Keywords: leave-open
Keywords: leave-open
Pushed by dtownsend@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/dd5a10f9cfff Devtools should always inject additional stylesheets as link elements. r=ochameau,devtools-reviewers https://hg.mozilla.org/integration/autoland/rev/b8a03d31ecea Add html namespace declarations for files that are missing it. r=Gijs,webdriver-reviewers,devtools-reviewers https://hg.mozilla.org/integration/autoland/rev/0d0c1d1e80e7 Move XML stylesheet processing instructions to link elements. r=Gijs,webdriver-reviewers,settings-reviewers,application-update-reviewers,devtools-reviewers,places-reviewers,Standard8,whimboo,bytesized,ochameau https://hg.mozilla.org/integration/autoland/rev/75f5e6e3d917 Manually fix some spacing and comments. r=Gijs,settings-reviewers,places-reviewers,Standard8
See Also: → 1859273
Pushed by dtownsend@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5dd474fcfe1f Devtools should always inject additional stylesheets as link elements. r=ochameau,devtools-reviewers https://hg.mozilla.org/integration/autoland/rev/86eaaa793b27 Add html namespace declarations for files that are missing it. r=Gijs,webdriver-reviewers,devtools-reviewers https://hg.mozilla.org/integration/autoland/rev/fcfb26498574 Move XML stylesheet processing instructions to link elements. r=Gijs,webdriver-reviewers,settings-reviewers,application-update-reviewers,devtools-reviewers,places-reviewers,Standard8,whimboo,bytesized,ochameau https://hg.mozilla.org/integration/autoland/rev/0cf1d9d7091d Manually fix some spacing and comments. r=Gijs,settings-reviewers,places-reviewers,Standard8
Regressions: 1859730
Flags: needinfo?(dtownsend)
Regressions: 1877090
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: