diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir-auto-dynamic-changes.window.js b/testing/web-platform/tests/html/dom/elements/global-attributes/dir-auto-dynamic-changes.window.js index 28be3f9936ef..979c73800a45 100644 --- a/testing/web-platform/tests/html/dom/elements/global-attributes/dir-auto-dynamic-changes.window.js +++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir-auto-dynamic-changes.window.js @@ -376,23 +376,17 @@ test(() => { }, 'dir=auto slot is not affected by text in value of input element children'); test(() => { - let [tree, shadow] = setup_tree(` + let tree = setup_tree(`
-
- - abc -
+
- `,` - `); - let slot = shadow.querySelector("slot"); - assert_equals(html_direction(slot), "rtl"); let inp = tree.querySelector("input"); + assert_equals(html_direction(inp), "rtl"); inp.type = "month"; - assert_equals(html_direction(slot), "ltr"); + assert_equals(html_direction(inp), "ltr"); tree.remove(); -}, 'dir=auto slot is updated if input stops being auto-directionality form-associated'); +}, 'input direction changes if it stops being auto-directionality form-associated'); test(() => { let [tree, shadow] = setup_tree(` diff --git a/testing/web-platform/tests/html/dom/elements/global-attributes/dir-slots-directionality.html b/testing/web-platform/tests/html/dom/elements/global-attributes/dir-slots-directionality.html index f482d44b3329..7a16e38de125 100644 --- a/testing/web-platform/tests/html/dom/elements/global-attributes/dir-slots-directionality.html +++ b/testing/web-platform/tests/html/dom/elements/global-attributes/dir-slots-directionality.html @@ -225,4 +225,51 @@ tree.remove(); }, 'dir=auto slot ignores text in value of input element children'); +test(() => { + let [tree, shadow] = setup_tree(` +
+
+ + + abc +
+
+ `,` + + `); + let slot = shadow.querySelector("slot"); + assert_equals(html_direction(slot), "ltr"); + tree.remove(); +}, 'dir=auto slot is not affected by value of auto-directionality form associated elements'); + +test(() => { + let [tree, shadow] = setup_tree(` +
+
اختبر
+
+ `,` + + + + `); + let slot = shadow.querySelector("slot[name='inner']"); + assert_equals(html_direction(slot), "rtl"); + tree.remove(); +}, 'inner slot is given directionality from slotted content'); + +test(() => { + let [tree, shadow] = setup_tree(` +
+
اختبر
+
+ `,` + + + `); + let slot = shadow.querySelector("slot[name='outer']"); + slot.innerHTML = ""; + assert_equals(html_direction(slot), "ltr"); + tree.remove(); +}, 'dir=auto slot is not affected by content inside inner slot (version 1)'); +