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

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

Issue 2706673002: Mark elements as viewport constrained when they become sticky positioned (Closed)
Patch Set: Rebase Created 3 years, 9 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/css/sticky/sticky-style-change-expected.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 html {
12 overflow: hidden; /* hide scrollbars */
13 }
14
15 body {
16 margin: 0;
17 }
18
19 .container {
20 height: 2000px;
21 }
22
23 .box {
24 height: 50px;
25 }
26
27 .sticky {
28 position: sticky;
29 top: 50px;
30 background-color: green;
31 }
32 </style>
33 <script>
34 if (window.testRunner)
35 testRunner.waitUntilDone()
36
37 function doTest()
38 {
39 const sticky = document.querySelector('.sticky');
40 sticky.style.position = 'relative';
41
42 // Force layout.
43 sticky.offsetTop;
44
45 sticky.style.position = 'sticky';
46
47 window.requestAnimationFrame(function() {
48 window.scrollTo(0, 100);
49 if (window.testRunner)
50 testRunner.notifyDone();
51 });
52 }
53
54 window.addEventListener('load', function() {
55 // We require the compositings inputs to be clean (and thus the initial
56 // sticky position to be calculated) before we stat changing things.
57 // Force this by waiting for a double rAF.
58 window.requestAnimationFrame(function() {
59 window.requestAnimationFrame(doTest);
60 });
61 });
62 </script>
63 </head>
64 <body>
65 <div class="container">
66 <div class="sticky box"></div>
67 </div>
68 </body>
69 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/css/sticky/sticky-style-change-expected.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698