diff options
author | Moonchild <moonchild@palemoon.org> | 2021-02-24 09:05:30 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2021-02-24 09:05:30 +0000 |
commit | 177468f8019b46216e3beaef0fd24ea1f3789ca1 (patch) | |
tree | 03cb46dd313e7bfe98b2af92bcdc85c1ee7ea2b8 | |
parent | e7fa76bda4ce805afc912d531c9a4f2fb98b5b37 (diff) | |
download | aura-central-177468f8019b46216e3beaef0fd24ea1f3789ca1.tar.gz |
[dom] Update noscript serialization to the changed spec.
Make <noscript> escaping conditional on whether scripting is enabled.
-rw-r--r-- | dom/base/nsContentUtils.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp index 107daaede..7dc6ccb99 100644 --- a/dom/base/nsContentUtils.cpp +++ b/dom/base/nsContentUtils.cpp @@ -9140,10 +9140,6 @@ ShouldEscape(nsIContent* aParent) nsGkAtoms::style, nsGkAtoms::script, nsGkAtoms::xmp, nsGkAtoms::iframe, nsGkAtoms::noembed, nsGkAtoms::noframes, nsGkAtoms::plaintext, - // Per the current spec noscript should be escaped in case - // scripts are disabled or if document doesn't have - // browsing context. However the latter seems to be a spec bug - // and Gecko hasn't traditionally done the former. nsGkAtoms::noscript }; static mozilla::BloomFilter<12, nsIAtom> sFilter; @@ -9159,6 +9155,10 @@ ShouldEscape(nsIContent* aParent) if (sFilter.mightContain(tag)) { for (uint32_t i = 0; i < ArrayLength(nonEscapingElements); ++i) { if (tag == nonEscapingElements[i]) { + if (MOZ_UNLIKELY(tag == nsGkAtoms::noscript) && + MOZ_UNLIKELY(!aParent->OwnerDoc()->IsScriptEnabled())) { + return true; + } return false; } } |