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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/css/sticky/sticky-top.html

Issue 1308273010: Adapt and reland old position sticky implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Make sticky vertical ref tests expectations not dependent on font size. 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 <!DOCTYPE html>
2 <script>
3 if (window.internals) {
4 internals.settings.setCSSStickyPositionEnabled(true);
5 }
6 </script>
7
8 <html>
9 <head>
10 <style>
11 body {
12 margin: 0;
13 height: 2000px;
14 overflow: hidden; /* hide scrollbars */
15 }
16
17 .group {
18 display: inline-block;
19 position: relative;
20 width: 250px;
21 height: 500px;
22 }
23
24 .container {
25 width: 200px;
26 height: 400px;
27 outline: 2px solid black;
28 }
29
30 .box {
31 width: 200px;
32 height: 200px;
33 }
34
35 .sticky {
36 position: sticky;
37 top: 100px;
38 background-color: green;
39 }
40
41 .indicator {
42 position: absolute;
43 top: 0;
44 left: 0;
45 background-color: red;
46 }
47 </style>
48 <script>
49 function doTest()
50 {
51 window.scrollTo(0, 100);
52 }
53 window.addEventListener('load', doTest, false);
54 </script>
55 </head>
56 <body>
57 <div class="group">
58 <div class="indicator box" style="top: 200px;"></div>
59 <div class="container">
60 <div class="sticky box"></div>
61 </div>
62 </div>
63
64 <div class="group" style="top: 100px">
65 <div class="indicator box" style="top: 100px;"></div>
66 <div class="container">
67 <div class="sticky box"></div>
68 </div>
69 </div>
70
71 <div class="group" style="top: 200px">
72 <div class="indicator box" style="top: 0;"></div>
73 <div class="container">
74 <div class="sticky box"></div>
75 </div>
76 </div>
77 </body>
78 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698