Luce packages
LuceLuce BaseLuciaOS

dymokomi/luce-browser-engine

Source of release 0.6.0

0.6.0 / src / web / svg / tests_svg_ii_cases.lucb

#==============================================================================================
#
#   tests_svg_ii_cases - SVG II elements (gradients, patterns, masks, clip paths, filter
#                        primitives, use, text, a, image, foreignObject) pinned to the reference
#                        build
#
#   DESCRIPTION:
#       Generated (a test vector table) from the output of a local oracle that runs the
#       reference Ladybird build's LibWeb on the same documents (luce-browser-tools,
#       oracles/luce-browser-engine/svg_elements: own_r56_cases.py, cases_r56.txt, oracle.cpp,
#       gen_luce_cases.py r56, build.sh). tests_svg_ii runs each case through the port and
#       compares the output; floats are their bits.
#
#==============================================================================================

## One oracle case: the mode, the document, and the reference build's output.
struct TestSvgIiCase:
    let mode: str
    let html: str
    let expected: str

## Every oracle case, in cases_r56.txt order.
let test_svg_ii_cases: TestSvgIiCase[20] = [
    TestSvgIiCase(mode = "grad", html = "<!DOCTYPE html><svg><linearGradient id=\"a\"><stop offset=\"0\"/><stop offset=\"0.5\"/><stop offset=\"100%\"/></linearGradient><radialGradient id=\"b\"/></svg>", expected = "linearGradient#a units 0 spread 0\n  transform none\n  linear 00000000% 00000000% 3f800000% 00000000%\n  stops 00000000 3f000000 3f800000\n  href \nradialGradient#b units 0 spread 0\n  transform none\n  radial 3f000000% 3f000000% 00000000% 3f000000% 3f000000% 3f000000%\n  stops\n  href \n"),
    TestSvgIiCase(mode = "grad", html = "<!DOCTYPE html><svg><linearGradient id=\"a\" gradientUnits=\"userSpaceOnUse\" spreadMethod=\"reflect\" gradientTransform=\"translate(10 20) scale(2)\" x1=\"10%\" y1=\"5\" x2=\"0.75\" y2=\"80%\"><stop offset=\"-1\"/><stop offset=\"2\"/></linearGradient><radialGradient id=\"b\" gradientUnits=\"objectBoundingBox\" spreadMethod=\"repeat\" cx=\"30%\" cy=\"0.4\" r=\"25%\" fx=\"10\" fy=\"20%\" fr=\"5%\"/></svg>", expected = "linearGradient#a units 1 spread 2\n  transform 40000000 00000000 00000000 40000000 41200000 41a00000\n  linear 3dcccccd% 40a00000n 3f400000n 3f4ccccd%\n  stops bf800000 40000000\n  href \nradialGradient#b units 0 spread 1\n  transform none\n  radial 41200000n 3e4ccccd% 3d4ccccd% 3e99999a% 3ecccccdn 3e800000%\n  stops\n  href \n"),
    TestSvgIiCase(mode = "grad", html = "<!DOCTYPE html><svg><linearGradient id=\"base\" x1=\"1\" y1=\"2\" x2=\"3\" y2=\"4\" spreadMethod=\"repeat\" gradientUnits=\"userSpaceOnUse\" gradientTransform=\"rotate(45)\"><stop offset=\"0.25\"/><stop offset=\"0.75\"/></linearGradient><linearGradient id=\"child\" href=\"#base\"/><linearGradient id=\"grandchild\" xlink:href=\"#child\" x2=\"50%\"/><radialGradient id=\"radial\" href=\"#base\" r=\"10\"/><linearGradient id=\"other\" href=\"#radial\"/></svg>", expected = "linearGradient#base units 1 spread 1\n  transform 3f3504f3 3f3504f3 bf3504f3 3f3504f3 00000000 00000000\n  linear 3f800000n 40000000n 40400000n 40800000n\n  stops 3e800000 3f400000\n  href \nlinearGradient#child units 1 spread 1\n  transform 3f3504f3 3f3504f3 bf3504f3 3f3504f3 00000000 00000000\n  linear 3f800000n 40000000n 40400000n 40800000n\n  stops 3e800000 3f400000\n  href #base\nlinearGradient#grandchild units 1 spread 1\n  transform 3f3504f3 3f3504f3 bf3504f3 3f3504f3 00000000 00000000\n  linear 3f800000n 40000000n 3f000000% 40800000n\n  stops 3e800000 3f400000\n  href #child\nradialGradient#radial units 1 spread 1\n  transform 3f3504f3 3f3504f3 bf3504f3 3f3504f3 00000000 00000000\n  radial 3f000000% 3f000000% 00000000% 3f000000% 3f000000% 41200000n\n  stops 3e800000 3f400000\n  href #base\nlinearGradient#other units 1 spread 1\n  transform 3f3504f3 3f3504f3 bf3504f3 3f3504f3 00000000 00000000\n  linear 00000000% 00000000% 3f800000% 00000000%\n  stops 3e800000 3f400000\n  href #radial\n"),
    TestSvgIiCase(mode = "grad", html = "<!DOCTYPE html><svg><linearGradient id=\"p\" href=\"#q\" x1=\"1\"/><linearGradient id=\"q\" href=\"#p\" y1=\"2\"/><linearGradient id=\"self\" href=\"#self\"/><radialGradient id=\"r1\" href=\"#r2\" fr=\"-5\"/><radialGradient id=\"r2\" r=\"-1\" fr=\"3\"/></svg>", expected = "linearGradient#p units 0 spread 0\n  transform none\n  linear 3f800000n 40000000n 3f800000% 00000000%\n  stops\n  href #q\nlinearGradient#q units 0 spread 0\n  transform none\n  linear 3f800000n 40000000n 3f800000% 00000000%\n  stops\n  href #p\nlinearGradient#self units 0 spread 0\n  transform none\n  linear 00000000% 00000000% 3f800000% 00000000%\n  stops\n  href #self\nradialGradient#r1 units 0 spread 0\n  transform none\n  radial 3f000000% 3f000000% 40400000n 3f000000% 3f000000% 3f000000%\n  stops\n  href #r2\nradialGradient#r2 units 0 spread 0\n  transform none\n  radial 3f000000% 3f000000% 40400000n 3f000000% 3f000000% 3f000000%\n  stops\n  href \n"),
    TestSvgIiCase(mode = "grad", html = "<!DOCTYPE html><svg><linearGradient id=\"bad\" gradientUnits=\"bogus\" spreadMethod=\"nope\" gradientTransform=\"translate(1\" x1=\"x\" y1=\"\" x2=\"1e400\"/><linearGradient id=\"empty\" href=\"\"/><linearGradient id=\"missing\" href=\"#nothing\"/><linearGradient id=\"notgrad\" href=\"#rect\"/><rect id=\"rect\"/></svg>", expected = "linearGradient#bad units 0 spread 0\n  transform none\n  linear 00000000% 00000000% 7f800000n 00000000%\n  stops\n  href \nlinearGradient#empty units 0 spread 0\n  transform none\n  linear 00000000% 00000000% 3f800000% 00000000%\n  stops\n  href \nlinearGradient#missing units 0 spread 0\n  transform none\n  linear 00000000% 00000000% 3f800000% 00000000%\n  stops\n  href #nothing\nlinearGradient#notgrad units 0 spread 0\n  transform none\n  linear 00000000% 00000000% 3f800000% 00000000%\n  stops\n  href #rect\n"),
    TestSvgIiCase(mode = "grad", html = "<!DOCTYPE html><svg><linearGradient id=\"stops\"><stop offset=\"0.1\"/><g><stop offset=\"0.9\"/></g><stop offset=\"30%\"/><stop/><stop offset=\"junk\"/></linearGradient><linearGradient id=\"noStops\" href=\"#stops\"/><radialGradient id=\"r\" href=\"#noStops\"><stop offset=\"1\"/></radialGradient></svg>", expected = "linearGradient#stops units 0 spread 0\n  transform none\n  linear 00000000% 00000000% 3f800000% 00000000%\n  stops 3dcccccd 3e99999a 00000000 00000000\n  href \nlinearGradient#noStops units 0 spread 0\n  transform none\n  linear 00000000% 00000000% 3f800000% 00000000%\n  stops 3dcccccd 3e99999a 00000000 00000000\n  href #stops\nradialGradient#r units 0 spread 0\n  transform none\n  radial 3f000000% 3f000000% 00000000% 3f000000% 3f000000% 3f000000%\n  stops 3f800000\n  href #noStops\n"),
    TestSvgIiCase(mode = "pattern", html = "<!DOCTYPE html><svg><pattern id=\"a\"/><pattern id=\"b\" patternUnits=\"userSpaceOnUse\" patternContentUnits=\"objectBoundingBox\" patternTransform=\"skewX(30)\" x=\"5\" y=\"10%\" width=\"0.5\" height=\"20\" viewBox=\"0 0 10 20\"><rect/></pattern></svg>", expected = "pattern#a units 0 content 1\n  transform none\n  rect 00000000n 00000000n 00000000n 00000000n\n  content none\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  width 00000000 0 00000000\n  height 00000000 0 00000000\n  viewbox none\npattern#b units 1 content 0\n  transform 3f800000 00000000 3f13cd3a 3f800000 00000000 00000000\n  rect 40a00000n 3dcccccd% 3f000000n 41a00000n\n  content pattern#b\n  x 40a00000 0 40a00000\n  y 3dcccccd 0 3dcccccd\n  width 3f000000 0 3f000000\n  height 41a00000 0 41a00000\n  viewbox 0000000000000000 0000000000000000 4024000000000000 4034000000000000\n"),
    TestSvgIiCase(mode = "pattern", html = "<!DOCTYPE html><svg><pattern id=\"base\" width=\"10\" height=\"10\" patternUnits=\"userSpaceOnUse\" patternTransform=\"scale(3)\"><rect/></pattern><pattern id=\"child\" href=\"#base\" x=\"2\"/><pattern id=\"grand\" xlink:href=\"#child\" height=\"50%\"/><pattern id=\"cycle1\" href=\"#cycle2\"/><pattern id=\"cycle2\" href=\"#cycle1\"/><pattern id=\"bad\" patternUnits=\"x\" patternTransform=\"nope\" width=\"-\"/></svg>", expected = "pattern#base units 1 content 1\n  transform 40400000 00000000 00000000 40400000 00000000 00000000\n  rect 00000000n 00000000n 41200000n 41200000n\n  content pattern#base\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  width 41200000 0 41200000\n  height 41200000 0 41200000\n  viewbox none\npattern#child units 1 content 1\n  transform 40400000 00000000 00000000 40400000 00000000 00000000\n  rect 40000000n 00000000n 41200000n 41200000n\n  content pattern#base\n  x 40000000 0 40000000\n  y 00000000 0 00000000\n  width 00000000 0 00000000\n  height 00000000 0 00000000\n  viewbox none\npattern#grand units 1 content 1\n  transform 40400000 00000000 00000000 40400000 00000000 00000000\n  rect 40000000n 00000000n 41200000n 3f000000%\n  content pattern#base\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  width 00000000 0 00000000\n  height 3f000000 0 3f000000\n  viewbox none\npattern#cycle1 units 0 content 1\n  transform none\n  rect 00000000n 00000000n 00000000n 00000000n\n  content none\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  width 00000000 0 00000000\n  height 00000000 0 00000000\n  viewbox none\npattern#cycle2 units 0 content 1\n  transform none\n  rect 00000000n 00000000n 00000000n 00000000n\n  content none\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  width 00000000 0 00000000\n  height 00000000 0 00000000\n  viewbox none\npattern#bad units 0 content 1\n  transform none\n  rect 00000000n 00000000n 00000000n 00000000n\n  content none\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  width 00000000 0 00000000\n  height 00000000 0 00000000\n  viewbox none\n"),
    TestSvgIiCase(mode = "maskclip", html = "<!DOCTYPE html><svg><mask id=\"m1\"/><mask id=\"m2\" maskUnits=\"userSpaceOnUse\" maskContentUnits=\"objectBoundingBox\"/><mask id=\"m3\" maskUnits=\"bogus\" maskContentUnits=\"userSpaceOnUse\"/><clipPath id=\"c1\"/><clipPath id=\"c2\" clipPathUnits=\"objectBoundingBox\"/><clipPath id=\"c3\" clipPathUnits=\"userSpaceOnUse\"/></svg>", expected = "mask#m1 units 0 content 1\n  active none\n  area 40 980 7600 3800\nmask#m2 units 1 content 0\n  active 0000000000000000 0000000000000000 3ff0000000000000 3ff0000000000000\n  area 40 980 7600 3800\nmask#m3 units 0 content 1\n  active none\n  area 40 980 7600 3800\nclipPath#c1 units 1\n  active none\nclipPath#c2 units 0\n  active 0000000000000000 0000000000000000 3ff0000000000000 3ff0000000000000\nclipPath#c3 units 1\n  active none\n"),
    TestSvgIiCase(mode = "fe", html = "<!DOCTYPE html><svg><filter id=\"f\"><feBlend in=\"SourceGraphic\" in2=\"a\" mode=\"multiply\" result=\"b\"/><feBlend mode=\"bogus\"/><feBlend mode=\"color-dodge\"/><feColorMatrix type=\"saturate\" values=\"0.5\"/><feColorMatrix/><feColorMatrix type=\"hueRotate\"/><feColorMatrix type=\"LUMINANCEtoALPHA\"/><feColorMatrix type=\"nope\"/><feComponentTransfer in=\"x\"><feFuncR/></feComponentTransfer></filter></svg>", expected = "filter#f units 0 primitive 1\n  x 00000000 0 00000000\n  width 00000000 0 00000000\nfeBlend\n  in [SourceGraphic]\n  in2 [a]\n  mode 2 2\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  width 00000000 0 00000000\n  height 00000000 0 00000000\n  result [b]\nfeBlend\n  in []\n  in2 []\n  mode 1 1\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  width 00000000 0 00000000\n  height 00000000 0 00000000\n  result []\nfeBlend\n  in []\n  in2 []\n  mode 7 7\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  width 00000000 0 00000000\n  height 00000000 0 00000000\n  result []\nfeColorMatrix\n  in []\n  type 2\n  values [0.5]\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  width 00000000 0 00000000\n  height 00000000 0 00000000\n  result []\nfeColorMatrix\n  in []\n  type 1\n  values []\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  width 00000000 0 00000000\n  height 00000000 0 00000000\n  result []\nfeColorMatrix\n  in []\n  type 3\n  values []\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  width 00000000 0 00000000\n  height 00000000 0 00000000\n  result []\nfeColorMatrix\n  in []\n  type 4\n  values []\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  width 00000000 0 00000000\n  height 00000000 0 00000000\n  result []\nfeColorMatrix\n  in []\n  type 0\n  values []\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  width 00000000 0 00000000\n  height 00000000 0 00000000\n  result []\nfeComponentTransfer\n  in [x]\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  width 00000000 0 00000000\n  height 00000000 0 00000000\n  result []\n"),
    TestSvgIiCase(mode = "fe", html = "<!DOCTYPE html><svg><filter id=\"g\" filterUnits=\"userSpaceOnUse\" primitiveUnits=\"objectBoundingBox\" x=\"10\" width=\"50%\"><feComposite in=\"a\" in2=\"b\" operator=\"arithmetic\" k1=\"1\" k2=\"-0.5\" k3=\"2e1\" k4=\"x\"/><feComposite operator=\"xor\"/><feComposite operator=\"lighter\"/><feComposite operator=\"in\"/><feComposite/><feDisplacementMap in=\"a\" in2=\"b\" scale=\"10\" xChannelSelector=\"R\" yChannelSelector=\"G\"/><feDisplacementMap xChannelSelector=\"b\" yChannelSelector=\"A\"/><feDropShadow dx=\"3\" dy=\"-4\" stdDeviation=\"5 6\"/><feDropShadow stdDeviation=\"7\"/><feFlood/></filter></svg>", expected = "filter#g units 1 primitive 0\n  x 00000000 0 00000000\n  width 00000000 0 00000000\nfeComposite\n  in [a]\n  in2 [b]\n  k 3f800000 bf000000 41a00000 00000000\n  operator 6 6\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  width 00000000 0 00000000\n  height 00000000 0 00000000\n  result []\nfeComposite\n  in []\n  in2 []\n  k 00000000 00000000 00000000 00000000\n  operator 5 5\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  width 00000000 0 00000000\n  height 00000000 0 00000000\n  result []\nfeComposite\n  in []\n  in2 []\n  k 00000000 00000000 00000000 00000000\n  operator 0 0\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  width 00000000 0 00000000\n  height 00000000 0 00000000\n  result []\nfeComposite\n  in []\n  in2 []\n  k 00000000 00000000 00000000 00000000\n  operator 2 2\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  width 00000000 0 00000000\n  height 00000000 0 00000000\n  result []\nfeComposite\n  in []\n  in2 []\n  k 00000000 00000000 00000000 00000000\n  operator 1 1\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  width 00000000 0 00000000\n  height 00000000 0 00000000\n  result []\nfeDisplacementMap\n  in [a]\n  in2 [b]\n  scale 41200000\n  channels 1 2\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  width 00000000 0 00000000\n  height 00000000 0 00000000\n  result []\nfeDisplacementMap\n  in []\n  in2 []\n  scale 00000000\n  channels 4 4\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  width 00000000 0 00000000\n  height 00000000 0 00000000\n  result []\nfeDropShadow\n  in []\n  d 40400000 c0800000\n  std 40a00000 40c00000\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  width 00000000 0 00000000\n  height 00000000 0 00000000\n  result []\n  set [1.25 0.1] 3fa00000 3dcccccd\nfeDropShadow\n  in []\n  d 40000000 40000000\n  std 40e00000 40e00000\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  width 00000000 0 00000000\n  height 00000000 0 00000000\n  result []\n  set [1.25 0.1] 3fa00000 3dcccccd\nfeFlood\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  width 00000000 0 00000000\n  height 00000000 0 00000000\n  result []\n"),
    TestSvgIiCase(mode = "fe", html = "<!DOCTYPE html><svg><filter><feGaussianBlur in=\"SourceAlpha\" stdDeviation=\"2.5\" edgeMode=\"wrap\"/><feGaussianBlur stdDeviation=\"1 3\"/><feImage result=\"img\"/><feMerge><feMergeNode in=\"a\"/><feMergeNode/></feMerge><feMorphology operator=\"dilate\" radius=\"2 4\"/><feMorphology operator=\"ERODE\" radius=\"3\"/><feMorphology/><feMorphology operator=\"x\"/><feOffset dx=\"1.5\"/><feOffset dy=\"2\" dx=\"-1\"/><feTurbulence baseFrequency=\"0.05 0.1\" numOctaves=\"3\" seed=\"7.5\" stitchTiles=\"stitch\" type=\"fractalNoise\"/><feTurbulence baseFrequency=\"0.2\" stitchTiles=\"x\" type=\"y\"/></filter></svg>", expected = "filter units 0 primitive 1\n  x 00000000 0 00000000\n  width 00000000 0 00000000\nfeGaussianBlur\n  in [SourceAlpha]\n  std 40200000 40200000 edge 0\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  width 00000000 0 00000000\n  height 00000000 0 00000000\n  result []\nfeGaussianBlur\n  in []\n  std 3f800000 40400000 edge 0\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  width 00000000 0 00000000\n  height 00000000 0 00000000\n  result []\nfeImage\n  href []\n  bitmap none\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  width 00000000 0 00000000\n  height 00000000 0 00000000\n  result [img]\nfeMerge\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  width 00000000 0 00000000\n  height 00000000 0 00000000\n  result []\nfeMergeNode\n  in [a]\nfeMergeNode\n  in []\nfeMorphology\n  in []\n  operator 2 2\n  radius 40000000 40800000\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  width 00000000 0 00000000\n  height 00000000 0 00000000\n  result []\nfeMorphology\n  in []\n  operator 1 1\n  radius 40400000 40400000\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  width 00000000 0 00000000\n  height 00000000 0 00000000\n  result []\nfeMorphology\n  in []\n  operator 1 1\n  radius 00000000 00000000\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  width 00000000 0 00000000\n  height 00000000 0 00000000\n  result []\nfeMorphology\n  in []\n  operator 2 2\n  radius 00000000 00000000\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  width 00000000 0 00000000\n  height 00000000 0 00000000\n  result []\nfeOffset\n  in []\n  d 3fc00000 00000000\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  width 00000000 0 00000000\n  height 00000000 0 00000000\n  result []\nfeOffset\n  in []\n  d bf800000 40000000\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  width 00000000 0 00000000\n  height 00000000 0 00000000\n  result []\nfeTurbulence\n  frequency 3d4ccccd 3dcccccd\n  octaves 3 seed 40f00000\n  stitch 1 type 1\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  width 00000000 0 00000000\n  height 00000000 0 00000000\n  result []\nfeTurbulence\n  frequency 3e4ccccd 3e4ccccd\n  octaves 1 seed 00000000\n  stitch 2 type 2\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  width 00000000 0 00000000\n  height 00000000 0 00000000\n  result []\n"),
    TestSvgIiCase(mode = "use", html = "<!DOCTYPE html><svg><defs><symbol id=\"ref\" viewBox=\"0 0 10 10\"><rect width=\"5\" height=\"5\"/></symbol></defs><use href=\"#ref\" x=\"10\" y=\"20\" width=\"30\"/><use href=\"#ref\" height=\"7\" transform=\"scale(2)\"/></svg>", expected = "use use\n  x 41200000 0 41200000\n  y 41a00000 0 41a00000\n  matrix 3f800000 00000000 00000000 3f800000 41200000 41a00000\n  instance symbol#ref\n  shadow 1 sheets 1\n    symbol#ref\n    rect width=5\nuse use\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  matrix 40000000 00000000 00000000 40000000 00000000 00000000\n  instance symbol#ref\n  shadow 1 sheets 1\n    symbol#ref\n    rect width=5\nremoved use\n  x 41200000 0 41200000\n  y 41a00000 0 41a00000\n  matrix 3f800000 00000000 00000000 3f800000 41200000 41a00000\n  instance none\n  shadow 0 sheets 1\nremoved use\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  matrix 40000000 00000000 00000000 40000000 00000000 00000000\n  instance none\n  shadow 0 sheets 1\n"),
    TestSvgIiCase(mode = "use", html = "<!DOCTYPE html><svg><svg id=\"ref\" width=\"1\" height=\"2\"><circle r=\"1\"/></svg><g id=\"g\"><rect id=\"inner\"/></g><use xlink:href=\"#ref\" x=\"1.5\"/><use href=\"#g\"/><use href=\"#missing\"/><use href=\"#later\"/><g id=\"later\"/><use href=\"#notsvg\"/></svg><div id=\"notsvg\"></div>", expected = "use use\n  x 3fc00000 0 3fc00000\n  y 00000000 0 00000000\n  matrix 3f800000 00000000 00000000 3f800000 3fc00000 00000000\n  instance svg#ref\n  shadow 1 sheets 1\n    svg#ref width=1\n    circle\nuse use\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  matrix 3f800000 00000000 00000000 3f800000 00000000 00000000\n  instance g#g\n  shadow 1 sheets 1\n    g#g\n    rect#inner\nuse use\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  matrix 3f800000 00000000 00000000 3f800000 00000000 00000000\n  instance none\n  shadow 0 sheets 0\nuse use\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  matrix 3f800000 00000000 00000000 3f800000 00000000 00000000\n  instance none\n  shadow 0 sheets 0\nuse use\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  matrix 3f800000 00000000 00000000 3f800000 00000000 00000000\n  instance none\n  shadow 0 sheets 0\nremoved use\n  x 3fc00000 0 3fc00000\n  y 00000000 0 00000000\n  matrix 3f800000 00000000 00000000 3f800000 3fc00000 00000000\n  instance none\n  shadow 0 sheets 1\nremoved use\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  matrix 3f800000 00000000 00000000 3f800000 00000000 00000000\n  instance g#g\n  shadow 1 sheets 1\n    g#g\n    rect#inner\nremoved use\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  matrix 3f800000 00000000 00000000 3f800000 00000000 00000000\n  instance none\n  shadow 0 sheets 0\nremoved use\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  matrix 3f800000 00000000 00000000 3f800000 00000000 00000000\n  instance none\n  shadow 0 sheets 0\nremoved use\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  matrix 3f800000 00000000 00000000 3f800000 00000000 00000000\n  instance none\n  shadow 0 sheets 0\n"),
    TestSvgIiCase(mode = "use", html = "<!DOCTYPE html><svg><g id=\"a\"><use href=\"#b\"/></g><g id=\"b\"><use href=\"#a\"/></g><use id=\"self\" href=\"#self\"/><g id=\"ref\"><use href=\"#a\"/></g><use href=\"#ref\" x=\"x\" y=\"-3\"/></svg>", expected = "use use\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  matrix 3f800000 00000000 00000000 3f800000 00000000 00000000\n  instance none\n  shadow 0 sheets 0\nuse use\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  matrix 3f800000 00000000 00000000 3f800000 00000000 00000000\n  instance g#a\n  shadow 1 sheets 1\n    g#a\n    use\nuse use#self\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  matrix 3f800000 00000000 00000000 3f800000 00000000 00000000\n  instance none\n  shadow 0 sheets 0\nuse use\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  matrix 3f800000 00000000 00000000 3f800000 00000000 00000000\n  instance none\n  shadow 0 sheets 1\nuse use\n  x 00000000 0 00000000\n  y c0400000 0 c0400000\n  matrix 3f800000 00000000 00000000 3f800000 00000000 c0400000\n  instance none\n  shadow 0 sheets 1\nremoved use\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  matrix 3f800000 00000000 00000000 3f800000 00000000 00000000\n  instance none\n  shadow 0 sheets 0\nremoved use\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  matrix 3f800000 00000000 00000000 3f800000 00000000 00000000\n  instance g#a\n  shadow 1 sheets 1\n    g#a\n    use\nremoved use#self\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  matrix 3f800000 00000000 00000000 3f800000 00000000 00000000\n  instance none\n  shadow 0 sheets 0\nremoved use\n  x 00000000 0 00000000\n  y c0400000 0 c0400000\n  matrix 3f800000 00000000 00000000 3f800000 00000000 c0400000\n  instance none\n  shadow 0 sheets 1\n"),
    TestSvgIiCase(mode = "text", html = "<!DOCTYPE html><svg><text x=\"10\" y=\"20px\" dx=\"5%\" dy=\"2em\" rotate=\"45\">  Hello  <tspan x=\"1 2\" dy=\"-3\">span</tspan></text><text x=\"bogus\" rotate=\"10%\">été</text><text/></svg>", expected = "text chars 5 [Hello]\n  x n4024000000000000\n  y l20px\n  dx l5%\n  dy l2em\n  list x 41200000/1\n  list y 00000000/1\n  list dx 3d4ccccd/1\n  list dy 00000000/1\n  rotate 42340000\ntspan chars 4 [span]\n  x n3ff0000000000000\n  y\n  dx\n  dy nc008000000000000\n  list x 00000000/1\n  list y 00000000/1\n  list dx 00000000/1\n  list dy c0400000/1\n  rotate 00000000\ntext chars 3 [été]\n  x\n  y\n  dx\n  dy\n  list x 00000000/1\n  list y 00000000/1\n  list dx 00000000/1\n  list dy 00000000/1\n  rotate 00000000\ntext chars 0 []\n  x\n  y\n  dx\n  dy\n  list x 00000000/1\n  list y 00000000/1\n  list dx 00000000/1\n  list dy 00000000/1\n  rotate 00000000\n"),
    TestSvgIiCase(mode = "text", html = "<!DOCTYPE html><svg><path id=\"p\" d=\"M0 0 L10 10\"/><rect id=\"r\"/><text><textPath href=\"#p\">along</textPath><textPath xlink:href=\"#r\">rect</textPath><textPath href=\"#none\">x</textPath><textPath>y</textPath><textPath href=\"#t\">z</textPath></text><g id=\"t\"/></svg>", expected = "text chars 0 []\n  x\n  y\n  dx\n  dy\n  list x 00000000/1\n  list y 00000000/1\n  list dx 00000000/1\n  list dy 00000000/1\n  rotate 00000000\ntextPath chars 5 [along]\n  path path#p\ntextPath chars 4 [rect]\n  path none\ntextPath chars 1 [x]\n  path none\ntextPath chars 1 [y]\n  path none\ntextPath chars 1 [z]\n  path none\n"),
    TestSvgIiCase(mode = "a", html = "<!DOCTYPE html><svg><a href=\"x\" target=\"_blank\" rel=\"noopener  nofollow\"><rect/></a><a xlink:href=\"y\"/><a/></svg>", expected = "a\n  target [_blank]\n  rel 2 [noopener  nofollow]\n  tabindex 0 activation 1\n  href [x]\na\n  target []\n  rel 0 []\n  tabindex 0 activation 1\n  href [y]\na\n  target []\n  rel 0 []\n  tabindex 0 activation 1\n  href []\n"),
    TestSvgIiCase(mode = "image", html = "<!DOCTYPE html><svg><image x=\"5\" y=\"6\" width=\"70\" height=\"80\"/><image width=\"10\"/><image/><image x=\"bogus\" height=\"-2\"/></svg>", expected = "image\n  x 40a00000 1 00000000\n  y 40c00000 1 00000000\n  width 428c0000 1 00000000\n  height 42a00000 1 00000000\n  box 40a00000 40c00000 428c0000 42a00000\n  available 0\nimage\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  width 41200000 1 00000000\n  height 00000000 0 00000000\n  box 00000000 00000000 41200000 00000000\n  available 0\nimage\n  x 00000000 0 00000000\n  y 00000000 0 00000000\n  width 00000000 0 00000000\n  height 00000000 0 00000000\n  box 00000000 00000000 00000000 00000000\n  available 0\nimage\n  x 00000000 1 00000000\n  y 00000000 0 00000000\n  width 00000000 0 00000000\n  height c0000000 1 00000000\n  box 00000000 00000000 00000000 c0000000\n  available 0\n"),
    TestSvgIiCase(mode = "fo", html = "<!DOCTYPE html><svg><foreignObject x=\"5\" width=\"10\"></foreignObject></svg>", expected = "foreignObject\n  x 00000000 0 00000000\n  height 00000000 0 00000000\n"),
]