OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <div id="root"></div> | 2 <div id="root"></div> |
3 <script src="../resources/js-test.js"></script> | 3 <script src="../resources/js-test.js"></script> |
4 <script> | 4 <script> |
5 description("Test for observer attribute getters."); | 5 description("Test for observer attribute getters."); |
6 var rootDiv = document.getElementById("root"); | 6 var rootDiv = document.getElementById("root"); |
7 | 7 |
8 var observer = new IntersectionObserver(function(e) {}, {}); | 8 var observer = new IntersectionObserver(function(e) {}, {}); |
9 shouldBeNull("observer.root"); | 9 shouldBeNull("observer.root"); |
| 10 shouldBe("observer.thresholds", "[0]"); |
10 shouldBeEqualToString("observer.rootMargin", "0px 0px 0px 0px"); | 11 shouldBeEqualToString("observer.rootMargin", "0px 0px 0px 0px"); |
11 | 12 |
12 observer = new IntersectionObserver(function(e) {}, { | 13 observer = new IntersectionObserver(function(e) {}, { |
13 root: rootDiv, | 14 root: rootDiv, |
14 threshold: [0, 0.25, 0.5, 1.0], | 15 threshold: [0, 0.25, 0.5, 1.0], |
15 rootMargin: "10% 20px" | 16 rootMargin: "10% 20px" |
16 }); | 17 }); |
17 shouldBe("observer.root", "rootDiv"); | 18 shouldBe("observer.root", "rootDiv"); |
| 19 shouldBe("observer.thresholds", "[0, 0.25, 0.5, 1.0]"); |
18 shouldBeEqualToString("observer.rootMargin", "10% 20px 10% 20px"); | 20 shouldBeEqualToString("observer.rootMargin", "10% 20px 10% 20px"); |
19 </script> | 21 </script> |
OLD | NEW |