-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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 history entry creation #12634
Conversation
No browser currently passes the 010.html test, and it is now removed. For whatwg/html#3946.
8505edf
to
759f4eb
Compare
@@ -1,22 +0,0 @@ | |||
<!doctype html> |
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.
Let's expand on the reasons for removing this. Seems to be something like:
- No browser currently passes this
- It's unclear what, if anything, it's testing; there are no interesting asserts
- The title, regarding "salvagability", does not appear connected to the test contents. And we will add better tests for salvagability ourselves.
function queueTest() { | ||
// The timeout is necessary to avoid the parser still being active when | ||
// `document.open()` is called and becoming a no-op. | ||
setTimeout(() => { |
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.
You should be able to grab opener.t.step_timeout or something like that. That would help catch any exceptions, and allow you to avoid the lint whitelist.
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.
I'm reluctant to do that, as it will cause the entry settings object to be that of the opener, which has the potential of opening a can of worms.
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.
Blehhh. Can you include testharness.js and use the global step_timeout?
<script> | ||
function queueTest() { | ||
// The timeout is necessary to avoid the parser still being active when | ||
// `document.open()` is called and becoming a no-op. |
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.
Explain more why setTimeout(,0) doesn't work (task queues etc.)
@@ -0,0 +1,25 @@ | |||
// Historically, document.open() created an entry in the session history so | |||
// that the original page could be seen by going back. Test that this behavior | |||
// no longer occurs. |
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 add a comment saying why this doesn't use an iframe. It's totally fine if the comment is "This could probably use an iframe, but I just wrote a lot of iframe tests, so for variety let's test window.open(). If the difference matters we can convert to or add an iframe test."
The current behavior of adding a new entry to the session history is removed, with the "replace" parameter behavior made the only option. To fix whatwg#3885, we now reuse history.replaceState()'s history model, which keeps the document's URL and the history entry URL in sync. At the same time, we restrict the history state update (including setting the document's URL) to be only run with fully active documents. Firefox already bails out for non-fully active documents (including those that are active documents), and it's not expected that there would be much usage of the URL of non-fully active documents anyway. This allows us to additionally remove the seldom implemented "replace" parameter in document.open(), whose behavior is now the default (aligning with with Chrome and Safari). The IDL is modified accordingly. Tests: web-platform-tests/wpt#12555 Tests: web-platform-tests/wpt#12634 Tests: web-platform-tests/wpt#12636 Tests: web-platform-tests/wpt#12650 Fixes whatwg#3564. Fixes whatwg#3885.
The current behavior of adding a new entry to the session history is removed, with the "replace" parameter behavior made the only option. To fix whatwg#3885, we now reuse history.replaceState()'s history model, which keeps the document's URL and the history entry URL in sync. At the same time, we restrict the history state update (including setting the document's URL) to be only run with fully active documents. Firefox already bails out for non-fully active documents (including those that are active documents), and it's not expected that there would be much usage of the URL of non-fully active documents anyway. This allows us to additionally remove the seldom implemented "replace" parameter in document.open(), whose behavior is now the default (aligning with with Chrome and Safari). The IDL is modified accordingly. Tests: web-platform-tests/wpt#12555 Tests: web-platform-tests/wpt#12634 Tests: web-platform-tests/wpt#12636 Tests: web-platform-tests/wpt#12650 Fixes whatwg#3564. Fixes whatwg#3885.
The current behavior of adding a new entry to the session history is removed, with the "replace" parameter behavior made the only option. To fix whatwg#3885, we now reuse history.replaceState()'s history model, which keeps the document's URL and the history entry URL in sync. At the same time, we restrict the history state update (including setting the document's URL) to be only run with fully active documents. Firefox already bails out for non-fully active documents (including those that are active documents), and it's not expected that there would be much usage of the URL of non-fully active documents anyway. This allows us to additionally remove the seldom implemented "replace" parameter in document.open(), whose behavior is now the default (aligning with with Chrome and Safari). The IDL is modified accordingly. Tests: web-platform-tests/wpt#12555 Tests: web-platform-tests/wpt#12634 Tests: web-platform-tests/wpt#12636 Tests: web-platform-tests/wpt#12650 Fixes whatwg#3564. Fixes whatwg#3885.
The current behavior of adding a new entry to the session history is removed, with the "replace" parameter behavior made the only option. To fix whatwg#3885, we now reuse history.replaceState()'s history model, which keeps the document's URL and the history entry URL in sync. At the same time, we restrict the history state update (including setting the document's URL) to be only run with fully active documents. Firefox already bails out for non-fully active documents (including those that are active documents), and it's not expected that there would be much usage of the URL of non-fully active documents anyway. This allows us to additionally remove the seldom implemented "replace" parameter in document.open(), whose behavior is now the default (aligning with with Chrome and Safari). The IDL is modified accordingly. Tests: web-platform-tests/wpt#12555 Tests: web-platform-tests/wpt#12634 Tests: web-platform-tests/wpt#12636 Tests: web-platform-tests/wpt#12650 Fixes whatwg#3564. Fixes whatwg#3885.
The current behavior of adding a new entry to the session history is removed, with the "replace" parameter behavior made the only option. To fix #3885, we now reuse history.replaceState()'s history model, which keeps the document's URL and the history entry URL in sync. At the same time, we restrict the history state update (including setting the document's URL) to be only run with fully active documents. Firefox already bails out for non-fully active documents (including those that are active documents), and it's not expected that there would be much usage of the URL of non-fully active documents anyway. This allows us to additionally remove the seldom implemented "replace" parameter in document.open(), whose behavior is now the default (aligning with with Chrome and Safari). The IDL is modified accordingly. Tests: web-platform-tests/wpt#12555 Tests: web-platform-tests/wpt#12634 Tests: web-platform-tests/wpt#12636 Tests: web-platform-tests/wpt#12650 Fixes #3564. Fixes #3885.
Closing because GitHub seems to have detached the branch from this PR itself. Reopened at #12724 |
The current behavior of adding a new entry to the session history is removed, with the "replace" parameter behavior made the only option. To fix whatwg#3885, we now reuse history.replaceState()'s history model, which keeps the document's URL and the history entry URL in sync. At the same time, we restrict the history state update (including setting the document's URL) to be only run with fully active documents. Firefox already bails out for non-fully active documents (including those that are active documents), and it's not expected that there would be much usage of the URL of non-fully active documents anyway. This allows us to additionally remove the seldom implemented "replace" parameter in document.open(), whose behavior is now the default (aligning with with Chrome and Safari). The IDL is modified accordingly. Tests: web-platform-tests/wpt#12555 Tests: web-platform-tests/wpt#12634 Tests: web-platform-tests/wpt#12636 Tests: web-platform-tests/wpt#12650 Fixes whatwg#3564. Fixes whatwg#3885.
The current behavior of adding a new entry to the session history is removed, with the "replace" parameter behavior made the only option. To fix whatwg#3885, we now reuse history.replaceState()'s history model, which keeps the document's URL and the history entry URL in sync. At the same time, we restrict the history state update (including setting the document's URL) to be only run with fully active documents. Firefox already bails out for non-fully active documents (including those that are active documents), and it's not expected that there would be much usage of the URL of non-fully active documents anyway. This allows us to additionally remove the seldom implemented "replace" parameter in document.open(), whose behavior is now the default (aligning with with Chrome and Safari). The IDL is modified accordingly. Tests: web-platform-tests/wpt#12555 Tests: web-platform-tests/wpt#12634 Tests: web-platform-tests/wpt#12636 Tests: web-platform-tests/wpt#12650 Fixes whatwg#3564. Fixes whatwg#3885.
No browser currently passes the 010.html test, and the particular concept it is
trying to test (salvageability) has been removed from the
document.open()
spec. The test has been removed.
For whatwg/html#3946.