mirror of
https://github.com/servo/servo.git
synced 2025-08-14 18:05:36 +01:00
Auto merge of #6222 - Ms2ger:characterdata, r=nox
<!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6222) <!-- Reviewable:end -->
This commit is contained in:
commit
99b79fc248
3 changed files with 10 additions and 34 deletions
|
@ -7,7 +7,6 @@
|
|||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
// TODO: non-ASCII strings
|
||||
function testNode(create, type) {
|
||||
test(function() {
|
||||
var node = create()
|
||||
|
@ -101,6 +100,16 @@ function testNode(create, type) {
|
|||
assert_equals(node.substringData(0, -1), "test")
|
||||
assert_equals(node.substringData(0, -0x100000000 + 2), "te")
|
||||
}, type + ".substringData() with negative count")
|
||||
|
||||
test(function() {
|
||||
var node = create()
|
||||
assert_equals(node.data, "test")
|
||||
|
||||
node.data = "This is the character data test, other 資料,更多文字"
|
||||
|
||||
assert_equals(node.substringData(12, 4), "char")
|
||||
assert_equals(node.substringData(39, 2), "資料")
|
||||
}, type + ".substringData() with non-ASCII data")
|
||||
}
|
||||
|
||||
testNode(function() { return document.createTextNode("test") }, "Text")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue