-
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
document.open() simplifications: realm creation, unloading, tasks removal #3918
Conversation
Based on the work by Anne van Kesteren in whatwg#3651, but without the parts concerning the session history. Changes to that area will come later (see whatwg#3818). Tests: web-platform-tests/wpt#10773 Tests: web-platform-tests/wpt#10778 Tests: web-platform-tests/wpt#10815 Tests: web-platform-tests/wpt#10818 Fixes whatwg#1698. Fixes whatwg#3286. Fixes whatwg#3306. Closes whatwg#3665. Co-authored-by: Anne van Kesteren <[email protected]>
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.
We should update the commit message to reflect that this removes a few separate pieces:
- Realm creation
- Task removal
- Unloading
As discussed in person, there's also some other stuff to remove that references this infrastructure.
I think we'll also want a follow up bug (one may already exist?) on specifically simplifying some stuff now that there's no longer a potential 1:many Document:Window relationship, but I'm forgetting the details of how that worked right now... Will try to recall.
@@ -76876,14 +76876,11 @@ dictionary <dfn>DragEventInit</dfn> : <span>MouseEventInit</span> { | |||
|
|||
<p class="note">In general, there is a 1-to-1 mapping from the <code>Window</code> object to the | |||
<code>Document</code> object, as long as the <code>Document</code> object has a <span | |||
data-x="concept-document-bc">browsing context</span>. There are two exceptions. First, a | |||
data-x="concept-document-bc">browsing context</span>. There is one exceptions. A |
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.
\o/
It looks like the main thing is there's a lot of "document's Window object", which is an underdefined term before this PR. After this PR it can simply become "document's relevant global object". There's also a lot of "document's Window object's environment settings object" which should just become "document's relevant settings object". My method for finding these is to use Ctrl+F with the string |
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 editorially. I think I also sufficiently convinced that @bzbarsky that we should do this, but more tests (and revisions) for the entire document.open() algorithm will be needed for Firefox to take the jump.
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.
LGTM, let's merge!
Another test to update is https://github.com/web-platform-tests/wpt/blob/34b1111aaf51b0143edcc5e3b454cff680edcd6f/common/object-association.js#L44-L65. We may want to actually flip the condition instead of deleting it.
(Really enjoying these additional cleanup commits. Lots of simplifications in complex algorithms.) |
I've updated the pull request title and I believe this should be ready to merge! I will continue working on the WPT PRs to ensure they are merged. On the bugs side, I plan on filing a mega-bug for both Edge and Firefox containing this change and some future PRs. As such I don't plan to file a bug for this PR specifically. As states before this PR does not require bugs on Chrome or Safari. |
For whatwg/html#3918. Several tests were removed as they no longer apply after the change in HTML. The expectations were reversed and moved to the new no-new-global.window.js file. Co-authored-by: Timothy Gu <[email protected]>
…nt, a=testonly Automatic update from web-platform-testsHTML: document.open() and the unload events (#10773) For whatwg/html#3918. -- wpt-commits: 23c21d2e0e6a8035ddfab91e33c54103d859ffca wpt-pr: 10773
…ad event, a=testonly Automatic update from web-platform-testsHTML: document.open() and the beforeunload event (#10778) For whatwg/html#3918. -- wpt-commits: eafe4bdb65ced7352e953ec35c06c3afa3d8125b wpt-pr: 10778
…es, a=testonly Automatic update from web-platform-testsHTML: document.open() and global variables (#10815) For whatwg/html#3918. Several tests were removed as they no longer apply after the change in HTML. The expectations were reversed and moved to the new no-new-global.window.js file. Co-authored-by: Timothy Gu <[email protected]> -- wpt-commits: 70c15a6e508f7460e1584bc8b122ac2cc8f9d6ea wpt-pr: 10815
For whatwg/html#3918. Several tests were removed as they no longer apply after the change in HTML. The expectations were reversed and moved to the new no-new-global.window.js file. Co-authored-by: Timothy Gu <[email protected]>
Automatic update from web-platform-testsHTML: document.open() and tasks (#10818) For whatwg/html#3918. -- wpt-commits: 87329a1500b1aea8f9cf28b40afb08491e25a5c7 wpt-pr: 10818
Automatic update from web-platform-testsHTML: document.open() and tasks (#10818) For whatwg/html#3918. -- wpt-commits: 87329a1500b1aea8f9cf28b40afb08491e25a5c7 wpt-pr: 10818
…ation, a=testonly Automatic update from web-platform-testsHTML: Change document.open() test expectation (#12882) For whatwg/html#3918. -- wpt-commits: b70ac6309528aacacfaec186478d0b30b018b8f9 wpt-pr: 12882
…ation, a=testonly Automatic update from web-platform-testsHTML: Change document.open() test expectation (#12882) For whatwg/html#3918. -- wpt-commits: b70ac6309528aacacfaec186478d0b30b018b8f9 wpt-pr: 12882
…nt, a=testonly Automatic update from web-platform-testsHTML: document.open() and the unload events (#10773) For whatwg/html#3918. -- wpt-commits: 23c21d2e0e6a8035ddfab91e33c54103d859ffca wpt-pr: 10773 UltraBlame original commit: 7a308e5f78c2792c423ec0b5d7e6d6bbafdf230a
…ad event, a=testonly Automatic update from web-platform-testsHTML: document.open() and the beforeunload event (#10778) For whatwg/html#3918. -- wpt-commits: eafe4bdb65ced7352e953ec35c06c3afa3d8125b wpt-pr: 10778 UltraBlame original commit: 5e452420d498274a79b91e9a7281f83202066a95
…es, a=testonly Automatic update from web-platform-testsHTML: document.open() and global variables (#10815) For whatwg/html#3918. Several tests were removed as they no longer apply after the change in HTML. The expectations were reversed and moved to the new no-new-global.window.js file. Co-authored-by: Timothy Gu <timothygu99gmail.com> -- wpt-commits: 70c15a6e508f7460e1584bc8b122ac2cc8f9d6ea wpt-pr: 10815 UltraBlame original commit: bff723cc3832cb0b00fa13a8494ee3aa3bfe74fa
Automatic update from web-platform-testsHTML: document.open() and tasks (#10818) For whatwg/html#3918. -- wpt-commits: 87329a1500b1aea8f9cf28b40afb08491e25a5c7 wpt-pr: 10818 UltraBlame original commit: 06c73a2328c73684f20a24c38a53756f028d66f8
…nt, a=testonly Automatic update from web-platform-testsHTML: document.open() and the unload events (#10773) For whatwg/html#3918. -- wpt-commits: 23c21d2e0e6a8035ddfab91e33c54103d859ffca wpt-pr: 10773 UltraBlame original commit: 7a308e5f78c2792c423ec0b5d7e6d6bbafdf230a
…ad event, a=testonly Automatic update from web-platform-testsHTML: document.open() and the beforeunload event (#10778) For whatwg/html#3918. -- wpt-commits: eafe4bdb65ced7352e953ec35c06c3afa3d8125b wpt-pr: 10778 UltraBlame original commit: 5e452420d498274a79b91e9a7281f83202066a95
…es, a=testonly Automatic update from web-platform-testsHTML: document.open() and global variables (#10815) For whatwg/html#3918. Several tests were removed as they no longer apply after the change in HTML. The expectations were reversed and moved to the new no-new-global.window.js file. Co-authored-by: Timothy Gu <timothygu99gmail.com> -- wpt-commits: 70c15a6e508f7460e1584bc8b122ac2cc8f9d6ea wpt-pr: 10815 UltraBlame original commit: bff723cc3832cb0b00fa13a8494ee3aa3bfe74fa
Automatic update from web-platform-testsHTML: document.open() and tasks (#10818) For whatwg/html#3918. -- wpt-commits: 87329a1500b1aea8f9cf28b40afb08491e25a5c7 wpt-pr: 10818 UltraBlame original commit: 06c73a2328c73684f20a24c38a53756f028d66f8
…ation, a=testonly Automatic update from web-platform-testsHTML: Change document.open() test expectation (#12882) For whatwg/html#3918. -- wpt-commits: b70ac6309528aacacfaec186478d0b30b018b8f9 wpt-pr: 12882 UltraBlame original commit: 1f8523944744f115d66ce06088ab103a2c4d6738
…ation, a=testonly Automatic update from web-platform-testsHTML: Change document.open() test expectation (#12882) For whatwg/html#3918. -- wpt-commits: b70ac6309528aacacfaec186478d0b30b018b8f9 wpt-pr: 12882 UltraBlame original commit: 1f8523944744f115d66ce06088ab103a2c4d6738
…nt, a=testonly Automatic update from web-platform-testsHTML: document.open() and the unload events (#10773) For whatwg/html#3918. -- wpt-commits: 23c21d2e0e6a8035ddfab91e33c54103d859ffca wpt-pr: 10773 UltraBlame original commit: 7a308e5f78c2792c423ec0b5d7e6d6bbafdf230a
…ad event, a=testonly Automatic update from web-platform-testsHTML: document.open() and the beforeunload event (#10778) For whatwg/html#3918. -- wpt-commits: eafe4bdb65ced7352e953ec35c06c3afa3d8125b wpt-pr: 10778 UltraBlame original commit: 5e452420d498274a79b91e9a7281f83202066a95
…es, a=testonly Automatic update from web-platform-testsHTML: document.open() and global variables (#10815) For whatwg/html#3918. Several tests were removed as they no longer apply after the change in HTML. The expectations were reversed and moved to the new no-new-global.window.js file. Co-authored-by: Timothy Gu <timothygu99gmail.com> -- wpt-commits: 70c15a6e508f7460e1584bc8b122ac2cc8f9d6ea wpt-pr: 10815 UltraBlame original commit: bff723cc3832cb0b00fa13a8494ee3aa3bfe74fa
Automatic update from web-platform-testsHTML: document.open() and tasks (#10818) For whatwg/html#3918. -- wpt-commits: 87329a1500b1aea8f9cf28b40afb08491e25a5c7 wpt-pr: 10818 UltraBlame original commit: 06c73a2328c73684f20a24c38a53756f028d66f8
…ation, a=testonly Automatic update from web-platform-testsHTML: Change document.open() test expectation (#12882) For whatwg/html#3918. -- wpt-commits: b70ac6309528aacacfaec186478d0b30b018b8f9 wpt-pr: 12882 UltraBlame original commit: 1f8523944744f115d66ce06088ab103a2c4d6738
Based on the work by Anne van Kesteren in #3651, but without the parts concerning the session history. Changes to that area will come later (see #3818).
Summary of implementation changes:
beforeunload
event indocument.open()
(but notpagehide
orunload
). It should no longer fire it after this PR.Tests: web-platform-tests/wpt#10773
Tests: web-platform-tests/wpt#10778
Tests: web-platform-tests/wpt#10815
Tests: web-platform-tests/wpt#10818
Fixes #1698.
Fixes #3286.
Fixes #3306.
Closes #3665.
/cc @bzbarsky @daniec @foolip @travisleithead
/browsers.html ( diff )
/browsing-the-web.html ( diff )
/dynamic-markup-insertion.html ( diff )
/history.html ( diff )
/window-object.html ( diff )