mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Test a non-ASCII argument to CharacterData#appendData.
This commit is contained in:
parent
173c9721c5
commit
51b06bcbaf
2 changed files with 9 additions and 7 deletions
|
@ -9,13 +9,7 @@
|
||||||
<script>
|
<script>
|
||||||
test(function() {
|
test(function() {
|
||||||
var a = document.getElementsByTagName('p')[0].childNodes[0];
|
var a = document.getElementsByTagName('p')[0].childNodes[0];
|
||||||
assert_equals(a.data, "This is the character data");
|
a.data = "This is the character data, append more 資料,測試資料";
|
||||||
// append test utf8
|
|
||||||
a.appendData(", append more 資料,測試資料");
|
|
||||||
assert_equals(a.data, "This is the character data, append more 資料,測試資料");
|
|
||||||
|
|
||||||
// length test utf8
|
|
||||||
assert_equals(a.length, 47);
|
|
||||||
|
|
||||||
// insert test non-utf8
|
// insert test non-utf8
|
||||||
a.insertData(26, " test");
|
a.insertData(26, " test");
|
||||||
|
|
|
@ -24,6 +24,14 @@ function testNode(create, type) {
|
||||||
assert_equals(node.data, "test")
|
assert_equals(node.data, "test")
|
||||||
}, type + ".appendData('')")
|
}, type + ".appendData('')")
|
||||||
|
|
||||||
|
test(function() {
|
||||||
|
var node = create()
|
||||||
|
assert_equals(node.data, "test")
|
||||||
|
node.appendData(", append more 資料,測試資料");
|
||||||
|
assert_equals(node.data, "test, append more 資料,測試資料");
|
||||||
|
assert_equals(node.length, 25);
|
||||||
|
}, type + ".appendData(non-ASCII)")
|
||||||
|
|
||||||
test(function() {
|
test(function() {
|
||||||
var node = create()
|
var node = create()
|
||||||
assert_equals(node.data, "test")
|
assert_equals(node.data, "test")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue