blob: 8c7c2df15039f587a34232640a06b77aa4b373d8 [file] [log] [blame]
<!DOCTYPE html>
#mask {
width: 200px;
height: 200px;
background-color: red;
-webkit-mask-image: linear-gradient(black, black), linear-gradient(90deg, black, black);
-webkit-mask-size: 50% 100%, 100% 50%;
-webkit-mask-repeat: no-repeat;
#cover {
width: 100px;
height: 100px;
background-color: green;
position: absolute;
left: 0;
top: 0;
div {
display: inline-block;
<p>There should be 2 green squares and a green rectangle below and no red.</p>
<div style="position: absolute">
<div id="mask" style="-webkit-mask-composite: source-in;"></div>
<div id="cover"></div>
<div id="mask" style="-webkit-mask-composite: source-out;"></div>
<div id="cover" style="left: 204px;top:100px;"></div>
<div id="mask" style="-webkit-mask-composite: source-out; -webkit-mask-size: 50px; -webkit-mask-position: bottom right, top left;"></div>
<div id="cover" style="left: 558px; top:0px; height: 200px; width: 50px;"></div>