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

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

Powered by Google App Engine
This is Rietveld 408576698