From b3552a46c3d384aa42ac74a1064853e76c97f0e2 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Wed, 10 Jul 2013 22:37:02 +0200 Subject: [PATCH 1/2] Add a test for empty names in HTMLCollection in DOM. --- dom/MANIFEST | 1 + .../HTMLCollection-empty-name.html | 52 +++++++++++++++++++ dom/collections/MANIFEST | 1 + 3 files changed, 54 insertions(+) create mode 100644 dom/collections/HTMLCollection-empty-name.html create mode 100644 dom/collections/MANIFEST diff --git a/dom/MANIFEST b/dom/MANIFEST index 0eba7e4ea998a5..88ea81ecc33c8f 100644 --- a/dom/MANIFEST +++ b/dom/MANIFEST @@ -1,3 +1,4 @@ +dir collections support common.js support constants.js dir errors diff --git a/dom/collections/HTMLCollection-empty-name.html b/dom/collections/HTMLCollection-empty-name.html new file mode 100644 index 00000000000000..792cab045ec424 --- /dev/null +++ b/dom/collections/HTMLCollection-empty-name.html @@ -0,0 +1,52 @@ + + +HTMLCollection and empty names + + +
+
+
+
+ +
+ diff --git a/dom/collections/MANIFEST b/dom/collections/MANIFEST new file mode 100644 index 00000000000000..73fa2c08b6e0b8 --- /dev/null +++ b/dom/collections/MANIFEST @@ -0,0 +1 @@ +HTMLCollection-empty-name.html From b3ca1899e3b16de06f64ebed085ab50dadeb845a Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Thu, 11 Jul 2013 08:43:16 +0200 Subject: [PATCH 2/2] Add more whitespace between tests. --- dom/collections/HTMLCollection-empty-name.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dom/collections/HTMLCollection-empty-name.html b/dom/collections/HTMLCollection-empty-name.html index 792cab045ec424..1371f8721873a1 100644 --- a/dom/collections/HTMLCollection-empty-name.html +++ b/dom/collections/HTMLCollection-empty-name.html @@ -16,6 +16,7 @@ assert_equals(c[""], undefined, "Named getter should return undefined for empty string."); assert_equals(c.namedItem(""), null, "namedItem should return null for empty string."); }, "Empty string as a name for Document.getElementsByTagName"); + test(function() { var div = document.getElementById("test"); var c = div.getElementsByTagName("*"); @@ -23,12 +24,14 @@ assert_equals(c[""], undefined, "Named getter should return undefined for empty string."); assert_equals(c.namedItem(""), null, "namedItem should return null for empty string."); }, "Empty string as a name for Element.getElementsByTagName"); + test(function() { var c = document.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "a"); assert_false("" in c, "Empty string should not be in the collection."); assert_equals(c[""], undefined, "Named getter should return undefined for empty string."); assert_equals(c.namedItem(""), null, "namedItem should return null for empty string."); }, "Empty string as a name for Document.getElementsByTagNameNS"); + test(function() { var div = document.getElementById("test"); var c = div.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "a"); @@ -36,12 +39,14 @@ assert_equals(c[""], undefined, "Named getter should return undefined for empty string."); assert_equals(c.namedItem(""), null, "namedItem should return null for empty string."); }, "Empty string as a name for Element.getElementsByTagNameNS"); + test(function() { var c = document.getElementsByClassName("a"); assert_false("" in c, "Empty string should not be in the collection."); assert_equals(c[""], undefined, "Named getter should return undefined for empty string."); assert_equals(c.namedItem(""), null, "namedItem should return null for empty string."); }, "Empty string as a name for Document.getElementsByClassName"); + test(function() { var div = document.getElementById("test"); var c = div.getElementsByClassName("a");