update-w3c-deps import using blink 770eaea66cc4cfbb14ced3dc8dc5434716ed540a:
imported csswg-test@463b579da0ddc2ae069b79592d6c3194bc8fdfe1
imported web-platform-tests@15cc323f9eb885ed7c24ad0d7accc31827ba46fc
html/dom
- 1 html, 2 js updated. 2 new FAILs.
html/semantics/forms
- 1 test added.
html/semantics/tabular-data
- 2 tests updated. 1 new FAIL.
IndexedDB
- 1 test added, 1 js updated.
resources
- testharness.js updated.
shadow-dom
- Comments updated.
TBR=dpranke@chromium.org,jsbell@chromium.org,tkent@chromium.org,hayato@chromium.org,kochi@chromium.org
BUG=490511, 492664, 517840
Review URL: https://codereview.chromium.org/1407103007
Cr-Commit-Position: refs/heads/master@{#357285}
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/IndexedDB/idbobjectstore_openKeyCursor.htm b/third_party/WebKit/LayoutTests/imported/web-platform-tests/IndexedDB/idbobjectstore_openKeyCursor.htm
new file mode 100644
index 0000000..d1f467e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/IndexedDB/idbobjectstore_openKeyCursor.htm
@@ -0,0 +1,139 @@
+<!DOCTYPE html>
+<title>IDBObjectStore.openKeyCursor()</title>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<script>
+function store_test(func, name) {
+ async_test(function(t) {
+ var del = indexedDB.deleteDatabase(name);
+ del.onerror = t.unreached_func("deleteDatabase failed");
+ var open = indexedDB.open(name);
+ open.onupgradeneeded = t.step_func(function() {
+ var db = open.result;
+ var store = db.createObjectStore("store");
+ for (var i = 0; i < 10; ++i) {
+ store.put("value: " + i, i);
+ }
+ });
+
+ open.onsuccess = t.step_func(function() {
+ var db = open.result;
+ var tx = db.transaction("store");
+ var store = tx.objectStore("store");
+ func(t, db, tx, store);
+ });
+ }, name);
+}
+
+store_test(function(t, db, tx, store) {
+ var expected = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
+ var actual = [];
+ var request = store.openKeyCursor();
+ request.onsuccess = t.step_func(function() {
+ var cursor = request.result;
+ if (!cursor)
+ return;
+ assert_equals(cursor.direction, "next");
+ assert_false("value" in cursor);
+ assert_equals(indexedDB.cmp(cursor.key, cursor.primaryKey), 0);
+ actual.push(cursor.key);
+ cursor.continue();
+ });
+
+ tx.onabort = t.unreached_func("transaction aborted");
+ tx.oncomplete = t.step_func(function() {
+ assert_array_equals(expected, actual, "keys should match");
+ t.done();
+ });
+
+}, "IDBObjectStore.openKeyCursor() - forward iteration");
+
+store_test(function(t, db, tx, store) {
+ var expected = [9, 8, 7, 6, 5, 4, 3, 2, 1, 0];
+ var actual = [];
+ var request = store.openKeyCursor(null, "prev");
+ request.onsuccess = t.step_func(function() {
+ var cursor = request.result;
+ if (!cursor)
+ return;
+ assert_equals(cursor.direction, "prev");
+ assert_false("value" in cursor);
+ assert_equals(indexedDB.cmp(cursor.key, cursor.primaryKey), 0);
+ actual.push(cursor.key);
+ cursor.continue();
+ });
+
+ tx.onabort = t.unreached_func("transaction aborted");
+ tx.oncomplete = t.step_func(function() {
+ assert_array_equals(expected, actual, "keys should match");
+ t.done();
+ });
+
+}, "IDBObjectStore.openKeyCursor() - reverse iteration");
+
+store_test(function(t, db, tx, store) {
+ var expected = [4, 5, 6];
+ var actual = [];
+ var request = store.openKeyCursor(IDBKeyRange.bound(4, 6));
+ request.onsuccess = t.step_func(function() {
+ var cursor = request.result;
+ if (!cursor)
+ return;
+ assert_equals(cursor.direction, "next");
+ assert_false("value" in cursor);
+ assert_equals(indexedDB.cmp(cursor.key, cursor.primaryKey), 0);
+ actual.push(cursor.key);
+ cursor.continue();
+ });
+
+ tx.onabort = t.unreached_func("transaction aborted");
+ tx.oncomplete = t.step_func(function() {
+ assert_array_equals(expected, actual, "keys should match");
+ t.done();
+ });
+
+}, "IDBObjectStore.openKeyCursor() - forward iteration with range");
+
+store_test(function(t, db, tx, store) {
+ var expected = [6, 5, 4];
+ var actual = [];
+ var request = store.openKeyCursor(IDBKeyRange.bound(4, 6), "prev");
+ request.onsuccess = t.step_func(function() {
+ var cursor = request.result;
+ if (!cursor)
+ return;
+ assert_equals(cursor.direction, "prev");
+ assert_false("value" in cursor);
+ assert_equals(indexedDB.cmp(cursor.key, cursor.primaryKey), 0);
+ actual.push(cursor.key);
+ cursor.continue();
+ });
+
+ tx.onabort = t.unreached_func("transaction aborted");
+ tx.oncomplete = t.step_func(function() {
+ assert_array_equals(expected, actual, "keys should match");
+ t.done();
+ });
+
+}, "IDBObjectStore.openKeyCursor() - reverse iteration with range");
+
+store_test(function(t, db, tx, store) {
+ assert_throws("DataError", function() { store.openKeyCursor(NaN); },
+ "openKeyCursor should throw on invalid number key");
+ assert_throws("DataError", function() { store.openKeyCursor(new Date(NaN)); },
+ "openKeyCursor should throw on invalid date key");
+ assert_throws("DataError", function() {
+ var cycle = [];
+ cycle.push(cycle);
+ store.openKeyCursor(cycle);
+ }, "openKeyCursor should throw on invalid array key");
+ assert_throws("DataError", function() { store.openKeyCursor({}); },
+ "openKeyCursor should throw on invalid key type");
+ setTimeout(t.step_func(function() {
+ assert_throws("TransactionInactiveError", function() { store.openKeyCursor(); },
+ "openKeyCursor should throw if transaction is inactive");
+ t.done();
+ }), 0);
+
+}, "IDBObjectStore.openKeyCursor() - invalid inputs");
+</script>
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/IndexedDB/support.js b/third_party/WebKit/LayoutTests/imported/web-platform-tests/IndexedDB/support.js
index 2eeca4f1..1e8458fe 100644
--- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/IndexedDB/support.js
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/IndexedDB/support.js
@@ -1,29 +1,6 @@
var databaseName = "database";
var databaseVersion = 1;
-if (!window.indexedDB)
-{
- if (window.msIndexedDB)
- {
- window.indexedDB = window.msIndexedDB;
- }
- else if (window.mozIndexedDB)
- {
- window.indexedDB = window.mozIndexedDB;
- }
- else if (window.webkitIndexedDB)
- {
- window.indexedDB = webkitIndexedDB;
- IDBCursor = webkitIDBCursor;
- IDBDatabaseException = webkitIDBDatabaseException;
- IDBIndex = webkitIDBIndex;
- IDBObjectStore = webkitIDBObjectStore;
- IDBRequest = webkitIDBRequest;
- IDBKeyRange = webkitIDBKeyRange;
- IDBTransaction = webkitIDBTransaction;
- }
-}
-
/* Delete created databases
*
* Go through each finished test, see if it has an associated database. Close
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/README.md b/third_party/WebKit/LayoutTests/imported/web-platform-tests/README.md
index 8157a4a..cac36bc 100644
--- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/README.md
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/README.md
@@ -2,8 +2,10 @@
==============================
The Web Platform Tests Project is a W3C-coordinated attempt to build a
-cross-browser testsuite for the Web-platform stack. Writing tests in a
-way that allows them to be run in all browsers gives browser projects
+cross-browser testsuite for the Web-platform stack. However, for mainly
+historic reasons, the CSS WG testsuite is in a separate repository,
+[csswg-test](https://github.com/w3c/csswg-test). Writing tests in a way
+that allows them to be run in all browsers gives browser projects
confidence that they are shipping software that is compatible with other
implementations, and that later implementations will be compatible with
their implementations. This in turn gives Web authors/developers
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/dom/documents/dom-tree-accessors/document.title-09-expected.txt b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/dom/documents/dom-tree-accessors/document.title-09-expected.txt
index 3a3c938..1bd121d 100644
--- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/dom/documents/dom-tree-accessors/document.title-09-expected.txt
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/dom/documents/dom-tree-accessors/document.title-09-expected.txt
@@ -2,6 +2,7 @@
FAIL No title element in SVG document assert_equals: expected "title" but got "x-child"
FAIL Title element in SVG document assert_equals: expected "foobar" but got "foo"
FAIL Title element not child of SVG root assert_equals: expected "" but got "foo"
-PASS Title element not in SVG namespace
+FAIL Title element not in SVG namespace assert_equals: expected "" but got "foo"
+FAIL Root element not named "svg" assert_equals: expected "" but got "foo"
Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/dom/documents/dom-tree-accessors/document.title-09.html b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/dom/documents/dom-tree-accessors/document.title-09.html
index 1fafab8..e32ed33 100644
--- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/dom/documents/dom-tree-accessors/document.title-09.html
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/dom/documents/dom-tree-accessors/document.title-09.html
@@ -5,21 +5,25 @@
<div id="log"></div>
<script>
var SVG_NAMESPACE = "http://www.w3.org/2000/svg";
+var HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
function newSVGDocument() {
return document.implementation.createDocument(SVG_NAMESPACE, "svg", null);
}
+function assertIsSVGTitle(element, expectedText) {
+ assert_equals(element.namespaceURI, SVG_NAMESPACE);
+ assert_equals(element.localName, "title");
+ assert_equals(element.textContent, expectedText);
+}
+
test(function() {
var doc = newSVGDocument();
assert_equals(doc.title, "");
var child = doc.createElementNS(SVG_NAMESPACE, "x-child");
doc.documentElement.appendChild(child);
doc.title = "foo";
- var lastChild = doc.documentElement.lastChild;
- assert_equals(lastChild.namespaceURI, SVG_NAMESPACE);
- assert_equals(lastChild.localName, "title");
- assert_equals(lastChild.textContent, "foo");
+ assertIsSVGTitle(doc.documentElement.firstChild, "foo");
assert_equals(doc.title, "foo");
}, "No title element in SVG document");
@@ -48,13 +52,46 @@
child.appendChild(title);
doc.documentElement.appendChild(child);
assert_equals(doc.title, "");
+
+ // Now test that on setting, we create a new element and don't change the
+ // existing one
+ doc.title = "bar";
+ assert_equals(title.textContent, "foo");
+ assertIsSVGTitle(doc.documentElement.firstChild, "bar");
+ assert_equals(doc.title, "bar");
}, "Title element not child of SVG root");
test(function() {
var doc = newSVGDocument();
- var title = doc.createElement("title");
+ var title = doc.createElementNS(HTML_NAMESPACE, "title");
title.textContent = "foo";
doc.documentElement.appendChild(title);
assert_equals(doc.title, "");
}, "Title element not in SVG namespace");
+
+test(function() {
+ // "SVG" != "svg"
+ var doc = document.implementation.createDocument(SVG_NAMESPACE, "SVG", null);
+
+ // Per spec, this does nothing
+ doc.title = "foo";
+ assert_equals(doc.documentElement.childNodes.length, 0);
+ assert_equals(doc.title, "");
+
+ // An SVG title is ignored by .title
+ doc.documentElement.appendChild(doc.createElementNS(SVG_NAMESPACE, "title"));
+ doc.documentElement.lastChild.textContent = "foo";
+ assert_equals(doc.title, "");
+
+ // But an HTML title is respected
+ doc.documentElement.appendChild(doc.createElementNS(HTML_NAMESPACE, "title"));
+ doc.documentElement.lastChild.textContent = "bar";
+ assert_equals(doc.title, "bar");
+
+ // Even if it's not a child of the root
+ var div = doc.createElementNS(HTML_NAMESPACE, "div");
+ div.appendChild(doc.documentElement.lastChild);
+ doc.documentElement.appendChild(div);
+ assert_equals(doc.title, "bar");
+}, 'Root element not named "svg"');
</script>
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/dom/elements-embedded.js b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/dom/elements-embedded.js
index a948b62f..4966abdc 100644
--- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/dom/elements-embedded.js
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/dom/elements-embedded.js
@@ -141,7 +141,7 @@
hreflang: "string",
type: "string",
- //URLUtils
+ // HTMLHyperlinkElementUtils
href: "url",
// Obsolete
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/dom/elements-text.js b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/dom/elements-text.js
index bcfcb8f..96c1d923 100644
--- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/dom/elements-text.js
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/dom/elements-text.js
@@ -10,7 +10,7 @@
hreflang: "string",
type: "string",
- // URLUtils
+ // HTMLHyperlinkElementUtils
href: "url",
// Obsolete
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/forms/the-select-element/select-ask-for-reset.html b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/forms/the-select-element/select-ask-for-reset.html
new file mode 100644
index 0000000..b16a131
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/forms/the-select-element/select-ask-for-reset.html
@@ -0,0 +1,97 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>HTMLSelectElement ask for reset</title>
+<link rel="author" title="Dongie Agnir" href="dongie.agnir@gmail.com">
+<script src="../../../../../../resources/testharness.js"></script>
+<script src="../../../../../../resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+test(function() {
+ var select = makeSelect(5);
+
+ select.children[4].selected = true;
+ unselectedExcept(select, 4);
+
+ select.children[4].remove();
+ unselectedExcept(select, 0); // remove selected node, should default to first
+
+ select.children[3].selected = true;
+
+ select.children[0].remove();
+ unselectedExcept(select, 2); // last node still selected
+
+ select.size = 2;
+ select.children[2].remove();
+
+ unselectedExcept(select, null);
+}, "ask for reset on node remove, non multiple.");
+
+test(function() {
+ var select = makeSelect(3);
+ select.children[1].selected = true;
+
+ // insert selected option, should remain selected
+ var opt4 = document.createElement("option");
+ opt4.selected = true;
+ select.appendChild(opt4);
+ unselectedExcept(select, 3);
+
+ // insert unselected, 3 should remain selected
+ var opt5 = document.createElement("option");
+ select.appendChild(opt5);
+ unselectedExcept(select, 3);
+}, "ask for reset on node insert, non multiple.");
+
+test(function() {
+ var select = makeSelect(3);
+
+ var options = select.children;
+
+ // select options from first to last
+ for (var i = 0; i < options.length; ++i) {
+ options[i].selected = true;
+ unselectedExcept(select, i);
+ }
+
+ // select options from last to first
+ for (var i = options.length - 1; i >= 0; --i) {
+ options[i].selected = true;
+ unselectedExcept(select, i);
+ }
+
+ options[2].selected = true;
+ options[2].selected = false; // none selected
+ unselectedExcept(select, 0);
+
+ // disable first so option at index 1 is first eligible
+ options[0].disabled = true;
+ options[2].selected = true;
+ options[2].selected = false; // none selected
+ unselectedExcept(select, 1);
+
+ select.size = 2;
+ options[1].selected = false;
+ unselectedExcept(select, null); // size > 1 so should not default to any
+}, "change selectedness of option, non multiple.");
+
+
+function unselectedExcept(sel, opt) {
+ for (var i = 0; i < sel.children.length; ++i) {
+ if (i != opt) {
+ assert_false(sel.children[i].selected, "option should not be selected.");
+ }
+ if (opt != null) {
+ assert_true(sel.children[opt].selected, "option should be selected.");
+ }
+ }
+}
+
+function makeSelect(n) {
+ var sel = document.createElement("select");
+ for (var i = 0; i < n; ++i) {
+ opt = document.createElement("option");
+ sel.appendChild(opt);
+ }
+ return sel;
+}
+</script>
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/tabular-data/attributes-common-to-td-and-th-elements/cellIndex.html b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/tabular-data/attributes-common-to-td-and-th-elements/cellIndex.html
index fbc0c3b2..036debc 100644
--- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/tabular-data/attributes-common-to-td-and-th-elements/cellIndex.html
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/tabular-data/attributes-common-to-td-and-th-elements/cellIndex.html
@@ -38,4 +38,13 @@
var td = tr.appendChild(document.createElement("td"));
assert_equals(td.cellIndex, 1);
}, "For cells whose parent is a tr, cellIndex should be the index.")
+test(function() {
+ var tr = document.createElement("tr");
+ var th = tr.appendChild(document.createElement("th"));
+ assert_equals(th.cellIndex, 0);
+ tr.appendChild(document.createElement("div"));
+ tr.appendChild(document.createTextNode("Hello World"));
+ var td = tr.appendChild(document.createElement("td"));
+ assert_equals(td.cellIndex, 1)
+}, "For cells whose parent is a tr with non td/th sibling, cellIndex should skip those non td/th siblings.")
</script>
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/tabular-data/the-tr-element/deleteCell-expected.txt b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/tabular-data/the-tr-element/deleteCell-expected.txt
new file mode 100644
index 0000000..2ad9a4c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/tabular-data/the-tr-element/deleteCell-expected.txt
@@ -0,0 +1,8 @@
+This is a testharness.js-based test.
+PASS HTMLTableRowElement deleteCell(0)
+PASS HTMLTableRowElement deleteCell(-1)
+PASS HTMLTableRowElement deleteCell(-2)
+PASS HTMLTableRowElement deleteCell(cells.length)
+FAIL HTMLTableRowElement deleteCell(-1) with no cells Failed to execute 'deleteCell' on 'HTMLTableRowElement': The value provided (-1) is outside the range [0, 0).
+Harness: the test ran to completion.
+
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/tabular-data/the-tr-element/deleteCell.html b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/tabular-data/the-tr-element/deleteCell.html
index d9efafaa..93246ded 100644
--- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/tabular-data/the-tr-element/deleteCell.html
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/tabular-data/the-tr-element/deleteCell.html
@@ -43,4 +43,12 @@
});
}, "HTMLTableRowElement deleteCell(cells.length)");
+test(function () {
+ assert_equals(tr.cells.length, 1);
+ tr.deleteCell(-1);
+ assert_equals(tr.cells.length, 0);
+ tr.deleteCell(-1);
+ assert_equals(tr.cells.length, 0);
+}, "HTMLTableRowElement deleteCell(-1) with no cells");
+
</script>
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/resources/testharness.js b/third_party/WebKit/LayoutTests/imported/web-platform-tests/resources/testharness.js
index 4e203c4..7920ccd4 100644
--- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/resources/testharness.js
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/resources/testharness.js
@@ -1176,6 +1176,7 @@
NO_MODIFICATION_ALLOWED_ERR: 'NoModificationAllowedError',
NOT_FOUND_ERR: 'NotFoundError',
NOT_SUPPORTED_ERR: 'NotSupportedError',
+ INUSE_ATTRIBUTE_ERR: 'InUseAttributeError',
INVALID_STATE_ERR: 'InvalidStateError',
SYNTAX_ERR: 'SyntaxError',
INVALID_MODIFICATION_ERR: 'InvalidModificationError',
@@ -1202,6 +1203,7 @@
NoModificationAllowedError: 7,
NotFoundError: 8,
NotSupportedError: 9,
+ InUseAttributeError: 10,
InvalidStateError: 11,
SyntaxError: 12,
InvalidModificationError: 13,
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/shadow-dom/untriaged/shadow-trees/upper-boundary-encapsulation/dom-tree-accessors-001.html b/third_party/WebKit/LayoutTests/imported/web-platform-tests/shadow-dom/untriaged/shadow-trees/upper-boundary-encapsulation/dom-tree-accessors-001.html
index c6cbf85..3b74b35 100644
--- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/shadow-dom/untriaged/shadow-trees/upper-boundary-encapsulation/dom-tree-accessors-001.html
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/shadow-dom/untriaged/shadow-trees/upper-boundary-encapsulation/dom-tree-accessors-001.html
@@ -37,7 +37,7 @@
// (document.)anchors, applets, and all.
//
// and some accessors defined in the DOM specification (formerly known as
-// "DOM Core") <https://dom.spec.whatwg.org/#interface-document>:
+// "DOM Core") <http://dom.spec.whatwg.org/#interface-document>:
// (document.)documentElement, getElementsByTagName(),
// getElementsByTagNameNS(), getElementsByClassName(), and getElementById().
//