Chromium Code Reviews| Index: LayoutTests/fast/dom/htmlcollection-non-html.html |
| diff --git a/LayoutTests/fast/dom/htmlcollection-non-html.html b/LayoutTests/fast/dom/htmlcollection-non-html.html |
| index 37cea385069a88b7d44c3ae49cfdc1240eb163da..b79a4348bcc3daeab902199947c49919ee4baee4 100644 |
| --- a/LayoutTests/fast/dom/htmlcollection-non-html.html |
| +++ b/LayoutTests/fast/dom/htmlcollection-non-html.html |
| @@ -2,7 +2,8 @@ |
| <head> |
| <script src="../../resources/js-test.js"></script> |
| <script> |
| -var elem; |
| +'use strict'; |
| +var elem, select; |
| var ns = "http://not-html.test"; |
| function testDocumentProperty(attributeName, elementName, base) { |
| @@ -21,19 +22,21 @@ function testDocumentProperty(attributeName, elementName, base) { |
| document.body.removeChild(elem); |
| } |
| -function testDocumentPropertyWithAttribute(attributeName, elementName, elementAttributeName, base) { |
| +function testDocumentPropertyWithAttributes(attributeName, elementName, attributes, base) { |
| var elem; |
| if (typeof base == 'undefined') |
| base = 0; |
| elem = document.createElementNS(ns, elementName); |
| - elem.setAttribute(elementAttributeName, "foo"); |
| + for (let k in attributes) |
| + elem.setAttribute(k, attributes[k]); |
| document.body.appendChild(elem); |
| shouldBe("document." + attributeName + ".length", base + ""); |
| document.body.removeChild(elem); |
| elem = document.createElement(elementName); |
| - elem.setAttribute(elementAttributeName, "foo"); |
| + for (let k in attributes) |
| + elem.setAttribute(k, attributes[k]); |
| document.body.appendChild(elem); |
| shouldBe("document." + attributeName + ".length", base + 1 + ""); |
| document.body.removeChild(elem); |
| @@ -75,15 +78,15 @@ function runTest() { |
| testDocumentProperty("images", "img"); |
| testDocumentProperty("forms", "form"); |
| - testDocumentProperty("applets", "applet"); |
|
dcheng
2015/08/19 18:44:17
Test exercises document.applets, so I've updated t
|
| + testDocumentPropertyWithAttributes("applets", "object", {type: "application/x-java-applet"}); |
| testDocumentProperty("embeds", "embed"); |
| // Note that this is run before the final script element on this page is inserted |
| testDocumentProperty("scripts", "script", 3); |
| - testDocumentPropertyWithAttribute("links", "a", "href"); |
| - testDocumentPropertyWithAttribute("links", "area", "href"); |
| - testDocumentPropertyWithAttribute("anchors", "a", "name"); |
| + testDocumentPropertyWithAttributes("links", "a", {href: "foo"}); |
| + testDocumentPropertyWithAttributes("links", "area", {href: "foo"}); |
| + testDocumentPropertyWithAttributes("anchors", "a", {name: "foo"}); |
| testElementProperty("map", "areas", "area"); |
| testElementProperty("table", "rows", "tr"); |