mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-06-03 22:38:57 +00:00
29 lines
912 B
HTML
29 lines
912 B
HTML
<!DOCTYPE html>
|
|
<meta charset=utf-8>
|
|
<title>CharacterData.insertData</title>
|
|
<link rel=help href="https://dom.spec.whatwg.org/#dom-characterdata-insertdata">
|
|
<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.insertData(5, "x") })
|
|
assert_throws("INDEX_SIZE_ERR", function() { node.insertData(5, "") })
|
|
node.insertData(2, "X")
|
|
assert_equals(node.data, "teXst")
|
|
})
|
|
test(function() {
|
|
node.data = "test"
|
|
assert_equals(node.data, "test")
|
|
node.insertData(4, "ing")
|
|
assert_equals(node.data, "testing")
|
|
})
|
|
}
|
|
test(function() {
|
|
testNode(document.createTextNode("test"))
|
|
testNode(document.createComment("test"))
|
|
})
|
|
</script>
|