content/base/test/test_bug811701.xhtml

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/content/base/test/test_bug811701.xhtml	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,52 @@
     1.4 +<html xmlns="http://www.w3.org/1999/xhtml">
     1.5 +<!--
     1.6 +https://bugzilla.mozilla.org/show_bug.cgi?id=811701
     1.7 +-->
     1.8 +<head>
     1.9 +  <title>Test for Bug 811701</title>
    1.10 +  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    1.11 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    1.12 +</head>
    1.13 +<body>
    1.14 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=811701">Mozilla Bug 811701</a>
    1.15 +<p id="display"></p>
    1.16 +<div id="content" style="display: none">
    1.17 +<math xmlns="http://www.w3.org/1998/Math/MathML"><mtext>test</mtext></math>
    1.18 +<svg xmlns="http://www.w3.org/2000/svg"><polygon points="0,0 100,100 200,300"/></svg>
    1.19 +</div>
    1.20 +<pre id="test">
    1.21 +</pre>
    1.22 +  <script type="application/javascript">
    1.23 +  <![CDATA[
    1.24 +
    1.25 +
    1.26 +  /** Test for Bug 811701 **/
    1.27 +  var math = document.querySelector("math");
    1.28 +  is(math.innerHTML,
    1.29 +     '<mtext xmlns="http://www.w3.org/1998/Math/MathML">test</mtext>',
    1.30 +     "<math> should have innerHTML");
    1.31 +  is(math.outerHTML,
    1.32 +     '<math xmlns="http://www.w3.org/1998/Math/MathML"><mtext>test</mtext></math>',
    1.33 +     "<math> should have innerHTML");
    1.34 +  math.innerHTML = "<mo>+</mo>";
    1.35 +  is(math.firstChild.namespaceURI, "http://www.w3.org/1998/Math/MathML",
    1.36 +     "Should have the right namespace after setting innerHTML on <math>");
    1.37 +
    1.38 +  var polygon = document.querySelector("polygon");
    1.39 +  is(polygon.parentNode.innerHTML,
    1.40 +     '<polygon xmlns="http://www.w3.org/2000/svg" points="0,0 100,100 200,300"/>',
    1.41 +     "<svg> should have innerHTML");
    1.42 +  is(polygon.parentNode.outerHTML,
    1.43 +     '<svg xmlns="http://www.w3.org/2000/svg"><polygon points="0,0 100,100 200,300"/></svg>',
    1.44 +     "<svg> should have outerHTML");
    1.45 +  is(polygon.outerHTML, '<polygon xmlns="http://www.w3.org/2000/svg" points="0,0 100,100 200,300"/>',
    1.46 +     "<polygon> should have outerHTML");
    1.47 +
    1.48 +  var svg = document.querySelector("svg");
    1.49 +  svg.innerHTML = "<rect/>";
    1.50 +  is(svg.firstChild.namespaceURI, "http://www.w3.org/2000/svg",
    1.51 +     "Should have the right namespace after setting innerHTML on <math>");
    1.52 +  ]]>
    1.53 +</script>
    1.54 +</body>
    1.55 +</html>

mercurial