Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Unified Diff: LayoutTests/fast/dom/Node/textContent-set-undefined.html

Issue 303163002: Node.textContent setter should treat undefined the same way as null (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add spec url to test case Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/core/dom/Node.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/Node/textContent-set-undefined.html
diff --git a/LayoutTests/fast/dom/Node/textContent-set-undefined.html b/LayoutTests/fast/dom/Node/textContent-set-undefined.html
new file mode 100644
index 0000000000000000000000000000000000000000..6f31739e1e2eb2f503582db3da85a756e088263e
--- /dev/null
+++ b/LayoutTests/fast/dom/Node/textContent-set-undefined.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link rel="help" href="http://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>
« no previous file with comments | « no previous file | Source/core/dom/Node.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698