mask-clip-4.html (1864B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title>CSS Masking: mask-clip: clip mask image</title> 6 <link rel="author" title="Mozilla" href="https://www.mozilla.org"> 7 <link rel="help" href="https://drafts.fxtf.org/css-masking-1/#the-mask-clip"> 8 <link rel="match" href="mask-clip-4-ref.html"> 9 <meta name="assert" content="content-box, padding-box, border-box, and 10 magrin-box values of mask-clip should clip to the appropriate boxes."> 11 <style type="text/css"> 12 svg { 13 position: absolute; 14 top: 10px; 15 border: 1px solid black; 16 } 17 18 rect.mask { 19 fill: blue; 20 mask-origin: fill-box; 21 mask-repeat: no-repeat; 22 mask-image: url(support/50x50-opaque-blue.svg); 23 } 24 25 rect.content { 26 mask-clip: content-box; /* should be the same as fill-box */ 27 } 28 29 rect.padding { 30 mask-clip: padding-box; /* should be the same as fill-box */ 31 } 32 33 rect.border { 34 mask-clip: border-box; /* should be the same as stroke-box */ 35 } 36 37 rect.margin { 38 mask-clip: margin-box; /* should be the same as stroke-box */ 39 } 40 </style> 41 </head> 42 <body> 43 <svg width="200" height="200" style="left: 10px;"> 44 <rect class="content mask" x="50" y="50" width="150" height="150"/> 45 </svg> 46 <svg width="200" height="200" style="left: 220px;"> 47 <rect class="padding mask" x="50" y="50" width="150" height="150"/> 48 </svg> 49 <svg width="200" height="200" style="left: 10px; top: 220px;"> 50 <rect class="border mask" x="50" y="50" width="100" height="100" stroke="green" stroke-width="20"/> 51 </svg> 52 <svg width="200" height="200" style="left: 220px; top: 220px;"> 53 <rect class="margin mask" x="50" y="50" width="100" height="100" stroke="green" stroke-width="20"/> 54 </svg> 55 </body> 56 </html>