| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <script src="../resources/testharness.js"></script> | 2 <script src="../resources/testharness.js"></script> |
| 3 <script src="../resources/testharnessreport.js"></script> | 3 <script src="../resources/testharnessreport.js"></script> |
| 4 <script src="./resources/intersection-observer-test-utils.js"></script> | 4 <script src="./resources/intersection-observer-test-utils.js"></script> |
| 5 | 5 |
| 6 <style> | 6 <style> |
| 7 pre, #log { | 7 pre, #log { |
| 8 position: absolute; | 8 position: absolute; |
| 9 top: 0; | 9 top: 0; |
| 10 left: 200px; | 10 left: 200px; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 entries = entries.concat(changes) | 36 entries = entries.concat(changes) |
| 37 }).observe(target); | 37 }).observe(target); |
| 38 } | 38 } |
| 39 createObserver(); | 39 createObserver(); |
| 40 runTestCycle(step0, "First rAF"); | 40 runTestCycle(step0, "First rAF"); |
| 41 }, "IntersectionObserver that is unreachable in js should still generate notific
ations."); | 41 }, "IntersectionObserver that is unreachable in js should still generate notific
ations."); |
| 42 | 42 |
| 43 function step0() { | 43 function step0() { |
| 44 document.scrollingElement.scrollTop = 300; | 44 document.scrollingElement.scrollTop = 300; |
| 45 runTestCycle(step1, "document.scrollingElement.scrollTop = 300"); | 45 runTestCycle(step1, "document.scrollingElement.scrollTop = 300"); |
| 46 assert_equals(entries.length, 0, "No notifications after first rAF."); | 46 assert_equals(entries.length, 1, "One notification."); |
| 47 } | 47 } |
| 48 | 48 |
| 49 function step1() { | 49 function step1() { |
| 50 document.scrollingElement.scrollTop = 0; | 50 document.scrollingElement.scrollTop = 0; |
| 51 assert_equals(entries.length, 1, "One notification."); | 51 assert_equals(entries.length, 2, "Two notifications."); |
| 52 } | 52 } |
| 53 </script> | 53 </script> |
| OLD | NEW |