-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Tracking issue for document.open() overhaul #3818
Comments
@bzbarsky you probably want to review the above. With Ben leaving I suspect there's nobody else at the moment with a somewhat active interest in this? |
Well, @hsivonen might have thoughts. And maybe @mystor, maybe. Are you sure @wanderview is not still interested? ;) I'm not quite clear on the event listeners thing. Firefox doesn't remove them from the old Window but does create a new Window, right? So the only way to trigger the listeners on the old Window is ... I'm not even quite sure what, actually. |
Yeah. That is precisely my point: if we can't trigger listeners on the old |
Even with synthetic events... what would you fire them at, exactly? |
@bzbarsky The <script>
window.addEventListener("myEvent", () => { parent.fired = true; });
document.open();
window.dispatchEvent(new Event("myEvent"));
</script> in an iframe. But the bigger issue here seems to be that Firefox doesn't remove event listeners – on anything, not just the |
Here "window" is the windowproxy, so would dispatch to the new window. Though it's possible that bareword
Yeah. We should probably change that... |
FWIW, I'm interested but probably unable to help much in the near future. Ramping up on other tasks, etc. |
This change aligns the event listener removal behavior with implementations, specifically in two aspects: - The event handler's value should be set to null (i.e., deactivated). - Event listeners and handlers should be removed from the Window object as well. See prior investigation around deactivation of event handlers in whatwg#3836 and whatwg#3850. See investigation around `document.open()`'s behavior in whatwg#3818. Tests: web-platform-tests/wpt#12122
This change aligns the event listener removal behavior with implementations, specifically in two aspects: - The event handler's value should be set to null (i.e., deactivated). - Event listeners and handlers should be removed from the Window object as well. See prior investigation around deactivation of event handlers in #3836 and #3850. See investigation around document.open()'s behavior in #3818. Tests: web-platform-tests/wpt#12122
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>
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.
This behavior is only implemented in Firefox and Edge and has contributed to developer confusion. See https://bugzilla.mozilla.org/show_bug.cgi?id=556002. This is a part of the effort to renovate document.open(). See whatwg#3818 for context.
This behavior is only implemented in Firefox and Edge and has contributed to developer confusion. See https://bugzilla.mozilla.org/show_bug.cgi?id=556002. This is a part of the effort to renovate document.open(). See whatwg#3818 for context.
Or: document.open() simplifications, part 2.1. This behavior is only implemented in Firefox and Edge and has contributed to developer confusion. See https://bugzilla.mozilla.org/show_bug.cgi?id=556002. This is a part of the effort to renovate document.open(). See whatwg#3818 for context.
Or: document.open() simplifications, part 1.9. This behavior is only implemented in Firefox and Edge and has contributed to developer confusion. See https://bugzilla.mozilla.org/show_bug.cgi?id=556002. This is a part of the effort to renovate document.open(). See whatwg#3818 for context.
Or: document.open() simplifications, part 1.9. This behavior is only implemented in Firefox and Edge and has contributed to developer confusion. See https://bugzilla.mozilla.org/show_bug.cgi?id=556002. This is a part of the effort to renovate document.open(). See whatwg#3818 for context. Tests: web-platform-tests/wpt#12555
Or: document.open() simplifications, part 1.9. This behavior is only implemented in Firefox and Edge and has contributed to developer confusion. See https://bugzilla.mozilla.org/show_bug.cgi?id=556002. This is a part of the effort to renovate document.open(). See #3818 for context. Tests: web-platform-tests/wpt#12555
A continuation of #12240, but this treats cases when two bailout criteria compete against each other. See whatwg/html#3818.
A continuation of #12240, but this treats cases when two bailout criteria compete against each other. See whatwg/html#3818.
Per investigation in whatwg#3818, this change aligns the behavior of document.open() with Chrome and Safari. Tests: web-platform-tests/wpt#10679
Per investigation in #3818, this change aligns the behavior of document.open() with Chrome and Safari. Tests: web-platform-tests/wpt#10679. Closes #3831.
This is another part of the effort to overhaul document.open() as outlined in #3818. Tests: web-platform-tests/wpt#10817. Fixes #2555.
…ut order, a=testonly Automatic update from web-platform-testsHTML: more tests for document.open bailout order (#12645) A continuation of web-platform-tests/wpt#12240, but this treats cases when two bailout criteria compete against each other. See whatwg/html#3818. -- wpt-commits: 45d82ab6c8893eab5a8f50aedfc20af81679cb10 wpt-pr: 12645
…ut order, a=testonly Automatic update from web-platform-testsHTML: more tests for document.open bailout order (#12645) A continuation of web-platform-tests/wpt#12240, but this treats cases when two bailout criteria compete against each other. See whatwg/html#3818. -- wpt-commits: 45d82ab6c8893eab5a8f50aedfc20af81679cb10 wpt-pr: 12645
See investigation in whatwg#3818. Tests: web-platform-tests/wpt#10789
With all the checkboxes checked and relevant PRs merged, and bugs filed:
… it's time for me to close this out :) |
…utationObserver, a=testonly Automatic update from web-platform-testsHTML: Add test for document.open() and MutationObserver (#12879) For whatwg/html#3818. -- wpt-commits: cf0ea11ebe5801798d0390f7747b056110f74ed9 wpt-pr: 12879
…utationObserver, a=testonly Automatic update from web-platform-testsHTML: Add test for document.open() and MutationObserver (#12879) For whatwg/html#3818. -- wpt-commits: cf0ea11ebe5801798d0390f7747b056110f74ed9 wpt-pr: 12879
This change aligns the event listener removal behavior with implementations, specifically in two aspects: - The event handler's value should be set to null (i.e., deactivated). - Event listeners and handlers should be removed from the Window object as well. See prior investigation around deactivation of event handlers in whatwg#3836 and whatwg#3850. See investigation around document.open()'s behavior in whatwg#3818. Tests: web-platform-tests/wpt#12122
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.
Or: document.open() simplifications, part 1.9. This behavior is only implemented in Firefox and Edge and has contributed to developer confusion. See https://bugzilla.mozilla.org/show_bug.cgi?id=556002. This is a part of the effort to renovate document.open(). See whatwg#3818 for context. Tests: web-platform-tests/wpt#12555
Per investigation in whatwg#3818, this change aligns the behavior of document.open() with Chrome and Safari. Tests: web-platform-tests/wpt#10679. Closes whatwg#3831.
This is another part of the effort to overhaul document.open() as outlined in whatwg#3818. Tests: web-platform-tests/wpt#10817. Fixes whatwg#2555.
This change aligns the event listener removal behavior with implementations, specifically in two aspects: - The event handler's value should be set to null (i.e., deactivated). - Event listeners and handlers should be removed from the Window object as well. See prior investigation around deactivation of event handlers in whatwg#3836 and whatwg#3850. See investigation around document.open()'s behavior in whatwg#3818. Tests: web-platform-tests/wpt#12122
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.
Or: document.open() simplifications, part 1.9. This behavior is only implemented in Firefox and Edge and has contributed to developer confusion. See https://bugzilla.mozilla.org/show_bug.cgi?id=556002. This is a part of the effort to renovate document.open(). See whatwg#3818 for context. Tests: web-platform-tests/wpt#12555
Per investigation in whatwg#3818, this change aligns the behavior of document.open() with Chrome and Safari. Tests: web-platform-tests/wpt#10679. Closes whatwg#3831.
This is another part of the effort to overhaul document.open() as outlined in whatwg#3818. Tests: web-platform-tests/wpt#10817. Fixes whatwg#2555.
…ut order, a=testonly Automatic update from web-platform-testsHTML: more tests for document.open bailout order (#12645) A continuation of web-platform-tests/wpt#12240, but this treats cases when two bailout criteria compete against each other. See whatwg/html#3818. -- wpt-commits: 45d82ab6c8893eab5a8f50aedfc20af81679cb10 wpt-pr: 12645 UltraBlame original commit: 0585d2064f4944eb21522699451509fb4e682ca5
…ut order, a=testonly Automatic update from web-platform-testsHTML: more tests for document.open bailout order (#12645) A continuation of web-platform-tests/wpt#12240, but this treats cases when two bailout criteria compete against each other. See whatwg/html#3818. -- wpt-commits: 45d82ab6c8893eab5a8f50aedfc20af81679cb10 wpt-pr: 12645 UltraBlame original commit: 0585d2064f4944eb21522699451509fb4e682ca5
…utationObserver, a=testonly Automatic update from web-platform-testsHTML: Add test for document.open() and MutationObserver (#12879) For whatwg/html#3818. -- wpt-commits: cf0ea11ebe5801798d0390f7747b056110f74ed9 wpt-pr: 12879 UltraBlame original commit: 68c35ce4e842afebe390532e6a9adea75fd554ba
…utationObserver, a=testonly Automatic update from web-platform-testsHTML: Add test for document.open() and MutationObserver (#12879) For whatwg/html#3818. -- wpt-commits: cf0ea11ebe5801798d0390f7747b056110f74ed9 wpt-pr: 12879 UltraBlame original commit: 68c35ce4e842afebe390532e6a9adea75fd554ba
…ut order, a=testonly Automatic update from web-platform-testsHTML: more tests for document.open bailout order (#12645) A continuation of web-platform-tests/wpt#12240, but this treats cases when two bailout criteria compete against each other. See whatwg/html#3818. -- wpt-commits: 45d82ab6c8893eab5a8f50aedfc20af81679cb10 wpt-pr: 12645 UltraBlame original commit: 0585d2064f4944eb21522699451509fb4e682ca5
…utationObserver, a=testonly Automatic update from web-platform-testsHTML: Add test for document.open() and MutationObserver (#12879) For whatwg/html#3818. -- wpt-commits: cf0ea11ebe5801798d0390f7747b056110f74ed9 wpt-pr: 12879 UltraBlame original commit: 68c35ce4e842afebe390532e6a9adea75fd554ba
This is a list of issues that currently surround
document.open()
interoperability. The list is tentative, and will most probably be extended in the future. For items in the list without dedicated issues or pull requests, I will be filing them individually in the future if need be.The goal is for each listed issue to have extensive WPT coverage, as well as a confirmed resolution, either as a spec change or "known browser bug; will fix", or both. For now, the "resolution" present is what I believe to be the right path forward, and does not represent the final verdict.
The first checkbox represents if the resolution and tests have been completed. The second represents if the spec change has been submitted (or if it's not necessary).
Resolution: No change to spec required. There seems to be internal bugs in Chrome, Firefox, and Safari.
document
(HTML: Add checks for the return value of document.open() web-platform-tests/wpt#12359)Resolution: No change to spec required. Edge returns
null
instead currently, but making Edge returndocument
has minimal compatibility risk. Tests needed though.document.open()
from custom elements constructor (Add test for document.open() in custom element constructor web-platform-tests/wpt#12037)Resolution: Keep existing spec in alignment with Chrome and Firefox and also Safari.
There is an existing issue with Safari.document.open()
when theDocument
is being unloaded (https://crbug.com/583586, HTML: Add bailout order checks for document.open() web-platform-tests/wpt#12240, Implement ignore-opens-during-unload counter in Document web-platform-tests/wpt#12413)Resolution: Keep existing spec in alignment with Firefox and Safari. File bugs with (and fix!) Chrome and (later) Edge.
Resolution: Aim to support non-active documents, but defer until other clean-ups are done.
Resolution: No change to spec required. There seems to be a bug in Firefox and Edge.
Resolution: Strip out fragments in document URL in
document.open()
if the entry settings object's document is not the same as the document on whichopen()
is called. Align with Chrome (and Edge to a lesser extent, as it strips document URL's fragment in all cases), and provide a simpler but reasonable fix to the scrolling bug.Resolution: Only abort when there is an ongoing attempt to navigate. Use the "ideal 2" plan in Unclear what exactly should be aborted in document.open() #3975.
Resolution: Remove "prompt to unload" and "unload" and align with Chrome and Safari. Firefox only fires
beforeunload
but notpagehide
orunload
events. Edge doesn't fire any events but still seems to run these steps – which for our purposes is identical to not running them.Resolution: Keep existing spec and remove event listeners on document's nodes. Additionally, align with Chrome and Safari in removing event listeners from
Window
, which has minimal compatibility risk due to current Edge and Firefox behaviors of removing tasks (since most events fired onWindow
are fired from tasks).Resolution: Set event handlers' values to null (deactivate all event handlers), but do not explicitly remove event handler content attributes. There's no reason to keep handlers there when the underlying event listener has been removed.
Resolution: Do not remove any tasks and align with Chrome, Safari, and partially Firefox.
Resolution: No changes to spec required. Continue to make MutationObserver work with
document.open()
's changes to the DOM tree. The provided test passes in Chrome, Firefox, and Safari, but fails in Edge currently.Resolution: Remove the abstract operation call as well as related steps; dramatically simplify algorithm and align with Chrome and Safari.
Resolution: Align with Chrome, Edge, and Safari and set the document's mode to no-quirks mode in document open steps.
Resolution: Align with Chrome and Safari, and remove the reload override buffer concept. Align with Safari in following the
Document
's URL when reloading. Also change the session history entry's URL to be the newDocument
's URL by usinghistory.replaceState()
model.load
event in conjunction withdocument.close()
(document.open() and the load event web-platform-tests/wpt#10239)Resolution: This seems to be a bit out of scope for an investigation focused on
document.open()
, as it touches navigation as well asiframe
loading behavior. Keep existing spec for now, and revisit in the future in the context of a comprehensiveiframe
investigation.Resolution: Browsers all seem fairly aligned (on
document.open()
's behavior at least). No need to change spec.Resolution: Align with Chrome, Safari, and Edge in not adding a history entry when
document.open()
is called – i.e., always use thereplace
semantics. Simplifies implementation and align with Chrome, Safari, and Edge. Also removereplace
parameter in the process as it's always enabled.The text was updated successfully, but these errors were encountered: