mask-composite-2c.html (1686B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title>CSS Masking: mask-composite: compose SVG mask</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="http://www.w3.org/TR/css-masking-1/#the-mask-composite"> 9 <link rel="match" href="mask-composite-2-ref.html"> 10 <meta name="assert" content="Test checks that svg-mask can be composed correctly by different mask-composite value."> 11 <svg height="0"> 12 <mask id="rectMask1" x="0" y="0" width="100" height="100" > 13 <rect x="0" y="50" width="100" height="50" style="stroke:none; fill: #ffffff"/> 14 </mask> 15 <mask id="rectMask2" x="0" y="0" width="100" height="100" > 16 <rect x="0" y="0" width="100" height="50" style="stroke:none; fill: #ffffff"/> 17 </mask> 18 </svg> 19 <style type="text/css"> 20 div { 21 background-color: blue; 22 position: absolute; 23 margin: 0px; 24 padding: 0px; 25 width: 100px; 26 height: 100px; 27 top:10px; 28 mask-image: url(#rectMask1), 29 url(#rectMask2); 30 } 31 32 div.add { 33 left: 10px; 34 mask-composite: add; 35 } 36 37 div.subtract { 38 left: 120px; 39 mask-composite: subtract; 40 } 41 42 div.intersect { 43 left: 230px; 44 mask-composite: intersect; 45 } 46 47 div.exclude { 48 left: 340px; 49 mask-composite: exclude; 50 } 51 </style> 52 </head> 53 <body> 54 <div class="add"></div> 55 <div class="subtract"></div> 56 <div class="intersect"></div> 57 <div class="exclude"></div> 58 </body> 59 </html>