Source code

Revision control

Copy as Markdown

Other Tools

Test Info: Warnings

<!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>
#target {
position: absolute;
left: 0;
top: 0;
width: 100px;
height: 40px;
background: lime;
}
#outer {
position: fixed;
left: 0;
top: 0;
width: 300px;
height: 100px;
visibility: hidden;
}
#inner {
visibility: visible;
filter: drop-shadow(-200px 0 0 black);
}
</style>
<div id="target"></div>
<svg id="outer">
<svg id="inner" x="200" y="0" width="100" height="40">
<rect width="100%" height="100%" fill="black"/>
</svg>
</svg>
<script>
setup({ single_test: true });
const target = document.getElementById("target");
new IntersectionObserver(entries => {
assert_false(entries[0].isVisible, "Target should be occluded by SVG drop-shadow");
done();
}, {trackVisibility: true, delay: 100}).observe(target);
</script>