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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/css/sticky/sticky-flexbox.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 width: 2000px;
14 overflow: hidden; /* hide scrollbars */
15 }
16
17 p {
18 position: relative;
19 left: 100px;
20 }
21
22 .group {
23 position: relative;
24 width: 500px;
25 height: 200px;
26 }
27
28 .flex-container {
29 position: relative;
30 display: flex;
31 width: 200px;
32 height: 180px;
33 flex-flow: row wrap;
34 outline: 2px solid black;
35 }
36
37 .box {
38 width: 100px;
39 height: 180px;
40 }
41
42 .flex-item {
43 width: 100px;
44 height: 180px;
45 display: flex;
46 }
47
48 .sticky {
49 position: sticky;
50 left: 100px;
51 background-color: green;
52 }
53
54 .indicator {
55 position: absolute;
56 top: 0;
57 left: 0;
58 background-color: red;
59 }
60 </style>
61 <script>
62 function doTest()
63 {
64 window.scrollTo(100, 0);
65 }
66 window.addEventListener('load', doTest, false);
67 </script>
68 </head>
69 <body>
70 <p>This test checks the behavior of position:sticky with flex box items.
71 There should be no red.</p>
72
73 <div class="group" style="left: 100px">
74 <div class="indicator box" style="left: 100px;"></div>
75 <div class="flex-container" style="left: 0px;">
76 <div class="sticky flex-item"></div>
77 <div class="flex-item" style="background-color: green;"></div>
78 </div>
79 </div>
80
81 <div class="group" style="left: 150px">
82 <div class="indicator box" style="left: 50px;"></div>
83 <div class="flex-container" style="left: 0px;">
84 <div class="sticky flex-item"></div>
85 <div class="flex-item" style="background-color: green;"></div>
86 </div>
87 </div>
88
89 <div class="group" style="left: 200px">
90 <div class="indicator box" style="left: 0;"></div>
91 <div class="flex-container" style="left: 0px;">
92 <div class="sticky flex-item"></div>
93 <div class="flex-item" style="background-color: green;"></div>
94 </div>
95 </div>
96
97 </body>
98 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698