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

Unified Diff: LayoutTests/fast/dom/DocumentFragment/get-element-by-id.html

Issue 251633002: Add support for DocumentFragment.getElementById() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Use isInTreeScope() instead of isInDocument() Created 6 years, 8 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
Index: LayoutTests/fast/dom/DocumentFragment/get-element-by-id.html
diff --git a/LayoutTests/fast/dom/DocumentFragment/get-element-by-id.html b/LayoutTests/fast/dom/DocumentFragment/get-element-by-id.html
new file mode 100644
index 0000000000000000000000000000000000000000..6208b6ecbf2f8e46316b4da5a3e25a46440d1f19
--- /dev/null
+++ b/LayoutTests/fast/dom/DocumentFragment/get-element-by-id.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link rel="help" href="http://dom.spec.whatwg.org/#interface-nonelementparentnode">
+<script src="../../../resources/js-test.js"></script>
+</head>
+<body>
+<div id="notInFragment"></div>
+<script>
+description("Tests that getElementById() API is exposed on DocumentFragment nodes.");
+
+var fragment = new DocumentFragment();
+var div = document.createElement("div", "");
+div.id = "divID";
+fragment.appendChild(div);
+var a = document.createElement("a", "");
+a.id = "aID";
+div.appendChild(a);
+
+shouldBe("fragment.getElementById('divID')", "div");
+shouldBe("fragment.getElementById('aID')", "a");
+shouldBeNull("fragment.getElementById('notInFragment')");
+shouldBeNull("fragment.getElementById('doesNotExist')");
abarth-chromium 2014/04/28 18:25:25 Does this test all the paths through the code you'
Inactive 2014/04/28 18:31:49 No, I will improve the test to cover the duplicate
Inactive 2014/04/28 18:42:02 Done.
+</script>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/fast/dom/DocumentFragment/get-element-by-id-expected.txt » ('j') | Source/core/dom/ContainerNode.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698