Skip to content

Conversation

@TimothyGu
Copy link
Member

@TimothyGu TimothyGu commented Aug 14, 2018

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:

  • Chrome and Safari are already fully aligned with this change.
  • Edge and Firefox both create a new JavaScript realm. They should not do that after this PR.
  • Edge and Firefox removes some tasks but not others (see No longer remove tasks for document.open() #3665). They should now remove no tasks after this PR.
  • Firefox fires beforeunload event in document.open() (but not pagehide or unload). 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 )

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]>
Copy link
Member

@domenic domenic left a 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.

<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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\o/

@domenic
Copy link
Member

domenic commented Aug 14, 2018

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.

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 's Window on the page.

Copy link
Member

@annevk annevk left a 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.

Copy link
Member

@domenic domenic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@annevk
Copy link
Member

annevk commented Aug 16, 2018

(Really enjoying these additional cleanup commits. Lots of simplifications in complex algorithms.)

@TimothyGu TimothyGu changed the title Remove document.open() realm creation Remove document.open() realm creation, unloading, and tasks removal Aug 16, 2018
@TimothyGu TimothyGu changed the title Remove document.open() realm creation, unloading, and tasks removal document.open() simplifications: realm creation, unloading, tasks removal Aug 16, 2018
@TimothyGu
Copy link
Member Author

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.

@domenic domenic merged commit 6f769b8 into whatwg:master Aug 16, 2018
TimothyGu pushed a commit to web-platform-tests/wpt that referenced this pull request Aug 17, 2018
@TimothyGu TimothyGu deleted the document-open-realms branch August 17, 2018 14:06
TimothyGu pushed a commit to web-platform-tests/wpt that referenced this pull request Aug 17, 2018
TimothyGu added a commit to web-platform-tests/wpt that referenced this pull request Aug 17, 2018
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]>
TimothyGu pushed a commit to web-platform-tests/wpt that referenced this pull request Aug 20, 2018
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Aug 23, 2018
…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
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Aug 23, 2018
…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
jankeromnes pushed a commit to jankeromnes/gecko that referenced this pull request Aug 23, 2018
…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
zcorpan pushed a commit to web-platform-tests/wpt that referenced this pull request Aug 27, 2018
zcorpan pushed a commit to web-platform-tests/wpt that referenced this pull request Aug 27, 2018
zcorpan pushed a commit to web-platform-tests/wpt that referenced this pull request Aug 27, 2018
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]>
zcorpan pushed a commit to web-platform-tests/wpt that referenced this pull request Aug 27, 2018
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Aug 29, 2018
Automatic update from web-platform-testsHTML: document.open() and tasks (#10818)

For whatwg/html#3918.
--

wpt-commits: 87329a1500b1aea8f9cf28b40afb08491e25a5c7
wpt-pr: 10818
jankeromnes pushed a commit to jankeromnes/gecko that referenced this pull request Aug 29, 2018
Automatic update from web-platform-testsHTML: document.open() and tasks (#10818)

For whatwg/html#3918.
--

wpt-commits: 87329a1500b1aea8f9cf28b40afb08491e25a5c7
wpt-pr: 10818
TimothyGu added a commit to web-platform-tests/wpt that referenced this pull request Sep 6, 2018
TimothyGu added a commit to web-platform-tests/wpt that referenced this pull request Sep 6, 2018
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Sep 12, 2018
…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
jankeromnes pushed a commit to jankeromnes/gecko that referenced this pull request Sep 12, 2018
…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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Oct 3, 2019
…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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Oct 3, 2019
…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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Oct 3, 2019
…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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Oct 3, 2019
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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Oct 3, 2019
…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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Oct 3, 2019
…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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Oct 3, 2019
…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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Oct 3, 2019
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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Oct 3, 2019
…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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Oct 3, 2019
…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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Oct 3, 2019
…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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Oct 3, 2019
…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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Oct 3, 2019
…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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Oct 3, 2019
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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Oct 3, 2019
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants