Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <script> | 2 <script> |
| 3 if (window.internals) { | 3 if (window.internals) { |
| 4 internals.settings.setCSSStickyPositionEnabled(true); | 4 internals.settings.setCSSStickyPositionEnabled(true); |
| 5 } | 5 } |
| 6 </script> | 6 </script> |
| 7 | 7 |
| 8 <style> | 8 <style> |
| 9 body { | 9 body { |
| 10 margin: 0; | 10 margin: 0; |
| 11 height: 2000px; | 11 height: 2000px; |
| 12 overflow: hidden; /* hide scrollbars */ | 12 overflow: hidden; /* hide scrollbars */ |
| 13 overflow-anchor: none; | |
|
ymalik
2016/07/22 16:53:24
@skobes, I couldn't come up with a way to modify t
skobes
2016/07/25 20:46:38
How about calling scrollTo after changing height,
ymalik
2016/07/26 21:03:50
I think the purpose of the test is to verify that
skobes
2016/07/26 21:19:14
Good point. Using the opt out here is fine.
| |
| 13 } | 14 } |
| 14 | 15 |
| 15 #spacer { | 16 #spacer { |
| 16 height: 200px; | 17 height: 200px; |
| 17 } | 18 } |
| 18 | 19 |
| 19 .container { | 20 .container { |
| 20 background-color: red; | 21 background-color: red; |
| 21 width: 200px; | 22 width: 200px; |
| 22 height: 400px; | 23 height: 400px; |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 42 // When the spacer's height is changed the sticky container moves up which s hould now | 43 // When the spacer's height is changed the sticky container moves up which s hould now |
| 43 // require sliding the sticky box down. | 44 // require sliding the sticky box down. |
| 44 document.getElementById('spacer').style.height = '0px'; | 45 document.getElementById('spacer').style.height = '0px'; |
| 45 } | 46 } |
| 46 window.addEventListener('load', doTest, false); | 47 window.addEventListener('load', doTest, false); |
| 47 </script> | 48 </script> |
| 48 <div id="spacer"></div> | 49 <div id="spacer"></div> |
| 49 <div class="container"> | 50 <div class="container"> |
| 50 <div class="sticky box"></div> | 51 <div class="sticky box"></div> |
| 51 </div> | 52 </div> |
| OLD | NEW |