-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
HTML: document.open() and global variables #10815
HTML: document.open() and global variables #10815
Conversation
(Marked "do not merge yet" as this requires a change in the HTML Standard to not allocate a new global. Appreciate the review though!) |
3b06a0c
to
f3ed415
Compare
assert_equals(frame.contentWindow.hey, "You", "precondition"); | ||
frame.contentDocument.open(); | ||
assert_equals(frame.contentWindow.hey, "You", "actual check"); | ||
// Ensure a load event gets dispatched to unblock testharness |
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.
This test fails in Firefox, so this line wasn't reached and yet testharness wasn't blocked waiting for the load event. If this is just defensive coding, maybe put it in a cleanup step before the assert still?
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.
That's because of the cleanup step I added earlier in the test with frame.remove()
. I could remove this.
|
||
testIdentity("Document", frame => frame.contentDocument, frame => frame.contentWindow.Document); | ||
testIdentity("WindowProxy", frame => frame.contentWindow, frame => frame.contentWindow.Window); | ||
testIdentity("Navigator", frame => frame.contentWindow.navigator, frame => frame.contentWindow.Navigator); |
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.
There's something a bit special about Location as well, see whatwg/html#2545. Are there any tests for Location that would make sense here?
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.
Sure.
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#10789 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 <annevk@annevk.nl>
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 <annevk@annevk.nl>
f3ed415
to
2e483da
Compare
Thanks @TimothyGu ! |
In particular, removes the realm creation, document unloading, and tasks removal steps. 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). These changes allow us to remove several auxiliary concepts that only existed to support document.open(): - The recycle parameter to the "unload a Document" algorithm - The window parameter to the "set the active document" algorithm 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.
Its removal should be in tasks
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 <timothygu99@gmail.com>
In particular, removes the realm creation, document unloading, and tasks removal steps. 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). These changes allow us to remove several auxiliary concepts that only existed to support document.open(): - The recycle parameter to the "unload a Document" algorithm - The window parameter to the "set the active document" algorithm 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.
In particular, removes the realm creation, document unloading, and tasks removal steps. 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). These changes allow us to remove several auxiliary concepts that only existed to support document.open(): - The recycle parameter to the "unload a Document" algorithm - The window parameter to the "set the active document" algorithm 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.
For whatwg/html#3918.