summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/forms/attributes-common-to-form-controls/dirname-rtl-auto.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/html/semantics/forms/attributes-common-to-form-controls/dirname-rtl-auto.html')
-rw-r--r--testing/web-platform/tests/html/semantics/forms/attributes-common-to-form-controls/dirname-rtl-auto.html31
1 files changed, 31 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/semantics/forms/attributes-common-to-form-controls/dirname-rtl-auto.html b/testing/web-platform/tests/html/semantics/forms/attributes-common-to-form-controls/dirname-rtl-auto.html
new file mode 100644
index 0000000000..02aeb79176
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/attributes-common-to-form-controls/dirname-rtl-auto.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Submitting element directionality: the dirname attribute</title>
+<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
+<link rel=help href="https://html.spec.whatwg.org/multipage/#submitting-element-directionality:-the-dirname-attribute">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="resources/dirname.js"></script>
+<div id="log"></div>
+<form action="resources/dirname-iframe.html" method=get target="iframe">
+ <p><label>User: <input type=text name="user" dir="auto" dirname="user.dir" required/></label></p>
+ <p><label>Comment: <textarea name="comment" dir="auto" dirname="comment.dir" required></textarea></label></p>
+ <p><button type=submit>Post Comment</button></p>
+</form>
+<iframe name="iframe"></iframe>
+<script>
+ var rtlValue = "مرحبا";
+ document.querySelector("input").value = rtlValue;
+ document.querySelector("textarea").value = rtlValue;
+ document.querySelector("button").click();
+
+ var t_inp = async_test("submit input element directionality");
+ onIframeLoadedDone(t_inp, function(params) {
+ assert_equals(params.get("user.dir"), "rtl");
+ });
+
+ var t_ta = async_test("submit textarea element directionality");
+ onIframeLoadedDone(t_ta, function(params) {
+ assert_equals(params.get("comment.dir"), "rtl");
+ });
+</script>