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

Unified Diff: third_party/WebKit/LayoutTests/imported/web-platform-tests/dom/collections/HTMLCollection-supported-property-names.html

Issue 1529523002: Import dom/ from web-platform-tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tweak W3CImportExpectations Created 5 years 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: third_party/WebKit/LayoutTests/imported/web-platform-tests/dom/collections/HTMLCollection-supported-property-names.html
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/dom/collections/HTMLCollection-supported-property-names.html b/third_party/WebKit/LayoutTests/imported/web-platform-tests/dom/collections/HTMLCollection-supported-property-names.html
new file mode 100644
index 0000000000000000000000000000000000000000..3a71f5897875fb6dfa1814f2dcb52c2715639f9a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/dom/collections/HTMLCollection-supported-property-names.html
@@ -0,0 +1,54 @@
+<!doctype html>
+<meta charset=utf-8>
+<link rel=help href=https://dom.spec.whatwg.org/#interface-htmlcollection>
+<script src=../../../../resources/testharness.js></script>
+<script src=../../../../resources/testharnessreport.js></script>
+
+<div id=log></div>
+
+<!-- with no attribute -->
+<span></span>
+
+<!-- with `id` attribute -->
+<span id=''></span>
+<span id='some-id'></span>
+<span id='some-id'></span><!-- to ensure no duplicates -->
+
+<!-- with `name` attribute -->
+<span name=''></span>
+<span name='some-name'></span>
+<span name='some-name'></span><!-- to ensure no duplicates -->
+
+<!-- with `name` and `id` attribute -->
+<span id='another-id' name='another-name'></span>
+
+<script>
+test(function () {
+ var elements = document.getElementsByTagName("span");
+ assert_array_equals(
+ Object.getOwnPropertyNames(elements),
+ ['0', '1', '2', '3', '4', '5', '6', '7', 'some-id', 'some-name', 'another-id', 'another-name']
+ );
+}, 'Object.getOwnPropertyNames on HTMLCollection');
+
+test(function () {
+ var elem = document.createElementNS('some-random-namespace', 'foo');
+ this.add_cleanup(function () {elem.remove();});
+ elem.setAttribute("name", "some-name");
+ document.body.appendChild(elem);
+
+ var elements = document.getElementsByTagName("foo");
+ assert_array_equals(Object.getOwnPropertyNames(elements), ['0']);
+}, 'Object.getOwnPropertyNames on HTMLCollection with non-HTML namespace');
+
+test(function () {
+ var elem = document.createElement('foo');
+ this.add_cleanup(function () {elem.remove();});
+ document.body.appendChild(elem);
+
+ var elements = document.getElementsByTagName("foo");
+ elements.someProperty = "some value";
+
+ assert_array_equals(Object.getOwnPropertyNames(elements), ['0', 'someProperty']);
+}, 'Object.getOwnPropertyNames on HTMLCollection with expando object');
+</script>

Powered by Google App Engine
This is Rietveld 408576698