Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /svg/linking/reftests/media-fragment-spatial-percent-nonsquare.html - WPT Dashboard Interop Dashboard
<!doctype html>
<title>SVG media fragment: percent-based spatial clipping on non-square SVG</title>
<link rel="match" href="../../struct/reftests/reference/green-100x100.html">
<style>
div {
width: 100px;
height: 100px;
/* The SVG's intrinsic size is 200x100 but the fragment selects a 100x100
region. Without explicit background-size, the image renders at its
intrinsic 2:1 aspect ratio, causing a viewport/viewBox mismatch. */
background-size: 100px 100px;
background-repeat: no-repeat;
background-image: url("support/red-green-200x100.svg#xywh=percent:50,0,50,100");
}
</style>
<div></div>