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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/css/sticky/sticky-top-overflow.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 <html>
8 <head>
9 <style>
10 .group {
11 display: inline-block;
12 position: relative;
13 width: 150px;
14 height: 500px;
15 }
16
17 #overflow {
18 width: 600px;
19 height: 550px;
20 overflow: hidden; /* Still scrollable with JS */
21 border: 1px solid black;
22 }
23
24 .spacer {
25 float: left;
26 width: 10px;
27 height: 1200px;
28 }
29 .container {
30 width: 100px;
31 height: 400px;
32 outline: 2px solid black;
33 }
34
35 .box {
36 width: 100px;
37 height: 200px;
38 }
39
40 .sticky {
41 position: sticky;
42 top: 100px;
43 background-color: green;
44 }
45
46 .indicator {
47 position: absolute;
48 top: 0;
49 left: 0;
50 background-color: red;
51 }
52 </style>
53 <script>
54 function doTest()
55 {
56 document.getElementById('overflow').scrollTop = 120;
57 }
58 window.addEventListener('load', doTest, false);
59 </script>
60 </head>
61 <body>
62 This test checks that sticky positioned elements are contained by their enclosin g ancestor with an overflow clip.
63 There should be no red.
64 <div id="overflow">
65 <div class="spacer"></div>
66 <div class="group">
67 <div class="indicator box" style="top: 200px;"></div>
68 <div class="container">
69 <div class="sticky box"></div>
70 </div>
71 </div>
72
73 <div class="group" style="top: 100px">
74 <div class="indicator box" style="top: 120px;"></div>
75 <div class="container">
76 <div class="sticky box"></div>
77 </div>
78 </div>
79
80 <div class="group" style="top: 240px">
81 <div class="indicator box" style="top: 0;"></div>
82 <div class="container">
83 <div class="sticky box"></div>
84 </div>
85 </div>
86 </div>
87 </body>
88 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698