-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Fragment navigation should use replacement enabled #2869
Conversation
FYI: I'm not really happy with the language here, but changing "replacement enabled" into a proper flag would be quite a bit of work given how hand-wavy we go about passing it through at the moment. 😟 |
I haven't checked, but @ForbesLindesay's test at https://github.com/ForbesLindesay/jsdom/blob/3316c3c3126dd7aaa3886d3d274e49343ee82634/test/web-platform-tests/to-upstream/html/browsers/browsing-the-web/navigating-across-documents/fragment-replace.html may be adaptable here, although it's worth noting it fails in Edge and Firefox (but passes in Chrome). I'm not sure if the interop issue it thus reveals is related to this issue, or not. |
Well, I've confirmed at least that manually running @ForbesLindesay's test case from the OP of #2796 works the same in Firefox as in Chrome (URL updates to Which is all to say, maybe there is a simpler test that passes in all browsers and still tests the issue here, that we can extract out of @ForbesLindesay's test case. |
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.
Actual text LGTM (modulo build failures).
I can't get there programmatically. <iframe src=/></iframe>
<script>
onload = () => {
self[0].location.hash = "t1"
w(self[0].location.hash)
self[0].location.hash = "t2"
w(self[0].location.hash)
self[0].location.hash = "t3"
w(self[0].location.hash)
history.back();
setTimeout(() => {
w(self[0].location.hash)
self[0].location.replace("/#something");
setTimeout(() => {
w(self[0].location.hash)
history.forward();
setTimeout(() => {
w(self[0].location.hash);
}, 200);
}, 200);
}, 200);
}
</script> In Live DOM Viewer does something entirely different in Firefox compared to Chrome. Firefox basically doesn't navigate back or forward. cc @smaug---- |
(Build failures fixed btw, apparently forgot to push a fix.) |
In my experience testing in live-dom-viewer or similar does not work well because of initial about:blank issues; testing in isolated files I saved to my desktop improved interop a decent bit. Not sure if that's enough to fix things though. |
If I add |
I'll try fiddling around with it tomorrow and see if I can make any progress. (Today I'm off as I've got family visiting.) Worst-case I guess we do a manual test... |
Follows whatwg/html#2869 by adapting whatwg/html#2796. In the process, discovered a Firefox-specific bug around history.forward() and hashchange, so added a pared-down version of the test for that in particular.
A couple weeks later than promised, but I managed to get a test case working at web-platform-tests/wpt#6877. Happy to merge this when you're ready. |
Follows whatwg/html#2869 by adapting whatwg/html#2796. In the process, discovered a Firefox-specific bug around history.forward() and hashchange, so added a pared-down version of the test for that in particular.
Follows whatwg/html#2869 by adapting whatwg/html#2796. In the process, discovered a Firefox-specific bug around history.forward() and hashchange, so added a pared-down version of the test for that in particular.
Fixes #2796.