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

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

Issue 1870663002: Reland main thread position sticky implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Only descend into children which have an ancestor overflow layer. 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 .grid-container {
29 display: grid;
30 grid-template-columns: 50% 50%;
31 grid-template-rows: 100%;
32 width: 200px;
33 height: 180px;
34 outline: 2px solid black;
35 }
36
37 .box {
38 width: 100px;
39 height: 180px;
40 }
41
42 .grid-item {
43 width: 100%;
44 height: 100%;
45 }
46
47 .sticky {
48 position: sticky;
49 left: 100px;
50 background-color: green;
51 }
52
53 .indicator {
54 position: absolute;
55 top: 0;
56 left: 0;
57 background-color: red;
58 }
59 </style>
60 <script>
61 function doTest()
62 {
63 window.scrollTo(100, 0);
64 }
65 window.addEventListener('load', doTest, false);
66 </script>
67 </head>
68 <body>
69 <p>This test checks the behavior of position:sticky with grid items.
70 There should be no red.</p>
71
72 <div class="group" style="left: 100px">
73 <div class="indicator box" style="left: 100px;"></div>
74 <div class="grid-container">
75 <div class="sticky grid-item" style="grid-column: 1; grid-row: 1;"></d iv>
76 <div class="grid-item" style="grid-column: 2; grid-row: 1;"></div>
77 </div>
78 </div>
79
80 <div class="group" style="left: 150px">
81 <div class="indicator box" style="left: 50px;"></div>
82 <div class="grid-container" style="left: 100px">
83 <div class="sticky grid-item" style="grid-column: 1; grid-row: 1;"></d iv>
84 <div class="grid-item" style="grid-column: 2; grid-row: 1;"></div>
85 </div>
86 </div>
87
88 <div class="group" style="left: 200px">
89 <div class="indicator box" style="left: 0px;"></div>
90 <div class="grid-container" style="left: 100px">
91 <div class="sticky grid-item" style="grid-column: 1; grid-row: 1;"></d iv>
92 <div class="grid-item" style="grid-column: 2; grid-row: 1;"></div>
93 </div>
94 </div>
95
96 </body>
97 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698