Repository navigation
Commit 734431c
Align classic script and resource lifecycles
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. Mark resource-timing tests that depend on parser blocking flaky, linking them to #2413, and distinguish independent upstream test races.
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 <[email protected]>1 parent 7ce7eb8 commit 734431c
63 files changed
Lines changed: 2063 additions & 950 deletions
File tree
- benchmark/dom
- lib
- jsdom
- browser
- parser
- resources
- living
- css/helpers
- helpers
- nodes
- xhr
- test
- api
- web-platform-tests
- to-upstream/html
- semantics
- document-metadata
- resources
- embedded-content/the-iframe-element
- resources
- resources
- scripting-1/the-script-element
- resources
- webappapis
- dynamic-markup-insertion/closing-the-input-stream
- resources
- scripting/processing-model
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
49 | | - | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
125 | | - | |
| 124 | + | |
126 | 125 | | |
| 126 | + | |
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
145 | 134 | | |
146 | 135 | | |
147 | 136 | | |
| |||
807 | 796 | | |
808 | 797 | | |
809 | 798 | | |
810 | | - | |
811 | | - | |
812 | | - | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
813 | 802 | | |
| 803 | + | |
814 | 804 | | |
815 | 805 | | |
816 | 806 | | |
| |||
840 | 830 | | |
841 | 831 | | |
842 | 832 | | |
843 | | - | |
| 833 | + | |
844 | 834 | | |
845 | 835 | | |
846 | 836 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
79 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
80 | 89 | | |
81 | 90 | | |
82 | 91 | | |
83 | 92 | | |
84 | 93 | | |
85 | 94 | | |
86 | 95 | | |
87 | | - | |
88 | | - | |
| 96 | + | |
| 97 | + | |
89 | 98 | | |
90 | 99 | | |
91 | 100 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
112 | 115 | | |
113 | 116 | | |
114 | 117 | | |
115 | 118 | | |
116 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
117 | 123 | | |
118 | 124 | | |
119 | 125 | | |
120 | 126 | | |
121 | 127 | | |
122 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
123 | 132 | | |
124 | 133 | | |
125 | 134 | | |
126 | 135 | | |
127 | 136 | | |
128 | 137 | | |
129 | 138 | | |
130 | | - | |
131 | | - | |
| 139 | + | |
| 140 | + | |
132 | 141 | | |
133 | 142 | | |
134 | 143 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
732 | 733 | | |
733 | 734 | | |
734 | 735 | | |
735 | | - | |
| 736 | + | |
736 | 737 | | |
737 | 738 | | |
738 | 739 | | |
| |||
747 | 748 | | |
748 | 749 | | |
749 | 750 | | |
750 | | - | |
| 751 | + | |
751 | 752 | | |
752 | 753 | | |
753 | 754 | | |
| |||
0 commit comments