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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/css/sticky/sticky-container-moved.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 <style>
9 body {
10 margin: 0;
11 height: 2000px;
12 overflow: hidden; /* hide scrollbars */
13 }
14
15 #spacer {
16 height: 200px;
17 }
18
19 .container {
20 background-color: red;
21 width: 200px;
22 height: 400px;
23 outline: 2px solid black;
24 }
25
26 .box {
27 width: 200px;
28 height: 200px;
29 }
30
31 .sticky {
32 position: sticky;
33 top: 0px;
34 background-color: green;
35 }
36
37 </style>
38 <script>
39 function doTest()
40 {
41 window.scrollTo(0, 200);
42 // When the spacer's height is changed the sticky container moves up which s hould now
43 // require sliding the sticky box down.
44 document.getElementById('spacer').style.height = '0px';
45 }
46 window.addEventListener('load', doTest, false);
47 </script>
48 <div id="spacer"></div>
49 <div class="container">
50 <div class="sticky box"></div>
51 </div>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698