summaryrefslogtreecommitdiffstats
path: root/layout/mathml/tests/test_disabled.html
blob: 9b649d0f9c45ab6a09aa973d8981fd9ee613ea9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<!DOCTYPE HTML>
<html>
<!--
Copied from
https://bugzilla.mozilla.org/show_bug.cgi?id=744830
-->
<head>
  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=166235">Mozilla Bug 166235</a>
<div id="testnodes"><span>hi</span> there <!-- mon ami --></div>
<pre id="test">
<script type="application/javascript">
  SimpleTest.waitForExplicitFinish();
  SpecialPowers.pushPrefEnv({"set": [["mathml.disabled", true]]}, doTest);
  function doTest() {
    let t = document.getElementById('testnodes');
    t.innerHTML = null;
    t.appendChild(document.createElementNS("http://www.w3.org/1998/Math/MathML", "math:math"));
    t.firstChild.textContent = "<foo>";
    is(t.innerHTML, "<math:math>&lt;foo&gt;</math:math>");

    t.innerHTML = null;
    t.appendChild(document.createElementNS("http://www.w3.org/1998/Math/MathML", "math"));
    is(t.firstChild.namespaceURI, "http://www.w3.org/1998/Math/MathML");
    t.firstChild.appendChild(document.createElementNS("http://www.w3.org/1998/Math/MathML", "script"));
    is(t.firstChild.firstChild.namespaceURI, "http://www.w3.org/1998/Math/MathML");
    t.firstChild.firstChild.textContent = "1&2<3>4\xA0";
    is(t.innerHTML, '<math><script>1&amp;2&lt;3&gt;4&nbsp;\u003C/script></math>');

    t.innerHTML = null;
    t.appendChild(document.createElementNS("http://www.w3.org/1998/Math/MathML", "math"));
    is(t.firstChild.namespaceURI, "http://www.w3.org/1998/Math/MathML");
    t.firstChild.appendChild(document.createElementNS("http://www.w3.org/1998/Math/MathML", "style"));
    is(t.firstChild.firstChild.namespaceURI, "http://www.w3.org/1998/Math/MathML");
    t.firstChild.firstChild.textContent = "1&2<3>4\xA0";
    is(t.innerHTML, '<math><style>1&amp;2&lt;3&gt;4&nbsp;\u003C/style></math>');

    SimpleTest.finish();
  }
</script>
</pre>
</body>
</html>