summaryrefslogtreecommitdiffstats
path: root/layout/mathml/tests
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /layout/mathml/tests
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'layout/mathml/tests')
-rw-r--r--layout/mathml/tests/chrome.toml6
-rw-r--r--layout/mathml/tests/test_disabled_chrome.html34
-rw-r--r--layout/mathml/tests/test_disabled_chrome_iframe.html4
3 files changed, 44 insertions, 0 deletions
diff --git a/layout/mathml/tests/chrome.toml b/layout/mathml/tests/chrome.toml
new file mode 100644
index 0000000000..ec3d54556e
--- /dev/null
+++ b/layout/mathml/tests/chrome.toml
@@ -0,0 +1,6 @@
+[DEFAULT]
+
+support-files = ["test_disabled_chrome_iframe.html"]
+prefs = ["mathml.disabled=true"]
+
+["test_disabled_chrome.html"]
diff --git a/layout/mathml/tests/test_disabled_chrome.html b/layout/mathml/tests/test_disabled_chrome.html
new file mode 100644
index 0000000000..cecba95327
--- /dev/null
+++ b/layout/mathml/tests/test_disabled_chrome.html
@@ -0,0 +1,34 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=1173199
+-->
+<head>
+ <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
+ <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1173199">Mozilla Bug 1173199</a>
+<div id="testnodes"></div>
+<pre id="test">
+<script type="application/javascript">
+ add_task(async function() {
+ const { ContentTaskUtils } = ChromeUtils.importESModule(
+ "resource://testing-common/ContentTaskUtils.sys.mjs"
+ );
+ let t = document.getElementById('testnodes');
+
+ const url = 'chrome://mochitests/content/chrome/layout/mathml/tests/test_disabled_chrome_iframe.html';
+ const chromeIframeEl = document.createElement('iframe');
+ let chromeLoadPromise = ContentTaskUtils.waitForEvent(chromeIframeEl, 'load', false);
+ chromeIframeEl.src = url;
+ t.appendChild(chromeIframeEl);
+
+ await chromeLoadPromise;
+ const mspaceBox = chromeIframeEl.contentDocument.body.querySelector("mspace").getBoundingClientRect();
+ ok(mspaceBox.width > 50, "MathML is laid out in Chrome documents even when the mathml.disabled preference is true.");
+ });
+</script>
+</pre>
+</body>
+</html>
diff --git a/layout/mathml/tests/test_disabled_chrome_iframe.html b/layout/mathml/tests/test_disabled_chrome_iframe.html
new file mode 100644
index 0000000000..6a88020b47
--- /dev/null
+++ b/layout/mathml/tests/test_disabled_chrome_iframe.html
@@ -0,0 +1,4 @@
+<!DOCTYPE html>
+<math>
+ <mspace style="background: green" height="100px" width="100px"></mspace>
+</math>