| 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 20 matching lines...) Expand all Loading... |
| 31 entries = entries.concat(changes) | 31 entries = entries.concat(changes) |
| 32 }); | 32 }); |
| 33 observer.observe(target); | 33 observer.observe(target); |
| 34 entries = entries.concat(observer.takeRecords()); | 34 entries = entries.concat(observer.takeRecords()); |
| 35 assert_equals(entries.length, 0, "No initial notifications."); | 35 assert_equals(entries.length, 0, "No initial notifications."); |
| 36 runTestCycle(step0, "Intersecting notification after first rAF."); | 36 runTestCycle(step0, "Intersecting notification after first rAF."); |
| 37 }, "IntersectionObserver should send a not-intersecting notification for a targe
t that gets display:none."); | 37 }, "IntersectionObserver should send a not-intersecting notification for a targe
t that gets display:none."); |
| 38 | 38 |
| 39 function step0() { | 39 function step0() { |
| 40 runTestCycle(step1, "Not-intersecting notification after setting display:none
on target."); | 40 runTestCycle(step1, "Not-intersecting notification after setting display:none
on target."); |
| 41 checkLastEntry(entries, 0, [8, 108, 8, 108, 8, 108, 8, 108, 0, 800, 0, 600, ta
rget]); | 41 checkLastEntry(entries, 0, [8, 108, 8, 108, 8, 108, 8, 108, 0, 800, 0, 600, tr
ue]); |
| 42 target.style.display = "none"; | 42 target.style.display = "none"; |
| 43 } | 43 } |
| 44 | 44 |
| 45 function step1() { | 45 function step1() { |
| 46 runTestCycle(step2, "Intersecting notification after removing display:none on
target."); | 46 runTestCycle(step2, "Intersecting notification after removing display:none on
target."); |
| 47 checkLastEntry(entries, 1, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, target]); | 47 checkLastEntry(entries, 1, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, false]); |
| 48 target.style.display = ""; | 48 target.style.display = ""; |
| 49 } | 49 } |
| 50 | 50 |
| 51 function step2() { | 51 function step2() { |
| 52 checkLastEntry(entries, 2, [8, 108, 8, 108, 8, 108, 8, 108, 0, 800, 0, 600, ta
rget]); | 52 checkLastEntry(entries, 2, [8, 108, 8, 108, 8, 108, 8, 108, 0, 800, 0, 600, tr
ue]); |
| 53 } | 53 } |
| 54 </script> | 54 </script> |
| OLD | NEW |