mask-origin-3.html (1684B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title>CSS Masking: mask-origin: mask positioning area</title> 6 <link rel="author" title="CJ Ku" href="mailto:cku@mozilla.com"> 7 <link rel="author" title="Mozilla" href="https://www.mozilla.org"> 8 <link rel="help" href="https://www.w3.org/TR/css-masking-1/#the-mask-origin"> 9 <link rel="match" href="mask-origin-3-ref.html"> 10 <meta name="assert" content="Test checks whether setting mask position area works correctly or not."> 11 <style type="text/css"> 12 svg { 13 position: absolute; 14 top: 10px; 15 border: 1px solid black; 16 } 17 rect.mask { 18 fill: blue; 19 mask-origin: fill-box; 20 mask-clip: fill-box; 21 mask-repeat: no-repeat; 22 mask-image: url(support/50x50-opaque-blue.svg); 23 } 24 25 rect.view { 26 mask-origin: view-box; 27 mask-clip: view-box; 28 } 29 30 rect.fill { 31 mask-origin: fill-box; 32 mask-clip: stroke-box; 33 } 34 35 rect.stroke { 36 mask-origin: stroke-box; 37 mask-clip: stroke-box; 38 } 39 </style> 40 </head> 41 <body> 42 <svg width="200" height="200" viewBox="0 0 100 100" preserveAspectRatio="none" style="left: 10px;"> 43 <rect class="view mask" x="25" y="25" width="100" height="100"/> 44 </svg> 45 <svg width="200" height="200" style="left: 240px;"> 46 <rect class="fill mask" x="50" y="50" width="80" height="80" stroke="green" stroke-width="20"/> 47 </svg> 48 <svg width="200" height="200" style="left: 10px; top: 220px;"> 49 <rect class="stroke mask" x="70" y="50" width="80" height="80" stroke="green" stroke-width="20"/> 50 </svg> 51 </body> 52 </html>