Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement dirname for form submit and directionality for element
- Loading branch information
1 parent
6bc4a7d
commit ef49f2e
Showing
14 changed files
with
178 additions
and
19 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 0 additions & 5 deletions
5
...wpt/metadata/html/semantics/forms/attributes-common-to-form-controls/dirname-ltr.html.ini
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
...b-platform-tests/html/semantics/forms/attributes-common-to-form-controls/dirname-rtl.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<!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> | ||
<div id="log"></div> | ||
<form action="dirname-ltr-iframe.html" method=get target="iframe"> | ||
<p><label>Comment: <input type=text id="comment-input" name="comment" dirname="comment.dir" required/></label></p> | ||
<p><button type=submit>Post Comment</button></p> | ||
</form> | ||
<iframe name="iframe"></iframe> | ||
<script> | ||
function getParameterByName(name) { | ||
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); | ||
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), | ||
results = regex.exec(document.querySelector("iframe").contentWindow.location.search); | ||
return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); | ||
} | ||
|
||
var t = async_test("submit element directionality"); | ||
setTimeout(3000, function() { | ||
var rtlValue = "مرحبا"; | ||
document.querySelector("input").value = rtlValue; | ||
document.querySelector("button").click(); | ||
|
||
document.querySelector("iframe").onload = t.step_func_done(function() { | ||
assert_equals(getParameterByName("comment.dir"), "rtl"); | ||
}); | ||
}, 3000); | ||
</script> |