Repository navigation
Commit 9547fbf
Tie queued tasks to document lifetime
Track document destruction explicitly instead of deleting window.document and clearing its DOM during window.close(). Preserve DOM access through retained references while preventing new script execution, subresource loading, timers, and animation frames in destroyed documents. Continue rejecting XHR open() and send() after document destruction.
Associate queued events and navigation work with their documents, discarding tasks after destruction. Element tasks use their relevant global's associated document, including after adoption. Keep window.stop() limited to stopping requests rather than discarding unrelated tasks.
Destroy descendant documents inside shadow trees as well as ordinary child frames. Mark destruction before aborting requests so abort listeners can safely reenter window.close().
Separate internal document loading completion from the public load event so a child that removes itself during loading does not leave its parent waiting forever. Preserve completion of already-running algorithms: external scripts still fire load after execution or cleanup microtasks remove their iframe, and FileReader still fires loadend after a load listener removes its iframe. Cover these specified completion rules with WPTs despite differences between browser engines.
Store the associated DocumentImpl directly on windows and expose its wrapper through the public document getter. Document destruction remains distinct from window.closed and from a document not being fully active; task sources and suspension/resumption of inactive documents remain unimplemented.
Co-authored-by: codex <[email protected]>1 parent 3be65d9 commit 9547fbf
44 files changed
Lines changed: 688 additions & 186 deletions
File tree
- benchmark/dom
- lib
- jsdom
- browser
- resources
- living
- custom-elements
- domparsing
- events
- file-api
- helpers
- nodes
- range
- selection
- websockets
- webstorage
- window
- xhr
- test
- api
- web-platform-tests
- to-upstream
- FileAPI/reading-data-section
- html
- browsers/the-window-object
- resources
- semantics
- embedded-content/media-elements
- scripting-1/the-script-element
- webappapis/scripting/processing-model
- selection
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 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
127 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
128 | 129 | | |
129 | 130 | | |
130 | 131 | | |
131 | 132 | | |
132 | 133 | | |
133 | 134 | | |
134 | 135 | | |
135 | | - | |
136 | | - | |
| 136 | + | |
| 137 | + | |
137 | 138 | | |
138 | 139 | | |
139 | | - | |
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
198 | | - | |
| 198 | + | |
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
213 | | - | |
| 213 | + | |
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
218 | | - | |
219 | | - | |
| 218 | + | |
| 219 | + | |
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
| |||
373 | 373 | | |
374 | 374 | | |
375 | 375 | | |
376 | | - | |
| 376 | + | |
377 | 377 | | |
378 | 378 | | |
379 | 379 | | |
380 | 380 | | |
381 | 381 | | |
382 | | - | |
| 382 | + | |
383 | 383 | | |
384 | 384 | | |
385 | 385 | | |
386 | 386 | | |
387 | 387 | | |
388 | 388 | | |
389 | | - | |
| 389 | + | |
390 | 390 | | |
391 | 391 | | |
392 | 392 | | |
| |||
422 | 422 | | |
423 | 423 | | |
424 | 424 | | |
425 | | - | |
| 425 | + | |
426 | 426 | | |
427 | 427 | | |
428 | 428 | | |
| |||
432 | 432 | | |
433 | 433 | | |
434 | 434 | | |
435 | | - | |
| 435 | + | |
436 | 436 | | |
437 | 437 | | |
438 | 438 | | |
| |||
534 | 534 | | |
535 | 535 | | |
536 | 536 | | |
537 | | - | |
538 | | - | |
| 537 | + | |
| 538 | + | |
539 | 539 | | |
540 | 540 | | |
541 | 541 | | |
| |||
605 | 605 | | |
606 | 606 | | |
607 | 607 | | |
608 | | - | |
| 608 | + | |
609 | 609 | | |
610 | 610 | | |
611 | 611 | | |
| |||
683 | 683 | | |
684 | 684 | | |
685 | 685 | | |
686 | | - | |
687 | 686 | | |
688 | 687 | | |
689 | | - | |
| 688 | + | |
690 | 689 | | |
691 | 690 | | |
692 | | - | |
| 691 | + | |
693 | 692 | | |
694 | 693 | | |
695 | | - | |
| 694 | + | |
696 | 695 | | |
697 | | - | |
| 696 | + | |
698 | 697 | | |
699 | | - | |
| 698 | + | |
700 | 699 | | |
701 | 700 | | |
702 | 701 | | |
| |||
713 | 712 | | |
714 | 713 | | |
715 | 714 | | |
716 | | - | |
717 | 715 | | |
718 | 716 | | |
719 | | - | |
| 717 | + | |
720 | 718 | | |
721 | 719 | | |
722 | | - | |
| 720 | + | |
723 | 721 | | |
724 | 722 | | |
725 | | - | |
| 723 | + | |
726 | 724 | | |
727 | 725 | | |
728 | 726 | | |
| |||
739 | 737 | | |
740 | 738 | | |
741 | 739 | | |
742 | | - | |
743 | | - | |
| 740 | + | |
744 | 741 | | |
745 | 742 | | |
746 | | - | |
| 743 | + | |
747 | 744 | | |
748 | 745 | | |
749 | | - | |
| 746 | + | |
750 | 747 | | |
751 | 748 | | |
752 | 749 | | |
| |||
783 | 780 | | |
784 | 781 | | |
785 | 782 | | |
786 | | - | |
| 783 | + | |
787 | 784 | | |
788 | 785 | | |
789 | 786 | | |
| |||
793 | 790 | | |
794 | 791 | | |
795 | 792 | | |
796 | | - | |
| 793 | + | |
797 | 794 | | |
798 | | - | |
| 795 | + | |
799 | 796 | | |
800 | 797 | | |
801 | 798 | | |
| |||
823 | 820 | | |
824 | 821 | | |
825 | 822 | | |
826 | | - | |
| 823 | + | |
827 | 824 | | |
828 | 825 | | |
829 | 826 | | |
830 | 827 | | |
831 | 828 | | |
832 | 829 | | |
833 | | - | |
834 | | - | |
835 | | - | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
836 | 844 | | |
837 | 845 | | |
838 | 846 | | |
| |||
844 | 852 | | |
845 | 853 | | |
846 | 854 | | |
847 | | - | |
848 | | - | |
849 | | - | |
850 | | - | |
851 | | - | |
852 | | - | |
853 | | - | |
854 | | - | |
855 | | - | |
856 | | - | |
857 | | - | |
858 | | - | |
859 | | - | |
860 | | - | |
861 | | - | |
862 | | - | |
863 | | - | |
| 855 | + | |
| 856 | + | |
864 | 857 | | |
865 | 858 | | |
866 | 859 | | |
| |||
887 | 880 | | |
888 | 881 | | |
889 | 882 | | |
890 | | - | |
| 883 | + | |
891 | 884 | | |
892 | 885 | | |
893 | 886 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| |||
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
45 | | - | |
| 47 | + | |
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
| |||
63 | 65 | | |
64 | 66 | | |
65 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
66 | 71 | | |
67 | 72 | | |
68 | 73 | | |
| |||
82 | 87 | | |
83 | 88 | | |
84 | 89 | | |
85 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
86 | 96 | | |
87 | 97 | | |
88 | 98 | | |
| |||
0 commit comments