OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../../resources/testharness.js"></script> |
| 3 <script src="../../../resources/testharnessreport.js"></script> |
| 4 |
| 5 <style> |
| 6 #without_top { |
| 7 top: auto; |
| 8 } |
| 9 |
| 10 #with_top { |
| 11 top: 0px; |
| 12 } |
| 13 |
| 14 #with_bottom { |
| 15 bottom: 0px; |
| 16 } |
| 17 |
| 18 .box { |
| 19 position: sticky; |
| 20 } |
| 21 </style> |
| 22 |
| 23 <div class="box" id="without_top"></div> |
| 24 <div class="box" id="with_top"></div> |
| 25 <div class="box" id="with_bottom"></div> |
| 26 |
| 27 <script> |
| 28 test(() => { |
| 29 var element = document.getElementById('without_top'); |
| 30 assert_equals(getComputedStyle(element).top, 'auto'); |
| 31 }, 'top property should be auto if not specified.'); |
| 32 |
| 33 test(() => { |
| 34 var element = document.getElementById('with_top'); |
| 35 assert_equals(getComputedStyle(element).top, '0px'); |
| 36 }, 'top property should be the actual value if specified.'); |
| 37 |
| 38 test(() => { |
| 39 var element = document.getElementById('with_bottom'); |
| 40 assert_equals(getComputedStyle(element).top, 'auto'); |
| 41 }, 'top property should be auto if only bottom is specified.'); |
| 42 </script> |
OLD | NEW |