Files
sousa-gecko/testing/web-platform/tests/intersection-observer/transform-animation.html
T
Antoine Quint 1a6d56632d Bug 1896664 [wpt PR 46255] - WebKit export of https://bugs.webkit.org/show_bug.cgi?id=273928, a=testonly
Automatic update from web-platform-tests
WebKit export of https://bugs.webkit.org/show_bug.cgi?id=273928 (#46255)

--

wpt-commits: 4a0aeb02d32180d424668776162afc6f85d47d6f
wpt-pr: 46255
2024-05-23 10:00:01 +00:00

39 lines
922 B
HTML

<!DOCTYPE html>
<meta name="viewport" content="width=device-width,initial-scale=1">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
#container {
width: 200px;
height: 200px;
background-color: black;
}
#target {
position: relative;
top: 100px;
width: 100%;
height: 1px;
background-color: gray;
}
</style>
<div id="container"><div id="target"></div></div>
<script>
promise_test(async function(t) {
let intersections = 0;
const observer = new IntersectionObserver(entries => ++intersections);
observer.observe(document.getElementById("target"));
await document.getElementById("container").animate({ transform: 'translate(0, 100px)' }, 1000).finished;
assert_equals(intersections, 1);
}, "An element that already intersects with the viewport does not trigger the observer callback when animating its transform.");
</script>