1
0
Fork 0
firefox/testing/web-platform/tests/css/css-scoping/svg-id-ref-001.html
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

36 lines
1.2 KiB
HTML

<!DOCTYPE html>
<title>Same clip-path id's in different tree scopes</title>
<link rel="help" href="https://drafts.csswg.org/css-values/#local-urls">
<link rel="help" href="https://drafts.csswg.org/css-scoping-1/#css-tree-scoped-reference">
<link rel="match" href="reference/green-box.html">
<style>
div.container {
position: absolute;
width: 100px;
height: 100px;
}
div.one {
background-color: red;
}
</style>
<p>Test passes if you see a single 100px by 100px green box below.</p>
<div class="container one">
<svg style="display: block; width: 100%; height: 100%">
<rect width="100" height="100" fill="green" clip-path="url(#clip)"/>
<clipPath id="clip">
<rect width="50" height="100"/>
</clipPath>
</svg>
</div>
<div class="container two"></div>
<script>
const scoped = document.querySelector('div.two');
scoped.attachShadow({ mode: 'open' });
scoped.shadowRoot.innerHTML = `
<svg style="display: block; width: 100%; height: 100%">
<rect width="100" height="100" fill="green" clip-path="url(#clip)"/>
<clipPath id="clip">
<rect x="50" width="50" height="100"/>
</clipPath>
</svg>`;
</script>