summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/dom/elements-sections.js
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 /testing/web-platform/tests/html/dom/elements-sections.js
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 'testing/web-platform/tests/html/dom/elements-sections.js')
-rw-r--r--testing/web-platform/tests/html/dom/elements-sections.js64
1 files changed, 64 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/dom/elements-sections.js b/testing/web-platform/tests/html/dom/elements-sections.js
new file mode 100644
index 0000000000..bbad85e513
--- /dev/null
+++ b/testing/web-platform/tests/html/dom/elements-sections.js
@@ -0,0 +1,64 @@
+var sectionElements = {
+ body: {
+ // Obsolete
+ text: {type: "string", treatNullAsEmptyString: true},
+ link: {type: "string", treatNullAsEmptyString: true},
+ vLink: {type: "string", treatNullAsEmptyString: true},
+ aLink: {type: "string", treatNullAsEmptyString: true},
+ bgColor: {type: "string", treatNullAsEmptyString: true},
+ background: "string",
+ },
+ article: {},
+ section: {},
+ nav: {},
+ aside: {},
+ h1: {
+ // Obsolete
+ align: "string",
+ },
+ h2: {
+ // Obsolete
+ align: "string",
+ },
+ h3: {
+ // Obsolete
+ align: "string",
+ },
+ h4: {
+ // Obsolete
+ align: "string",
+ },
+ h5: {
+ // Obsolete
+ align: "string",
+ },
+ h6: {
+ // Obsolete
+ align: "string",
+ },
+ hgroup: {},
+ header: {},
+ footer: {},
+ address: {},
+};
+
+mergeElements(sectionElements);
+
+extraTests.push(function() {
+ ReflectionTests.reflects({type: "enum", keywords: ["ltr", "rtl", "auto"]}, "dir", document, "dir", document.documentElement);
+ // TODO: these behave differently if the body element is a frameset. Also
+ // should probably test with multiple bodies.
+ ReflectionTests.reflects({type: "string", treatNullAsEmptyString: true}, "fgColor", document, "text", document.body);
+ ReflectionTests.reflects({type: "string", treatNullAsEmptyString: true}, "linkColor", document, "link", document.body);
+ ReflectionTests.reflects({type: "string", treatNullAsEmptyString: true}, "vlinkColor", document, "vlink", document.body);
+ ReflectionTests.reflects({type: "string", treatNullAsEmptyString: true}, "alinkColor", document, "alink", document.body);
+ ReflectionTests.reflects({type: "string", treatNullAsEmptyString: true}, "bgColor", document, "bgcolor", document.body);
+ // Edge remains RTL if we don't do this, despite removing the attribute
+ document.dir = "ltr";
+ // Don't mess up the colors :)
+ document.documentElement.removeAttribute("dir");
+ var attrs = ["text", "bgcolor", "link", "alink", "vlink"];
+ for (var i = 0; i < attrs.length; i++) {
+ document.body.removeAttribute(attrs[i]);
+ }
+});