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

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: 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/js-test.js"></script>
2 <style>
3 body {
4 margin: 0px; height: 2000px; width: 2000px;
ojan 2016/04/19 21:34:24 Not a big deal, but the de facto standard for test
ymalik 2016/04/22 20:41:05 Done.
5 }
6
7 #first {
8 height: 1000px; background-color: #FFA5D2;
9 }
10
11 #anchor {
12 position: absolute; background-color: #84BE6A;
13 height: 600px; width: 100%;
14 }
15
16 #fragment {
17 position: relative; background-color: orange;
18 height: 200px; width: 200px; margin: 10px;
19 }
20 </style>
21
22 <script>
23 window.jsTestIsAsync = true;
24 setPrintTestResultsLazily();
25
26 description("This test ensures that scroll anchoring interacts correctly with\
ojan 2016/04/19 21:34:24 We don't usually have a line length limit on layou
ymalik 2016/04/22 20:41:05 This is removed in the new test.
27 fragment scrolls.");
28
29 onload = function() {
30 if (!window.internals) {
31 finishJSTest();
32 return;
33 }
34
35 internals.settings.setScrollAnchoringEnabled(true);
36
37 // Scroll to fragment.
38 window.location.hash = 'fragment';
39 requestAnimationFrame(function() {
40 // Height of first + fragment margin-top.
41 shouldBe('document.scrollingElement.scrollTop', '1010');
42
43 // Change height of content above fragment.
44 var ch = document.getElementById('changer');
45 ch.style.height = 100;
46 // Height of first + height changer + fragment margin-top.
47 shouldBe('document.scrollingElement.scrollTop', '1110');
48 finishJSTest();
49 });
50 }
51 </script>
52
53 <div id="first"></div>
54 <div id="changer"></div>
55 <div id="anchor">
56 <div id="fragment" name="fragment"></div>
57 </div>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698