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

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: extend internas api to set runtime enabled features + use testharness.js Created 4 years, 8 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
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 // TODO(ymalik): Remove reference to internals when scroll anchoring is
40 // enabled by default.
41 assert_false(!window.internals, 'This test requires internals');
42 internals.runtimeFlags.setScrollAnchoringEnabled(true);
43
44 window.location.hash = 'fragment';
45 // Height of first + fragment margin-top.
46 assert_equals(window.scrollY, 1010);
47
48 // Change height of content above fragment.
49 var ch = document.getElementById('changer');
50 ch.style.height = 100;
51
52 // Height of first + height changer + fragment margin-top.
53 assert_equals(window.scrollY, 1110);
54 }, 'Verify scroll anchoring interaction with fragment scrolls');
55 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698