-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overhaul document unloading/destruction/aborting #9907
Conversation
See whatwg/html#9907 As far as I understand these changes do not fix bugs in our implementation but allows us to remove some hacks and be aligned with the spec.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I applied these changes to my implementation, it fixes the issue and haven't found any new problems yet.
See whatwg/html#9907 As far as I understand these changes do not fix bugs in our implementation but allows us to remove some hacks and be aligned with the spec.
465ce88
to
2e397f0
Compare
As noted in #9148, the way in which destroy calls abort, and unload calls destroy, is not sound when most of these algorithms act on the entire tree. Instead, we need to split these algorithms into single-document base variants, which call each other, and whole-tree "document and its descendant" variants, which proceed carefully. The whole-tree variants in particular need to take care with how they queue tasks. We cannot fire events (like unload for unloading, or readystatechange for aborting) inside of inactive documents, so we need to delay making a document inactive until its children have been processed. (The related issue #9869 around reloading is not yet solved, however, since that is a special case where the same session history entry is reused and thus making documents inactive is harder to avoid.) Closes #9148.
2e397f0
to
a49f99e
Compare
Edit: Fixed the build. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK thanks for the discussion on the two previously-open threads. LGTM.
Yeah, so the hiding of "in parallel" in the algorithm header can indeed be confusing. I'll open another issue to discuss that, since it's a potential general problem. |
As noted in #9148, the way in which destroy calls abort, and unload calls destroy, is not sound when most of these algorithms act on the entire tree. Instead, we need to split these algorithms into single-document base variants, which call each other, and whole-tree "document and its descendant" variants, which proceed carefully.
The whole-tree variants in particular need to take care with how they queue tasks. We cannot fire events (like unload for unloading, or readystatechange for aborting) inside of inactive documents, so we need to delay making a document inactive until its children have been processed. (The related issue #9869 around reloading is not yet solved, however, since that is a special case where the same session history entry is reused and thus making documents inactive is harder to avoid.)
Closes #9148. Closes #9904 while we're in the area.
@kalenikaliaksandr could you take a look? Also CC @ADKaster.
/browsing-the-web.html ( diff )
/document-lifecycle.html ( diff )
/document-sequences.html ( diff )