| 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 <iframe id="iframe" srcdoc="<div id='target'><div style='width:1000px;height:100
0px'></div></div>"></iframe> |
| 5 <script> |
| 6 description("Ensure that change.boundingClientRect matches change.target.getBoun
dingClientRect() for a clipped element with overflow inside an iframe."); |
| 7 |
| 8 var iframe = document.getElementById("iframe"); |
| 9 var entries = []; |
| 10 var target; |
| 11 |
| 12 iframe.onload = function() { |
| 13 target = iframe.contentDocument.getElementById("target"); |
| 14 new IntersectionObserver((changes) => { |
| 15 entries.push(...changes); |
| 16 }).observe(target); |
| 17 waitForNotification(step0); |
| 18 }; |
| 19 |
| 20 function step0() { |
| 21 shouldBeEqualToNumber("entries.length", 1); |
| 22 if (entries.length > 0) { |
| 23 shouldBe("entries[0].boundingClientRect.top", "target.getBoundingClientRect(
).top"); |
| 24 shouldBe("entries[0].boundingClientRect.left", "target.getBoundingClientRect
().left"); |
| 25 shouldBe("entries[0].boundingClientRect.width", "target.getBoundingClientRec
t().width"); |
| 26 shouldBe("entries[0].boundingClientRect.height", "target.getBoundingClientRe
ct().height"); |
| 27 } |
| 28 finishJSTest(); |
| 29 } |
| 30 </script> |
| OLD | NEW |