Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Side by Side Diff: LayoutTests/fast/css/target-fragment-match.html

Issue 1239463005: Replace history.options with history.scrollRestoration attribute (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Move setScrollRestorationType to History Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/css/target-fragment-match-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.or g/TR/html4/loose.dtd"> 1 <!DOCTYPE html>
2 <html>
3 <head>
4 <style type="text/css"> 2 <style type="text/css">
5 div:target { 3 div {
6 background-color: #66CCFF; 4 background-color: rgb(255, 255, 255);
7 } 5 }
6
7 div:target {
8 background-color: rgb(102, 204, 255);
9 }
8 </style> 10 </style>
11
12 <script src="../../resources/js-test.js"></script>
9 <script> 13 <script>
10 function test() 14 jsTestIsAsync = true;
11 { 15 description('Verify that css :target selector is correctly updated during hash and history navigations');
12 if (window.testRunner)
13 testRunner.waitUntilDone();
14 16
17 // Increase the navigation delay outside test runner to make the effect visibl e
18 var delay = window.testRunner ? 0 : 500;
19
20 onload = function() {
15 // Location changes need to happen outside the onload handler to generate hi story entries. 21 // Location changes need to happen outside the onload handler to generate hi story entries.
16 setTimeout(runTest, 0); 22 setTimeout(function() {
17 } 23 window.location.hash = '#target-01';
24 }, delay);
25 };
18 26
19 function runTest() { 27 window.addEventListener('hashchange', function() {
20 window.location.hash ='#target-01'; 28 if (window.location.hash == "#target-01") {
21 document.body.offsetTop; 29 document.body.offsetTop;
22 window.history.back(); // This queues up a navigation, so we need to delay t he call to notifyDone. 30 shouldBeEqualToString("getComputedStyle(document.getElementById('target-01 ')).backgroundColor", "rgb(102, 204, 255)");
23 if (window.testRunner) 31 setTimeout(function() {
24 window.onpopstate = function() { testRunner.notifyDone() }; 32 window.history.back();
25 } 33 }, delay);
34 } else {
35 document.body.offsetTop;
36 shouldBeEqualToString("getComputedStyle(document.getElementById('target-01 ')).backgroundColor", "rgb(255, 255, 255)");
37 finishJSTest();
38 }
39 });
26 </script> 40 </script>
27 </head>
28 <body onload="test()">
29 41
30 <div id="target-01"> 42 <div id="target-01">
31 <p>I should be highlighted first because of the anchor, and de-highlighted whe n there is no fragment.</p> 43 <p>I should be highlighted first because of the anchor, and de-highlighted whe n there is no fragment.</p>
32 </div> 44 </div>
33
34 </body></html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/css/target-fragment-match-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698