blob: 67bc5c973ab1b6661ae1a9ac082756f243835d83 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<link rel="help" href="https://dom.spec.whatwg.org/#dom-node-textcontent">
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
</head>
<body>
<div id="testDiv">test</div>
<script>
test(function() {
var testDiv = document.getElementById("testDiv");
assert_equals(testDiv.textContent, "test");
testDiv.textContent = null;
assert_equals(testDiv.textContent, "");
testDiv.textContent = "test";
assert_equals(testDiv.textContent, "test");
testDiv.textContent = undefined;
assert_equals(testDiv.textContent, "");
}, "Test that setting Node.textContent to undefined does the same as null");
</script>
</body>
</html>