mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
Update web-platform-tests to revision 0d318188757a9c996e20b82db201fd04de5aa255
This commit is contained in:
parent
b2a5225831
commit
1a81b18b9f
12321 changed files with 544385 additions and 6 deletions
|
@ -0,0 +1,30 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset=utf-8>
|
||||
<title>CharacterData.replaceData</title>
|
||||
<link rel=help href="https://dom.spec.whatwg.org/#dom-characterdata-replacedata">
|
||||
<link rel=help href="https://dom.spec.whatwg.org/#dom-characterdata-data">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
function testNode(node) {
|
||||
test(function() {
|
||||
assert_throws("INDEX_SIZE_ERR", function() { node.replaceData(5, 1, "x") })
|
||||
assert_throws("INDEX_SIZE_ERR", function() { node.replaceData(5, 0, "") })
|
||||
node.replaceData(2, 10, "yo")
|
||||
assert_equals(node.data, "teyo")
|
||||
})
|
||||
test(function() {
|
||||
node.data = "test"
|
||||
assert_equals(node.data, "test")
|
||||
node.replaceData(1, 1, "waddup")
|
||||
assert_equals(node.data, "twaddupst")
|
||||
node.replaceData(1, 1, "yup")
|
||||
assert_equals(node.data, "tyupaddupst")
|
||||
})
|
||||
}
|
||||
test(function() {
|
||||
testNode(document.createTextNode("test"))
|
||||
testNode(document.createComment("test"))
|
||||
})
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue