[ES6] Support subclassing the String builtin object
[WebKit-https.git] / LayoutTests / imported / w3c / web-platform-tests / html / semantics / forms / attributes-common-to-form-controls / dirname-ltr.html
1 <!DOCTYPE html>
2 <meta charset=utf-8>
3 <title>Submitting element directionality: the dirname attribute</title>
4 <link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
5 <link rel=help href="https://html.spec.whatwg.org/multipage/#submitting-element-directionality:-the-dirname-attribute">
6 <script src="/resources/testharness.js"></script>
7 <script src="/resources/testharnessreport.js"></script>
8 <div id="log"></div>
9 <form action="dirname-ltr-iframe.html" method=get target="iframe">
10   <p><label>Comment: <input type=text name="comment" dirname="comment.dir" required></label></p>
11   <p><button type=submit>Post Comment</button></p>
12 </form>
13 <iframe name="iframe"></iframe>
14 <script>
15   function getParameterByName(name) {
16     name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
17     var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
18     results = regex.exec(document.querySelector("iframe").contentWindow.location.search);
19     return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
20   }
21
22   var t = async_test("submit element directionality");
23   document.querySelector("input").value="foobar";
24   document.querySelector("button").click();
25
26   document.querySelector("iframe").onload = t.step_func_done(function() {
27     assert_equals(getParameterByName("comment.dir"), "ltr");
28   });
29 </script>