dom/smil/test/test_smilWithXlink.xhtml
author Mike Hommey <mh+mozilla@glandium.org>
Fri, 02 Jun 2017 15:07:58 +0900
changeset 410640 f360dd9d411e7ba61531bed2c32a0981cc6c418a
parent 392127 98785831bbb882a30692dfeca09c7614c83941f8
child 528458 ba6f655fd68963530c866d0d4a48c3db3d307777
permissions -rw-r--r--
Bug 1369622 - Restore static asserts for lack of arguments on some macros. r=froydnj Bug 1368932 removed MOZ_STATIC_ASSERT_VALID_ARG_COUNT because it didn't actually work for large numbers of arguments. But it was kind of useful for macros that expand to something broken when they are given no variadic argument at all. Now that we have a macro that doesn't require tricks to count empty arguments lists, however, we can use straightforward static_asserts instead of a generic macro, which has the side effect of providing more context in the error message.

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>Test for animate with xlink:href attribute.</title>
  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
  <style>
    div#target {
      width: 300px;
      height: 100px;
      background-color: red;
    }
  </style>
</head>
<body>
<p id="display"></p>
<div id="target"></div>
<svg xmlns="http://www.w3.org/2000/svg"
     xmlns:xlink="http://www.w3.org/1999/xlink"
     id="svg">
  <animate xlink:href="#target"
           attributeName="width" from="0" to="200" dur="10s" fill="freeze"/>
</svg>
<pre id="test">
<script class="testbody" type="text/javascript">
<![CDATA[
SimpleTest.waitForExplicitFinish();

function runTest() {
  var svg = document.getElementById("svg");
  var target = document.getElementById("target");

  svg.pauseAnimations();
  svg.setCurrentTime(5);

  var cs = getComputedStyle(target);
  is(cs.width, "100px", "SMIL should affect outer element.");

  SimpleTest.finish();
  return;
}

window.addEventListener("load", runTest);

]]>
</script>
</pre>
</body>
</html>