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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/layout/scroll-anchoring/fragment-scrolling-anchors.html

Issue 1895293002: Test fragment scrolling and history restoration interaction w/ scroll anchoring. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove .cpp.tmpl and other review comments Created 4 years, 7 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 | third_party/WebKit/LayoutTests/fast/layout/scroll-anchoring/history-restore-anchors.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <script src="../../../resources/testharness.js"></script>
2 <script src="../../../resources/testharnessreport.js"></script>
3 <style>
4 body {
5 margin: 0px;
6 height: 2000px;
7 width: 2000px;
8 }
9
10 #first {
11 height: 1000px;
12 background-color: #FFA5D2;
13 }
14
15 #anchor {
16 position: absolute;
17 background-color: #84BE6A;
18 height: 600px;
19 width: 100%;
20 }
21
22 #fragment {
23 position: relative;
24 background-color: orange;
25 height: 200px;
26 width: 200px;
27 margin: 10px;
28 }
29 </style>
30
31 <div id="first"></div>
32 <div id="changer"></div>
33 <div id="anchor">
34 <div id="fragment" name="fragment"></div>
35 </div>
36
37 <script>
38 test(function(t) {
39 // Note that this test passes even without scroll anchoring because of
40 // fragment anchoring.
41 window.location.hash = 'fragment';
42 // Height of first + fragment margin-top.
43 assert_equals(window.scrollY, 1010);
44
45 // Change height of content above fragment.
46 var ch = document.getElementById('changer');
47 ch.style.height = 100;
48
49 // Height of first + height changer + fragment margin-top.
50 assert_equals(window.scrollY, 1110);
51 }, 'Verify scroll anchoring interaction with fragment scrolls');
52 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/layout/scroll-anchoring/history-restore-anchors.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698