summaryrefslogtreecommitdiffstats
path: root/dom/tests/mochitest/bugs/test_bug467035.html
diff options
context:
space:
mode:
Diffstat (limited to 'dom/tests/mochitest/bugs/test_bug467035.html')
-rw-r--r--dom/tests/mochitest/bugs/test_bug467035.html45
1 files changed, 45 insertions, 0 deletions
diff --git a/dom/tests/mochitest/bugs/test_bug467035.html b/dom/tests/mochitest/bugs/test_bug467035.html
new file mode 100644
index 0000000000..ffcfe03e7c
--- /dev/null
+++ b/dom/tests/mochitest/bugs/test_bug467035.html
@@ -0,0 +1,45 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=467035
+-->
+<head>
+ <meta charset="utf-8">
+ <title>Test for Bug 467035</title>
+ <script src="/tests/SimpleTest/SimpleTest.js"></script>
+ <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+ <script type="application/javascript">
+
+ /** Test for Bug 467035 **/
+ SimpleTest.waitForExplicitFinish();
+ addLoadEvent(() => {
+ const s = `<!DOCTYPE html SYSTEM \"chrome://branding/locale/brand.dtd\">
+ <html xmlns=\"http://www.w3.org/1999/xhtml\">
+ <head>
+ <meta charset=\"utf-8\"/>
+ <title>&brandShortName;</title>
+ </head>
+ </html>`;
+
+ const parser = new DOMParser();
+ let doc = parser.parseFromString(s, 'application/xhtml+xml');
+ is(doc.getElementsByTagName('parsererror').length, 1, 'parseFromString cannot access locale DTD');
+
+ SpecialPowers.wrap(parser).forceEnableDTD();
+ doc = parser.parseFromString(s, 'application/xhtml+xml');
+ const isTitleLocalized = doc.getElementsByTagName('parsererror').length === 0 &&
+ typeof doc.title === 'string' &&
+ !!doc.title;
+ ok(isTitleLocalized, 'parseFromString can access locale DTD with forceEnableDTD');
+
+ SimpleTest.finish();
+ });
+ </script>
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=467035">Mozilla Bug 467035</a>
+<p id="display"></p>
+<pre id="test">
+</pre>
+</body>
+</html>