Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 .scroller { | |
| 16 overflow: hidden; /* hide scrollbars */ | |
| 17 width: 200px; | |
| 18 height: 350px; | |
| 19 outline: 2px solid black; | |
| 20 } | |
| 21 | |
| 22 .container { | |
| 23 width: 200px; | |
| 24 height: 700px; | |
| 25 } | |
| 26 | |
| 27 .outerSticky { | |
| 28 display: inline; | |
| 29 position: sticky; | |
| 30 top: 0; | |
| 31 } | |
| 32 | |
| 33 .innerSticky { | |
| 34 display: inline; | |
| 35 position: sticky; | |
| 36 top: 25px; | |
| 37 } | |
| 38 </style> | |
| 39 <script> | |
| 40 if (window.testRunner) | |
| 41 testRunner.waitUntilDone(); | |
| 42 | |
| 43 function doTest() { | |
| 44 finishTestInXFrames(2); | |
| 45 } | |
| 46 | |
| 47 function finishTestInXFrames(frames) { | |
| 48 if (frames > 0) { | |
| 49 requestAnimationFrame(finishTestInXFrames.bind(null, frames - 1)); | |
| 50 return; | |
| 51 } | |
| 52 finishTest(); | |
| 53 } | |
| 54 | |
| 55 function finishTest() { | |
| 56 for (const scroller of document.querySelectorAll('.scroller')) { | |
|
flackr
2017/02/22 22:40:14
There seems to only be one scroller, why the loop?
smcgruer
2017/02/23 20:14:16
Copy/paste error. Removed.
| |
| 57 scroller.scrollTop = 200; | |
| 58 } | |
| 59 if (window.testRunner) | |
| 60 testRunner.notifyDone(); | |
| 61 } | |
| 62 | |
| 63 window.addEventListener('load', doTest, false); | |
| 64 </script> | |
| 65 </head> | |
| 66 <body> | |
| 67 <div class="scroller"> | |
| 68 <div class="container"> | |
| 69 <div class="outerSticky">1<div class="innerSticky">2</div></div> | |
|
flackr
2017/02/22 22:40:14
Can you use colored or outlined blocks instead of
smcgruer
2017/02/23 20:14:16
Unless you object, I'm actually going to leave thi
| |
| 70 </div> | |
| 71 </div> | |
| 72 </body> | |
| 73 </html> | |
| OLD | NEW |