Files
Emilio Cobos Álvarez a2666940ab Bug 2065672 - Avoid inflating inline stylesheet text just to turn it into utf-8 again. r=dom-core-reviewers,smaug
Most inline stylesheets are actually ascii / use Latin1 storage, so it's
faster to just copy it out that to inflate just to deflate it before
parsing.

Do the same trick we use for <script> elements and CSP and retrieve the
two-byte text there instead. Chances are we want to just use the utf-8
text there, since that's what we end up using for the hash / nonce:

  https://searchfox.org/firefox-main/rev/2916f047242de012d1aa0c572be9e5239644cc48/dom/security/nsCSPUtils.cpp#1020-1021

But plumbing that through gets a bit annoying.

Differential Revision: https://phabricator.services.mozilla.com/D320598
2026-08-22 20:59:43 +00:00
..