3 <script src=
"../../../resources/js-test.js"></script>
8 testRunner
.keepWebHistory();
12 description('Verify that changes done by history.replaceState and history.pushState update visitedLinks.');
14 window
.history
.replaceState(null, "Title", "replacedURL.html");
15 window
.history
.pushState(null, "Title", "pushedURL.html");
17 if (window
.internals
) {
18 style1
= internals
.computedStyleIncludingVisitedInfo(document
.getElementById('link1'));
19 style2
= internals
.computedStyleIncludingVisitedInfo(document
.getElementById('link2'));
21 // The style is not necessarily updated synchronously in response to history.replaceState and history.pushState.
22 shouldBecomeEqualToString("style1.color", "rgb(255, 165, 0)", function() {
23 shouldBecomeEqualToString("style2.color", "rgb(255, 165, 0)", finishJSTest
);
31 :link { color: rgb(
0,
255,
0); background-color: white }
32 :visited { color: rgb(
255,
165,
0); background-color: black }
35 <body onload=
"loaded();">
36 <p id=description
></p>
37 <a id=
"link1" href=
"replacedURL.html">This link should get colored visited as a result of replaceState() setting it as the current URL
</a><br>
38 <a id=
"link2" href=
"pushedURL.html">This link should get colored visited as a result of pushState() adding it to the forward list
</a><br>
39 If you're running in a browser, the link should be orange-on-black and you should see
"replacedURL.html" in your global history.
<br>
40 If you're running in DRT, the test will also append
"PASS" or
"FAIL".
<br>
41 <div id=console
></div>