| OLD | NEW | 
|---|
| (Empty) |  | 
|  | 1 <!DOCTYPE html> | 
|  | 2 <style> | 
|  | 3 .scroller { | 
|  | 4   height: 100px; | 
|  | 5   width: 100px; | 
|  | 6   overflow: auto; | 
|  | 7 } | 
|  | 8 | 
|  | 9 .content { | 
|  | 10   height: 500px; | 
|  | 11   width: 500px; | 
|  | 12 } | 
|  | 13 </style> | 
|  | 14 | 
|  | 15 <script src='../../../resources/testharness.js'></script> | 
|  | 16 <script src='../../../resources/testharnessreport.js'></script> | 
|  | 17 | 
|  | 18 <div id='inlineScroller' class='scroller' style='display: inline;'> | 
|  | 19   <div class='content'></div> | 
|  | 20 </div> | 
|  | 21 <script> | 
|  | 22 test(function() { | 
|  | 23   const scroller = document.querySelector('#inlineScroller'); | 
|  | 24   const scrollTimeline = new ScrollTimeline( | 
|  | 25       { scrollSource: scroller, timeRange: 100, orientation: 'block' }); | 
|  | 26 | 
|  | 27   assert_equals(scrollTimeline.currentTime, NaN); | 
|  | 28 }, 'currentTime returns NaN for a display: inline scrollSource'); | 
|  | 29 </script> | 
|  | 30 | 
|  | 31 <div id='displayNoneScroller' class='scroller' style='display: none;'> | 
|  | 32   <div class='content'></div> | 
|  | 33 </div> | 
|  | 34 <script> | 
|  | 35 test(function() { | 
|  | 36   const scroller = document.querySelector('#displayNoneScroller'); | 
|  | 37   const scrollTimeline = new ScrollTimeline( | 
|  | 38       { scrollSource: scroller, timeRange: 100, orientation: 'block' }); | 
|  | 39 | 
|  | 40   assert_equals(scrollTimeline.currentTime, NaN); | 
|  | 41 }, 'currentTime returns NaN for a display: none scrollSource'); | 
|  | 42 </script> | 
|  | 43 | 
|  | 44 <script> | 
|  | 45 test(function() { | 
|  | 46   const scroller = document.createElement('div'); | 
|  | 47   const content = document.createElement('div'); | 
|  | 48 | 
|  | 49   scroller.style.overflow = 'auto'; | 
|  | 50   scroller.style.height = '100px'; | 
|  | 51   scroller.style.width = '100px'; | 
|  | 52   content.style.height = '250px'; | 
|  | 53   content.style.width = '250px'; | 
|  | 54 | 
|  | 55   scroller.appendChild(content); | 
|  | 56 | 
|  | 57   const scrollTimeline = new ScrollTimeline( | 
|  | 58       { scrollSource: scroller, timeRange: 100, orientation: 'block' }); | 
|  | 59 | 
|  | 60   assert_equals(scrollTimeline.currentTime, NaN); | 
|  | 61 }, 'currentTime returns NaN for an unattached scrollSource'); | 
|  | 62 </script> | 
|  | 63 | 
|  | 64 <div id='notAScroller' class='scroller' style='overflow: visible;'> | 
|  | 65   <div class='content'></div> | 
|  | 66 </div> | 
|  | 67 <script> | 
|  | 68 test(function() { | 
|  | 69   const scroller = document.querySelector('#notAScroller'); | 
|  | 70   const scrollTimeline = new ScrollTimeline( | 
|  | 71       { scrollSource: scroller, timeRange: 100, orientation: 'block' }); | 
|  | 72 | 
|  | 73   assert_equals(scrollTimeline.currentTime, NaN); | 
|  | 74 }, 'currentTime returns NaN when the scrollSource is not a scroller'); | 
|  | 75 </script> | 
| OLD | NEW | 
|---|