commit c1f293bbfaeaa780ee7a8e6a11b9d742a10ad5b8 parent 2b54f26fc923d586e1a59f6f6387ff32015bc653 Author: Emilio Cobos Álvarez <emilio@crisal.io> Date: Sat, 13 Dec 2025 09:32:32 +0000 Bug 2005623 - Use a link element for theme experiment stylesheets. r=Gijs Otherwise the xml-pi has very little priority. Differential Revision: https://phabricator.services.mozilla.com/D276077 Diffstat:
| M | toolkit/modules/LightweightThemeConsumer.sys.mjs | | | 12 | +++++------- |
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/toolkit/modules/LightweightThemeConsumer.sys.mjs b/toolkit/modules/LightweightThemeConsumer.sys.mjs @@ -471,13 +471,11 @@ LightweightThemeConsumer.prototype = { this._lastExperimentData.usedVariables = usedVariables; if (experiment.stylesheet) { - /* Stylesheet URLs are validated using WebExtension schemas */ - let stylesheetAttr = `href="${experiment.stylesheet}" type="text/css"`; - let stylesheet = this._doc.createProcessingInstruction( - "xml-stylesheet", - stylesheetAttr - ); - this._doc.insertBefore(stylesheet, root); + let stylesheet = this._doc.createElement("link"); + stylesheet.rel = "stylesheet"; + // Stylesheet URLs are validated using WebExtension schemas + stylesheet.href = experiment.stylesheet; + this._doc.head.appendChild(stylesheet); this._lastExperimentData.stylesheet = stylesheet; } },