summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/dom/elements/global-attributes
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:34:42 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:34:42 +0000
commitda4c7e7ed675c3bf405668739c3012d140856109 (patch)
treecdd868dba063fecba609a1d819de271f0d51b23e /testing/web-platform/tests/html/dom/elements/global-attributes
parentAdding upstream version 125.0.3. (diff)
downloadfirefox-da4c7e7ed675c3bf405668739c3012d140856109.tar.xz
firefox-da4c7e7ed675c3bf405668739c3012d140856109.zip
Adding upstream version 126.0.upstream/126.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/html/dom/elements/global-attributes')
-rw-r--r--testing/web-platform/tests/html/dom/elements/global-attributes/dir-assorted.window.js33
1 files changed, 33 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir-assorted.window.js b/testing/web-platform/tests/html/dom/elements/global-attributes/dir-assorted.window.js
index 2017269f0b..93f798e600 100644
--- a/testing/web-platform/tests/html/dom/elements/global-attributes/dir-assorted.window.js
+++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir-assorted.window.js
@@ -64,6 +64,39 @@ test(() => {
assert_true(ele2.matches(":dir(ltr)"), "child is LTR after change");
}, "Non-HTML element text contents influence dir=auto");
+
+for (const tag of ["style", "script"]) {
+ test(() => {
+ const e1 = document.createElement("div");
+ e1.dir = "auto";
+
+ const e2 = document.createElement(tag);
+ const node = document.createTextNode("\u05D0");
+ e2.appendChild(node);
+ e1.appendChild(e2);
+ assert_true(e1.matches(":dir(ltr)", "is LTR before change"));
+ node.data = "ABC";
+ assert_true(e1.matches(":dir(ltr)", "is LTR after change"));
+
+ }, `${tag} element text contents do not influence dir=auto`);
+}
+
+for (const tag of ["style", "script", "input", "textarea"]) {
+ test(() => {
+ const e1 = document.createElement("div");
+ e1.dir = "auto";
+ const svg = document.createElement("svg");
+ const e2 = document.createElementNS("http://www.w3.org/2000/svg", tag);
+ const node = document.createTextNode("\u05D0");
+ e2.appendChild(node);
+ svg.appendChild(e2);
+ e1.appendChild(svg);
+ assert_true(e1.matches(":dir(rtl)", "is RTL before change"));
+ node.data = "ABC";
+ assert_true(e1.matches(":dir(ltr)", "is LTR after change"));
+ }, `non-html ${tag} element text contents influence dir=auto`);
+}
+
test(() => {
const e1 = document.createElement("div");
e1.dir = "auto";