Commit 9bc4205
Avoid inflating inline stylesheet text just to turn it into utf-8 again.
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
bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=2065672
gecko-commit: d67e01c46a66136be42b53e85251d46a27f35212
gecko-commit-git: a2666940ab8875cce1d1970501f67a5f30efb481
gecko-reviewers: dom-core-reviewers, smaug1 parent 1d0c771 commit 9bc4205
1 file changed
Lines changed: 7 additions & 0 deletions
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
0 commit comments