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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/loader/scroll-anchor-cleared-after-load-when-hidden.html

Issue 2474813002: Clamping shouldn't clear the fragment anchor. (Closed)
Patch Set: address review comments Created 4 years, 1 month 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
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../../resources/js-test.js"></script>
3 <script src="../../resources/run-after-layout-and-paint.js"></script>
4 <style>
5 #anchor {
6 display: none;
7 position: absolute;
8 width: 60px;
9 height: 30px;
10 background-color: #eee;
11 font: bold 10pt monospace;
12 padding: 10px;
13 left: 50vw;
14 top: 200vh;
15 }
16
17 </style>
18 <a id="anchor" name="foo">ANCHOR</a>
19 <script>
20
21 description("Tests that the scroll position does not stick to the anchor if " +
22 "it becomes visible after the page has finished loading.");
23
24 var jsTestIsAsync = true;
25 var anchor = document.querySelector("#anchor");
26
27 onhashchange = function() {
28 if (location.hash != '#foo')
29 return;
30
31 anchor.style.display = 'block';
32 runAfterLayoutAndPaint(function() {
33 shouldBe("scrollY", "0");
34
35 location.hash = "#";
36 anchor.style.display = 'none';
37 finishJSTest();
38 });
39 };
40
41 onload = function() {
42 runAfterLayoutAndPaint(function() {
43 location.hash = "#foo";
44 });
45 };
46
47 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698