Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5c4f54c
commit 0907940
Showing
4 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
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
19 changes: 19 additions & 0 deletions
19
...wpt/web-platform-tests/html/semantics/forms/the-textarea-element/textarea-textLength.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,19 @@ | ||
<!DOCTYPE HTML> | ||
<title>The textLengh IDL attribute</title> | ||
<meta content="charset=utf-16"> | ||
<link rel="author" title="tigercosmos" href="mailto:phy.tiger@gmail.com"> | ||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-textarea-textlength"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<textarea id="textarea"></textarea> | ||
<script> | ||
var textarea = document.getElementById("textarea"); | ||
|
||
test(function () { | ||
textarea.value= "Hello, World!"; | ||
assert_equals(textarea.textLength, 13); | ||
|
||
textarea.value = "\u4f60\u597d\uff0c\u4e16\u754c\uff01"; //你好,世界! | ||
assert_equals(textarea.textLength, 6); | ||
}, "Textarea's 'testLength' should work for utf-16."); | ||
</script> |