Conversation
Replace the per-document resource loader, request manager, and generic resource queues with document-scoped cancellation and load-event delays. Fetch subresources through the dispatcher and let each element own its processing and events, instead of serializing unrelated images, stylesheets, and frames behind scripts. Implement the force-async flag and ordered dynamic scripts, capture inline source and the preparation-time document, and queue errors for empty or invalid script URLs. Suppress execution of prepared scripts whose node document no longer matches their preparation-time document, while allowing scripts moved back before execution. Ignore destructive external-script document.write() calls when there is no parser insertion point. Separate internal parsing completion from document.close(), which only finishes a script-created parser. Avoid replaying readiness and load events on repeated close calls. Deliver iframe load when its document finishes loading, including after document.open() during DOMContentLoaded, and suppress recursive iframe load events when reopening from an iframe load handler. Abort pending subresource and XHR requests in descendant documents when stopping a window, without firing resource completion events for canceled requests. Suppress pending parser completion events after abort. Give subsequent requests a fresh cancellation lifetime, and preserve already-fetched ordered dynamic scripts while releasing canceled scripts from the execution order. Use explicit abort listeners until the AbortSignal.any() issue at nodejs/node#65995 is fixed in supported Node.js versions. Wait for nested stylesheet imports, ignore import cycles, and fire one event for the owning element after imports finish. Both link and style fire load even when an import fails, matching Chromium and WebKit; top-level link fetch failures still fire error. Cover the import-event behavior with a tentative WPT because HTML's critical-subresource integration remains underspecified: whatwg/html#968. Restrict script-blocking stylesheet eligibility to parser-created elements, with link eligibility determined at creation. Cancel obsolete image and stylesheet requests so late responses cannot replace newer content. The parsers still cannot pause for external scripts, so parsing-blocking scripts remain chained in parser order. Incremental document.write(), fragment-script initialization, and full VM microtask checkpoints remain incomplete. Enable upstream dynamic-markup-insertion coverage, add lifecycle WPTs and script/resource benchmarks, and run tentative to-upstream WPTs while continuing to exclude upstream tentative tests. Co-authored-by: codex <codex@openai.com>
Remove stale failure expectations for custom-element reaction ordering and DOMParser document URLs after the script and document lifecycle changes. Expect the document.open() image-error failure only when canvas is available. Without canvas, images are not loaded and the test cannot exercise the missing event-listener erasure. Record the location test's early iframe load failure and the postMessage test's timing-dependent failure. Our non-blocking parser can create and load an iframe before preceding scripts have defined its load handler. Co-authored-by: codex <codex@openai.com>
Our parser does not pause for parsing-blocking scripts, so child frames can post their results before the parent installs its message handler. Mark both affected synchronous XHR tests flaky across Node.js versions until parser blocking is implemented. Co-authored-by: codex <codex@openai.com>
Record timing-sensitive frame, image, stylesheet, and async-script tests while tokenization continues past blocking scripts. Include two expected failures that can unexpectedly pass when harness loading wins the race. Link parser dependencies to #2413, and distinguish the upstream DOMParser and script-text test races that also need test fixes. Co-authored-by: codex <codex@openai.com>
Member
Author
|
The number of tests this moves to flaky makes me hesitate. It's a result of no longer serializing all resources into a single queue. Without parser-blocking script support, that might regress jsdom users. I might hold off on merging this until we can get parser-blocking script work on top of it. |
This was referenced Sep 17, 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.
Continue jsdom's lifecycle conformance work by aligning classic-script processing and resource cancellation with HTML's document-loading model.