mask-composite-1c.html (1525B)
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-1-ref.html"> 10 <meta name="assert" content="Test checks that vector-mask-image can be composed correctly by different mask-composite value."> 11 <svg height="0"> 12 <mask id="rectMask" 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 </svg> 16 <style type="text/css"> 17 div { 18 background-color: blue; 19 position: absolute; 20 margin: 0px; 21 padding: 0px; 22 width: 100px; 23 height: 100px; 24 top:10px; 25 mask-image: url(#rectMask), 26 url(#rectMask); 27 } 28 29 div.add { 30 left: 10px; 31 mask-composite: add; 32 } 33 34 div.subtract { 35 left: 120px; 36 mask-composite: subtract; 37 } 38 39 div.intersect { 40 left: 230px; 41 mask-composite: intersect; 42 } 43 44 div.exclude { 45 left: 340px; 46 mask-composite: exclude; 47 } 48 </style> 49 </head> 50 <body> 51 <div class="add"></div> 52 <div class="subtract"></div> 53 <div class="intersect"></div> 54 <div class="exclude"></div> 55 </body> 56 </html>