Chromium Code Reviews| 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> |