mask-extref-dataURI-01.svg 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <!--
  2. Any copyright is dedicated to the Public Domain.
  3. http://creativecommons.org/publicdomain/zero/1.0/
  4. -->
  5. <!DOCTYPE svg [
  6. <!-- entities etc. here -->
  7. <!ENTITY dataURI
  8. "data:image/svg+xml,&lt;svg xmlns='http://www.w3.org/2000/svg'&gt;&lt;g id='empty'/&gt;&lt;mask id='mask' maskContentUnits='userSpaceOnUse'&gt;&lt;rect width='50' height='50' fill='white'/&gt;&lt;/mask&gt;&lt;/svg&gt;">
  9. ]>
  10. <svg xmlns="http://www.w3.org/2000/svg"
  11. xmlns:xlink="http://www.w3.org/1999/xlink">
  12. <title>
  13. Testcase for bug 686013: CSS mask targeting a fragment in a data URI
  14. </title>
  15. <style type="text/css">
  16. .masked {
  17. mask: url("&dataURI;#mask");
  18. }
  19. </style>
  20. <!-- use an empty g to force resource document to load before onload -->
  21. <use xlink:href="&dataURI;#empty"/>
  22. <!-- giant lime background -->
  23. <rect width="100%" height="100%" fill="lime"/>
  24. <!-- Masked red rect, covered by lime rect
  25. (to make sure mask doesn't let too much through) -->
  26. <rect width="75" height="75" fill="red" class="masked"/>
  27. <rect width="50" height="50" fill="lime"/>
  28. <!-- Masked lime rect, covering red rect
  29. (to make sure mask lets enough through) -->
  30. <g transform="translate(0, 100)">
  31. <rect width="50" height="50" fill="red"/>
  32. <rect width="75" height="75" fill="lime" class="masked"/>
  33. </g>
  34. </svg>