LEFT | RIGHT |
(no file at all) | |
| 1 <!DOCTYPE html> |
| 2 <script src="/resources/testharness.js"></script> |
| 3 <script src="/resources/testharnessreport.js"></script> |
| 4 |
| 5 <div id="root"></div> |
| 6 |
| 7 <script> |
| 8 test(function() { |
| 9 var observer = new IntersectionObserver(function(e) {}, {}); |
| 10 test(function() { assert_equals(observer.root, null) }, |
| 11 "observer.root"); |
| 12 test(function() { assert_array_equals(observer.thresholds, [0]) }, |
| 13 "observer.thresholds"); |
| 14 test(function() { assert_equals(observer.rootMargin, "0px 0px 0px 0px") }, |
| 15 "observer.rootMargin"); |
| 16 |
| 17 var rootDiv = document.getElementById("root"); |
| 18 observer = new IntersectionObserver(function(e) {}, { |
| 19 root: rootDiv, |
| 20 threshold: [0, 0.25, 0.5, 1.0], |
| 21 rootMargin: "10% 20px" |
| 22 }); |
| 23 test(function() { assert_equals(observer.root, rootDiv) }, |
| 24 "set observer.root"); |
| 25 test(function() { assert_array_equals(observer.thresholds, [0, 0.25, 0.5, 1.0]
) }, |
| 26 "set observer.thresholds"); |
| 27 test(function() { assert_equals(observer.rootMargin, "10% 20px 10% 20px") }, |
| 28 "set observer.rootMargin"); |
| 29 }, "Observer attribute getters."); |
| 30 |
| 31 </script> |
LEFT | RIGHT |