Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <script src="../resources/js-test.js"></script> | |
| 3 <script src="../resources/intersection-observer-helper-functions.js"></script> | |
| 4 <div id='target' style='width:0px; height:0px'</div>" | |
| 5 <script> | |
| 6 description("Ensure that a visible zero-area element is given the correct inters ection ratio."); | |
| 7 | |
| 8 var entries = []; | |
| 9 var target; | |
| 10 | |
| 11 onload = function() { | |
| 12 target = document.getElementById("target"); | |
| 13 new IntersectionObserver((changes) => { | |
| 14 entries.push(...changes); | |
| 15 }).observe(target); | |
| 16 waitForNotification(step0); | |
| 17 }; | |
| 18 | |
| 19 function step0() { | |
| 20 shouldBeEqualToNumber("entries.length", 1); | |
| 21 if (entries.length > 0) { | |
|
foolip
2016/12/08 16:28:59
The above line says that it should be true, so no
Sami
2016/12/09 17:24:36
Very true, fixed. The existing tests had this guar
| |
| 22 shouldBe("entries[0].intersectionRatio", "1"); | |
| 23 } | |
| 24 finishJSTest(); | |
| 25 } | |
| 26 </script> | |
| OLD | NEW |