boxshadow-inner-basic-ref.svg 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <svg xmlns="http://www.w3.org/2000/svg" version="1.1">
  2. <!-- This reference SVG must perform *exactly* the same path construction,
  3. clipping, and filling operations that PaintBoxShadowInner does for
  4. the HTML test file. If it doesn't match perfectly, antialiased
  5. pixels at the curved edges will not agree.
  6. PaintBoxShadowInner defines both its second (nonrectangular)
  7. clipping path and its fill path as the even-odd-rule compositions
  8. of two rectangles, one with nonzero corner radius. It is
  9. impossible to express "the path consisting of the even-odd-rule
  10. composition of two |rect| elements" in SVG. This is a minor
  11. nuisance because we have to write everything out using |path|,
  12. plus a major nuisance because Gecko uses the same ellipse-to-
  13. Bezier conversion for rounded rectangles in SVG and HTML, but the
  14. SVG 'A' operator uses a different one. Therefore we cannot use 'A'.
  15. The 'C' parameters here were obtained by dumping out the cairo
  16. operations used to draw the HTML, using cairo-trace. -->
  17. <defs>
  18. <clipPath id="outer">
  19. <rect x="16" y="16" width="240" height="240"/>
  20. </clipPath>
  21. <clipPath id="inner">
  22. <path clip-rule="evenodd"
  23. d="M 248 16
  24. H 24 C 19.58468 16 16 19.58468 16 24
  25. V 248 C 16 252.41532 19.58468 256 24 256
  26. H 248 C 252.41532 256 256 252.41532 256 248
  27. V 24 C 256 19.58468 252.41532 16 248 16 Z
  28. M 48 56 H 272 V 296 H 48 Z"/>
  29. </clipPath>
  30. </defs>
  31. <g clip-path="url(#outer)">
  32. <path fill="grey" fill-rule="evenodd" clip-path="url(#inner)"
  33. d="M 16 16 H 256 V 256 H 16 Z
  34. M 280 48
  35. H 56 C 51.58468 48 48 51.58468 48 56
  36. V 280 C 48 284.41532 51.58468 288 56 288
  37. H 280 C 284.41532 288 288 284.41532 288 280
  38. V 56 C 288 51.58468 284.41532 48 280 48 Z"/>
  39. </g>
  40. </svg>