Repository navigation
Don't set force async to false in Fragment scripting mode - #13080
Merged
Merged
Conversation
Member
AI reviewReviewed at a609700, together with wpt#63708 at 6d1f7668. The change is correct and minimal. Only the Fragment scripting mode is affected; document parsing,
Per spec, a default policy's Suggestions
|
noamr
force-pushed
the
noamr/fragment-force-async
branch
from
October 16, 2026 15:25
a609700 to
9b897a3
Compare
Contributor
Author
Addressed suggestions and WPT issues. |
Member
AI reviewReviewed at 9b897a3, together with web-platform-tests/wpt#63708 at f4018416. The spec side looks good, and lint and the build pass:
Blockers
{
const id = new URL(document.currentScript.src).searchParams.get('id');
if (id === String(window.current_test_id)) {
window.events.push('slow');
window.on_slow?.();
}
} |
Contributor
Author
Fixed the WPT issue. |
5 of 6 tasks
zcorpan
approved these changes
Oct 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the
Fragmentscripting mode (used bycreateContextualFragment(),setHTMLUnsafe()and the positional*HTMLUnsafe()methods withrunScripts: true, andinnerHTML/outerHTML/insertAdjacentHTML()when a Trusted Types default policy enablesrunScripts), the HTML parser does not set thescriptelement'sparser document. Previously, it still setforce asyncto false, and becauseprepare the script elementonly resetsforce asyncto true whenparser documentis non-null, external scripts withoutasynckeptforce asyncset to false once inserted.All three browser engines (Chromium, Gecko, and WebKit) instead leave
force asyncas true in this case (script.asyncreturnstruebefore insertion, and external scripts withoutasyncexecute as async once inserted).Only set
force asyncto false in#scriptTagwhenscripting modeis notFragment(i.e., whenparser documentis set).Fixes #13079.
(See WHATWG Working Mode: Changes for more details.)
/parsing.html ( diff )
/scripting.html ( diff )