[wpt-sync] Sync PR 63370 - Do not synchronously fire speculation rules error events on base changes
Categories
(Core :: DOM: Core & HTML, task, P4)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox160 | --- | fixed |
People
(Reporter: wpt-sync, Unassigned)
References
()
Details
(Whiteboard: [wptsync downstream])
Attachments
(1 file)
|
172.72 KB,
text/plain
|
Details |
Sync web-platform-tests PR 63370 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/63370
Details from upstream follow.
Joey Arhar <jarhar@chromium.org> wrote:
Do not synchronously fire speculation rules error events on base changes
When a \<base> element is inserted, removed, or has its href attribute
modified, Document::ProcessBaseElement() updates the document's base URL
and notifies ScriptLoader::DocumentBaseURLChanged(). If the document
contains an invalid \<script type="speculationrules">, reparsing it in
ScriptLoader::AddSpeculationRuleSet() synchronously dispatches error
events on the script element and window, running script while
EventDispatchForbiddenScope is active during DOM insertion, removal, or
attribute cloning.Fix this by:
- Checking isConnected() in HTMLBaseElement::ParseAttribute() so
modifying or cloning attributes on a disconnected \<base> element does
not call Document::ProcessBaseElement().- Returning early in ScriptLoader::DocumentBaseURLChanged() if the
speculation rule set failed to parse, since top-level parse errors do
not depend on the base URL.Bug: 568730794
Change-Id: Ib0167ae383b089c7548befb797b674212dca1479
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8508876
Commit-Queue: Joey Arhar \<jarhar@chromium.org>
Reviewed-by: David Baron \<dbaron@chromium.org>
Reviewed-by: Joey Arhar \<jarhar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1713725}
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Comment 1•1 month ago
|
||
Pushed to try (stability) https://treeherder.mozilla.org/jobs?repo=try&landoInstance=lando-prod-2025&landoCommitID=102017
| Assignee | ||
Comment 2•1 month ago
|
||
CI Results
Ran 11 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI
Total 537 tests and 8 subtests
Status Summary
Firefox
OK : 238[Gecko-linux2404-64-debug, Gecko-linux2404-64-opt] 239[Gecko-windows11-32-25h2-opt] 240[Gecko-windows11-32-25h2-debug, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt] 242[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview]
PASS : 1[GitHub] 2[Gecko-linux2204-64-wayland-debug, Gecko-linux2204-64-wayland-opt] 143[Gecko-windows11-32-25h2-opt] 144[Gecko-windows11-64-25h2-opt] 146[Gecko-windows11-64-25h2-debug] 148[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-linux2404-64-opt] 150[Gecko-linux2404-64-debug] 151[Gecko-windows11-32-25h2-debug] 152[Gecko-android-em-14-x86_64-lite-opt-geckoview] 153[Gecko-android-em-14-x86_64-opt-geckoview]
FAIL : 224[Gecko-linux2404-64-debug] 225[Gecko-android-em-14-x86_64-opt-geckoview, Gecko-windows11-32-25h2-debug] 226[Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-linux2404-64-opt] 230[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-windows11-64-25h2-debug] 232[Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-opt]
TIMEOUT: 2
ERROR : 289
NOTRUN : 2
Chrome
CRASH : 2
Safari
OK : 1
PASS : 2
Links
Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base
Details
(See attachment for full changes)
Comment 4•1 month ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/9cb218981ca2
https://hg.mozilla.org/mozilla-central/rev/cbefa9711489
Description
•