| <!DOCTYPE html> |
| <html> |
| <head> |
| <style> |
| p { |
| margin: 0px; |
| } |
| #maskedElement { |
| width: 300px; |
| height: 400px; |
| background-color: green; |
| -webkit-mask-image:url('resources/masks.svg#lowerHalf'); |
| } |
| #redSvg { |
| position: absolute; |
| } |
| </style> |
| </head> |
| |
| <body> |
| <p><a href="https://bugs.webkit.org/show_bug.cgi?id=129682">Bug 129682</a> - On success, you should see four blue squares and no red.</p> |
| <p>This test sets the mask-image via CSS to a <mask> element from an SVG file and then changes it to the entire SVG file via a script.</p> |
| <svg id="redSvg" width="300px" height="400px"> |
| <rect x="5px" y="45px" width="140px" height="140px" fill="red"/> |
| <rect x="155px" y="45px" width="140px" height="140px" fill="red"/> |
| <rect x="155px" y="215px" width="140px" height="140px" fill="red"/> |
| <rect x="5px" y="215px" width="140px" height="140px" fill="red"/> |
| </svg> |
| <div id="maskedElement"></div> |
| |
| <script> |
| var maskedElement = document.getElementById("maskedElement"); |
| maskedElement.style.cssText += "-webkit-mask-image:url('resources/masks.svg');background-color:blue"; |
| </script> |
| </body> |
| </html> |