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

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

Issue 2636253002: Handle nested position:sticky elements (Closed)
Patch Set: Rebase Created 3 years, 10 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 }
14
15 .group {
16 display: inline-block;
17 position: relative;
18 width: 250px;
19 height: 350px;
20 }
21
22 .scroller {
23 overflow: hidden; /* hide scrollbars */
24 width: 200px;
25 height: 350px;
26 outline: 2px solid black;
27 }
28
29 .container {
30 width: 200px;
31 height: 700px;
32 }
33
34 .outerSticky {
35 position: sticky;
36 background-color: green;
37 width: 200px;
38 height: 200px;
39 }
40
41 .innerSticky {
42 position: sticky;
43 background-color: red;
44 width: 200px;
45 height: 100px;
46 }
47 </style>
48 <script>
49 if (window.testRunner)
50 testRunner.waitUntilDone();
51
52 function doTest() {
53 finishTestInXFrames(2);
54 }
55
56 function finishTestInXFrames(frames) {
57 if (frames > 0) {
58 requestAnimationFrame(finishTestInXFrames.bind(null, frames - 1));
59 return;
60 }
61 finishTest();
62 }
63
64 function finishTest() {
65 for (const scroller of document.querySelectorAll('.scroller')) {
66 scroller.scrollTop = 200;
67 }
68 if (window.testRunner)
69 testRunner.notifyDone();
70 }
71
72 window.addEventListener('load', doTest, false);
73 </script>
74 </head>
75 <body>
76 <div class="group">
77 <div class="scroller">
78 <div class="container">
79 <div class="outerSticky" style="top: 50px;">
80 <div class="innerSticky" style="top: 50px;"></div>
81 </div>
82 </div>
83 </div>
84 </div>
85
86 <div class="group">
87 <div class="scroller">
88 <div class="container">
89 <div class="outerSticky" style="top: 50px;">
90 <div class="innerSticky" style="top: 100px;"></div>
91 </div>
92 </div>
93 </div>
94 </div>
95
96 <div class="group">
97 <div class="scroller">
98 <div class="container">
99 <div class="outerSticky" style="top: 50px;">
100 <div class="innerSticky" style="top: 300px;"></div>
101 </div>
102 </div>
103 </div>
104 </div>
105
106 </body>
107 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698