This reverts commit 524a1fc191.
Revert "Bug 2020707 - Part 5: Gate speculation rules script support behind a pref. r=dom-core-reviewers,jjaschke"
This reverts commit 11741d18ad.
Revert "Bug 2020707 - Part 4: Unregister speculation rules when their script element is removed. r=dom-core-reviewers,hsivonen"
This reverts commit 5202943dc9.
Revert "Bug 2020707 - Part 3: Report an exception if speculation rules parsing fails. r=dom-core-reviewers,jjaschke"
This reverts commit 70c5aa5425.
Revert "Bug 2020707 - Part 2: Add support for speculationrules script type. r=dom-core-reviewers,jjaschke"
This reverts commit 65b30a350b.
Revert "Bug 2020707 - Part 1: Allow speculation rules to be registered to the document from scripts. r=hsivonen,jjaschke"
This reverts commit 28c7050de9.
Revert "Bug 2020704 - Part 2: Add parser for speculation rule sets. r=hsivonen,jjaschke"
This reverts commit eabb8c6eb3.
Revert "Bug 2020704 - Part 1: Add speculation rules crate. r=dom-core-reviewers,jjaschke"
This reverts commit cd65bed005.
It's a 1:1 mapping for the origin that we cache in the
StyleSheetContents, so use that.
PreloadHashKey only cares about author loads, within a document, so
doesn't really need to deal with user / user-agent ones.
Differential Revision: https://phabricator.services.mozilla.com/D304400
This reverts commit 82b2e13b45.
Revert "Bug 2038124 - Optimize setting attributes on non-custom HTML elements from parser. r=smaug"
This reverts commit 2d1ee1cd69.
This reverts commit 9dd3f6b595.
Revert "Bug 2038124 - Optimize setting attributes on non-custom HTML elements from parser. r=smaug"
This reverts commit b1774ce65e.
MakeAndAddRef ensures that the freshly-allocated object immediately gets a
refcount of 1 (before it's even passed to AddScriptRunner). This avoids
several potential footguns that otherwise exist with a zero-refcount
freshly-allocated object.
It also makes the ownership-transfer semantics more clear
(via the already_AddRefed type that it produces) - AddScriptRunner is taking
ownership of the object, rather than using it temporarily while the caller
maintains ownership.
Differential Revision: https://phabricator.services.mozilla.com/D299039
Bug 2024039 excluded the random_*.{c,h} files from vendoring on the
basis that they're dead code (the .c files aren't compiled, and
generate_hash_secret_salt is stubbed by 03_dont_generate_salt.patch).
That broke the Windows ccov build because xmlparse.c's _WIN32-gated
#include of random_rand_s.h still fires at file scope.
Extend 03_dont_generate_salt.patch to wrap the random_*.h #include
block in #if 0 too. This keeps the random_*.{c,h} exclusion (no
misleading code-coverage data on dead source) while making the
exclusion safe on every platform: the #include never fires, so the
header doesn't have to exist.
Differential Revision: https://phabricator.services.mozilla.com/D296736
Upstream deprecated XML_SetHashSalt in libexpat 2.8.0 (CVE-2026-41080)
because it only carries 4-8 bytes of entropy into what is a 128-bit
SipHash salt. Switch to XML_SetHashSalt16Bytes, which takes a full
16 bytes, and feed it with GenerateRandomBytesFromOS. Also drop the
now-unused MOZ_XML_SetHashSalt wrapper and update the comments in
03_dont_generate_salt.patch to match.
The wrapper takes const char[16] rather than const uint8_t[16] so the
buffer can be transferred through RLBox's sandbox boundary, which only
permits memcpy of char/short/wchar_t/char16_t/float/double.
Differential Revision: https://phabricator.services.mozilla.com/D296437
Also exclude the new upstream random_*.c/h entropy helper files, which
are unused in our build (we set our own hash salt via XML_SetHashSalt).
03_dont_generate_salt.patch was updated to account for upstream refactoring
generate_hash_secret_salt() to return struct sipkey and starting to call
ENTROPY_DEBUG() from outside it (in the XML_SetHashSalt paths). The patch
now stubs ENTROPY_DEBUG's body rather than #if-0ing the whole function,
and wraps the relocated entropy helpers accordingly. In both functions
the live code ((void)label; and abort() respectively) is placed above
the #if 0 block rather than inside a #else branch, so the actual behavior
is immediately visible.
Differential Revision: https://phabricator.services.mozilla.com/D296436