Make session history aware of URLs

This commit is contained in:
Connor Brewster 2018-04-20 22:44:59 -05:00
parent 05fe8fa08d
commit e7ef9cfb30
11 changed files with 192 additions and 56 deletions

View file

@ -327481,6 +327481,12 @@
{}
]
],
"html/browsers/history/the-history-interface/history_pushstate_url.html": [
[
"/html/browsers/history/the-history-interface/history_pushstate_url.html",
{}
]
],
"html/browsers/history/the-history-interface/history_replacestate.html": [
[
"/html/browsers/history/the-history-interface/history_replacestate.html",
@ -554878,6 +554884,10 @@
"8add09b76d8662f4343188a1ac36fe71fd4a225d",
"testharness"
],
"html/browsers/history/the-history-interface/history_pushstate_url.html": [
"d5e1649c88102f27da5fe1ac16715cfee7f70f84",
"testharness"
],
"html/browsers/history/the-history-interface/history_replacestate.html": [
"91cf4970bfa565ee8b846582bdbe608d38902fe7",
"testharness"

View file

@ -1,7 +1,6 @@
[scroll-restoration-fragment-scrolling-samedoc.html]
type: testharness
expected: TIMEOUT
bug: https://github.com/servo/servo/issues/14970
[Manual scroll restoration should take precedent over scrolling to fragment in cross doc navigation]
expected: TIMEOUT
expected: FAIL

View file

@ -1,7 +1,6 @@
[scroll-restoration-navigation-samedoc.html]
type: testharness
expected: TIMEOUT
bug: https://github.com/servo/servo/issues/14970
[history.{push,replace}State retain scroll restoration mode and navigation in the same document respects it]
expected: TIMEOUT
expected: FAIL

View file

@ -0,0 +1,24 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>History pushState sets the url</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<div id="log"></div>
<script>
async_test(function(t) {
var oldLocation = window.location.toString();
window.history.pushState(null, "", "#hash");
assert_equals(oldLocation + "#hash", window.location.toString(), "pushState updates url");
history.back();
window.onhashchange = () => {
assert_equals(oldLocation, window.location.toString(), 'history traversal restores old url');
t.done();
};
}, "history pushState sets url");
</script>
</body>
</html>