chromium/third_party/blink/web_tests/svg/custom/bug86119.html

<html>
  <head>
    <script>
      if (window.testRunner) {
        testRunner.dumpAsText();
      }

      function onload()
      {
        window.svgRoot = document.getElementById("svgRoot");
        window.svgViewBaseVal = window.svgRoot.viewBox.baseVal;

        // Cause GC of window.svgRoot.viewBox
        if (window.GCController)
          GCController.collect();

        // Set a value on window.svgViewBaseVal
        window.svgViewBaseVal.height = 56;
        if (window.svgRoot.viewBox.baseVal.height != 56)
          document.body.innerHTML = "FAIL";

        // Repeat with a non-dom-attached viewBox
        window.viewElement = parent.document.createElementNS("http://www.w3.org/2000/svg", "view");
        window.viewBaseVal = window.viewElement.viewBox.baseVal;
        if (window.GCController)
          GCController.collect();
        window.viewBaseVal.height = 12;
        if (window.viewElement.viewBox.baseVal.height != 12)
          document.body.innerHTML = "FAIL";
        else {
          document.body.appendChild(window.viewElement);
          window.viewBaseVal.height = 34;
          if (window.viewElement.viewBox.baseVal.height != 34)
            document.body.innerHTML = "FAIL";
        }
      }
    </script>
  </head>
  <body onload="onload()">
    Test for Bug 86119. Test passes if it does not crash and you see a green
    rectangle above this text.
    <svg id="svgRoot" width="100" height="100" xmlns:svg="http://www.w3.org/2000/svg">
      <rect x="10" height="80" width="80" y="10" fill="green"/>
    </svg>
  </body>
</html>