mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 20:05:49 +00:00
556ed99119
If the mathml.disabled preference is true, treat <math> and other MathML elements as generic XML elements. This patch disables the rendering code of MathML however preserves the namespace so to reduce the breakage. Original patch by: Kathy Brade <brade@pearlcrescent.com> MozReview-Commit-ID: A2f2Q2b4eqR --HG-- extra : rebase_source : 3c8530816727c01b68a831d560bfe16e7b02bd9d
48 lines
2.0 KiB
HTML
48 lines
2.0 KiB
HTML
<!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><foo></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&2<3>4 \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&2<3>4 \u003C/style></math>');
|
|
|
|
SimpleTest.finish();
|
|
}
|
|
</script>
|
|
</pre>
|
|
</body>
|
|
</html>
|
|
|