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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/loader/scroll-anchor-cleared-after-load.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
6 #anchor {
7 display: block;
8 position: absolute;
9 width: 60px;
10 height: 30px;
11 background-color: #eee;
12 font: bold 10pt monospace;
13 padding: 10px;
14 left: 200px;
15 top: 150px;
16 }
17
18 </style>
19 <a id="anchor" name="foo">ANCHOR</a>
20 <script>
21
22 description("Tests that the scroll position does not stick to the anchor if " +
23 "it moves after the page has finished loading.");
24
25 var jsTestIsAsync = true;
26 var anchor = document.querySelector("#anchor");
27
28 onload = function() {
29 runAfterLayoutAndPaint(function() {
30 location.hash = "#foo";
31
32 runAfterLayoutAndPaint(function() {
33 anchor.style.top = "1000px";
34
35 shouldBe("scrollY", "0");
36
37 location.hash = "#";
38 anchor.style.top = "";
39 finishJSTest();
40 });
41 });
42 };
43
44 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698