Update web-platform-tests to revision 78f764c05c229883e87ad135c7153051a66e2851

This commit is contained in:
WPT Sync Bot 2019-03-06 20:32:15 -05:00
parent 55347aa39f
commit bf84a079f9
1983 changed files with 58006 additions and 31437 deletions

View file

@ -2,119 +2,119 @@
function __result_handler() {
function __get_metadata() {
var obj = new Object();
var author = [];
var assert = [];
var help = [];
var match = [];
var mismatch = [];
var flags = [];
var nodes;
var obj = new Object();
var author = [];
var assert = [];
var help = [];
var match = [];
var mismatch = [];
var flags = [];
var nodes;
nodes = document.querySelectorAll('link[rel="author"]');
for (var i = 0; i < nodes.length; i++) {
var href = nodes[i].getAttribute("href");
var title = nodes[i].getAttribute("title");
var s = title;
if (href != null) {
s += " <" + href + ">";
}
author.push(s);
}
if (nodes.length > 0) obj.author = author;
nodes = document.querySelectorAll('meta[name="assert"]');
for (var i = 0; i < nodes.length; i++) {
assert.push(nodes[i].getAttribute("content"));
}
if (nodes.length > 0) obj.assert = assert;
nodes = document.querySelectorAll('link[rel="help"]');
for (var i = 0; i < nodes.length; i++) {
help.push(nodes[i].getAttribute("href"));
}
if (nodes.length > 0) obj.help = help;
nodes = document.querySelectorAll('link[rel="match"]');
for (var i = 0; i < nodes.length; i++) {
match.push(nodes[i].getAttribute("href"));
}
if (nodes.length > 0) obj.match = match;
nodes = document.querySelectorAll('link[rel="mismatch"]');
for (var i = 0; i < nodes.length; i++) {
mismatch.push(nodes[i].getAttribute("href"));
}
if (nodes.length > 0) obj.match = mismatch;
nodes = document.querySelectorAll('meta[name="flags"]');
for (var i = 0; i < nodes.length; i++) {
flags.push(nodes[i].getAttribute("content"));
}
if (nodes.length > 0) obj.flags = flags;
nodes = document.querySelectorAll('link[rel="author"]');
for (var i = 0; i < nodes.length; i++) {
var href = nodes[i].getAttribute("href");
var title = nodes[i].getAttribute("title");
var s = title;
if (href != null) {
s += " <" + href + ">";
}
author.push(s);
}
if (nodes.length > 0) obj.author = author;
nodes = document.querySelectorAll('meta[name="assert"]');
for (var i = 0; i < nodes.length; i++) {
assert.push(nodes[i].getAttribute("content"));
}
if (nodes.length > 0) obj.assert = assert;
nodes = document.querySelectorAll('link[rel="help"]');
for (var i = 0; i < nodes.length; i++) {
help.push(nodes[i].getAttribute("href"));
}
if (nodes.length > 0) obj.help = help;
nodes = document.querySelectorAll('link[rel="match"]');
for (var i = 0; i < nodes.length; i++) {
match.push(nodes[i].getAttribute("href"));
}
if (nodes.length > 0) obj.match = match;
nodes = document.querySelectorAll('link[rel="mismatch"]');
for (var i = 0; i < nodes.length; i++) {
mismatch.push(nodes[i].getAttribute("href"));
}
if (nodes.length > 0) obj.match = mismatch;
nodes = document.querySelectorAll('meta[name="flags"]');
for (var i = 0; i < nodes.length; i++) {
flags.push(nodes[i].getAttribute("content"));
}
if (nodes.length > 0) obj.flags = flags;
return obj;
return obj;
}
var meta = __get_metadata();
var nodes;
function copy(obj, prop, arr) {
if (typeof arr !== "undefined") {
var a = [];
for (var i = 0; i<arr.length;i++) {
a[i] = arr[i];
}
obj[prop] = a;
}
if (typeof arr !== "undefined") {
var a = [];
for (var i = 0; i<arr.length;i++) {
a[i] = arr[i];
}
obj[prop] = a;
}
}
var ret = new Object();
ret.location = document.location.href;
ret.type = "manual";
ret.type = "manual";
ret.tests = new Object();
var node = document.querySelector('script[src$="/resources/testharness.js"]');
if (node !== null) {
ret.type = "script";
ret.type = "script";
}
if (ret.type === "script") {
if (typeof metadata_generator === "undefined"
|| Object.keys(metadata_generator.currentMetadata).length === 0)
return "WRAPPER:TRY_AGAIN";
else {
for (var key in metadata_generator.currentMetadata) {
var obj = metadata_generator.currentMetadata[key];
var newtest = new Object();
ret.tests[key]= newtest;
if (typeof obj.help === "undefined") {
copy(newtest, "help", meta.help);
} else if (typeof obj.help === "string") {
newtest.help = [ obj.help ];
}
if (typeof obj.author === "undefined") {
copy(newtest, "author", meta.author);
} else if (typeof obj.author === "string") {
newtest.author = [ obj.author ];
}
if (typeof obj.assert === "undefined") {
copy(newtest, "assert", meta.assert);
} else if (typeof obj.assert === "string") {
newtest.assert = [ obj.assert ];
}
copy(newtest, "match", meta.match);
copy(newtest, "mismatch", meta.mismatch);
copy(newtest, "flags", meta.flags);
}
return ret;
}
if (typeof metadata_generator === "undefined"
|| Object.keys(metadata_generator.currentMetadata).length === 0)
return "WRAPPER:TRY_AGAIN";
else {
for (var key in metadata_generator.currentMetadata) {
var obj = metadata_generator.currentMetadata[key];
var newtest = new Object();
ret.tests[key]= newtest;
if (typeof obj.help === "undefined") {
copy(newtest, "help", meta.help);
} else if (typeof obj.help === "string") {
newtest.help = [ obj.help ];
}
if (typeof obj.author === "undefined") {
copy(newtest, "author", meta.author);
} else if (typeof obj.author === "string") {
newtest.author = [ obj.author ];
}
if (typeof obj.assert === "undefined") {
copy(newtest, "assert", meta.assert);
} else if (typeof obj.assert === "string") {
newtest.assert = [ obj.assert ];
}
copy(newtest, "match", meta.match);
copy(newtest, "mismatch", meta.mismatch);
copy(newtest, "flags", meta.flags);
}
return ret;
}
} else {
var newtest = meta;
ret.tests[document.title]= newtest;
var newtest = meta;
ret.tests[document.title]= newtest;
if (typeof newtest.match !== "undefined"
|| typeof newtest.mismatch !== "undefined") {
ret.type = "reftest";
}
if (typeof newtest.match !== "undefined"
|| typeof newtest.mismatch !== "undefined") {
ret.type = "reftest";
}
return ret;
return ret;
}
}
@ -122,19 +122,19 @@ function __result_handler() {
function __give_up() {
var ret = new Object();
ret.location = document.location.href;
ret.type = "manual";
ret.type = "manual";
ret.tests = new Object();
var node = document.querySelector('script[src$="/resources/testharness.js"]');
if (node !== null) {
ret.type = "script";
ret.type = "script";
} else if (typeof newtest.match !== "undefined"
|| typeof newtest.mismatch !== "undefined") {
ret.type = "reftest";
|| typeof newtest.mismatch !== "undefined") {
ret.type = "reftest";
}
var newtest = __get_metadata();
ret.tests[document.title]= newtest;
ret.tests[document.title]= newtest;
return ret;
}

View file

@ -1,106 +1,106 @@
// grab the table of contents filled with all the anchors
function __result_handler() {
function getMap() {
var toc_element = document.getElementById("contents").nextElementSibling;
var toc_element = document.getElementById("contents").nextElementSibling;
function getSection() {
function getIds(node) {
var a = [];
var nodes = node.querySelectorAll('*[id]');
for (var i = 0; i < nodes.length; i++) {
a.push(nodes[i].getAttribute("id"));
}
return a;
}
function getTOCIds() {
var a = [];
var nodes = toc_element.querySelectorAll('li');
for (var i = 0; i < nodes.length; i++) {
var href = nodes[i].firstElementChild.getAttribute("href");
a.push(href.substring(1));
}
return a;
}
function getSection() {
function getIds(node) {
var a = [];
var obj = new Object();
var ids = getIds(document);
var toc = getTOCIds();
for (var i = 1; i < toc.length; i++) {
var key1 = toc[i-1];
var key2 = toc[i];
var map = [];
var nodes = node.querySelectorAll('*[id]');
for (var i = 0; i < nodes.length; i++) {
a.push(nodes[i].getAttribute("id"));
}
return a;
}
var index1 = ids.indexOf(key1);
var index2 = ids.indexOf(key2);
function getTOCIds() {
var a = [];
if ((index2-index1) > 1) {
for (var j = index1+1; j < index2;j++) {
map.push(ids[j]);
}
}
var nodes = toc_element.querySelectorAll('li');
for (var i = 0; i < nodes.length; i++) {
var href = nodes[i].firstElementChild.getAttribute("href");
a.push(href.substring(1));
}
return a;
}
obj[key1] = map;
}
{
var key = toc[toc.length-1];
var index = ids.indexOf(key);
var map = [];
var obj = new Object();
var ids = getIds(document);
var toc = getTOCIds();
for (var j = index+1; j < ids.length;j++) {
map.push(ids[j]);
}
obj[key] = map;
}
return obj;
}
for (var i = 1; i < toc.length; i++) {
var key1 = toc[i-1];
var key2 = toc[i];
var map = [];
function section(id) {
this.id = id;
}
function addSubSection(section, sub) {
if (typeof section.sections === "undefined") {
section.sections = [];
}
section.sections.push(sub);
}
var index1 = ids.indexOf(key1);
var index2 = ids.indexOf(key2);
function li(el, map) {
var obj = new section(el.firstElementChild.getAttribute("href").substring(1));
obj.title = el.firstElementChild.textContent;
var child = el.firstElementChild;
if ((index2-index1) > 1) {
for (var j = index1+1; j < index2;j++) {
map.push(ids[j]);
}
}
var m = map[obj.id];
for (var i = 0; i < m.length; i++) {
var sub = new section(m[i]);
addSubSection(obj, sub);
}
while (child !== null) {
if (child.nodeName === "OL") ol(child, obj, map);
child = child.nextElementSibling;
}
return obj;
}
obj[key1] = map;
}
{
var key = toc[toc.length-1];
var index = ids.indexOf(key);
var map = [];
function ol(el, section, map) {
var child = el.firstElementChild;
while (child !== null) {
addSubSection(section, li(child, map));
child = child.nextElementSibling;
}
}
for (var j = index+1; j < ids.length;j++) {
map.push(ids[j]);
}
obj[key] = map;
}
var map = getSection();
var main = new section("___main___");
main.title = document.title;
return obj;
}
ol(toc_element, main, map);
function section(id) {
this.id = id;
}
function addSubSection(section, sub) {
if (typeof section.sections === "undefined") {
section.sections = [];
}
section.sections.push(sub);
}
return main;
function li(el, map) {
var obj = new section(el.firstElementChild.getAttribute("href").substring(1));
obj.title = el.firstElementChild.textContent;
var child = el.firstElementChild;
var m = map[obj.id];
for (var i = 0; i < m.length; i++) {
var sub = new section(m[i]);
addSubSection(obj, sub);
}
while (child !== null) {
if (child.nodeName === "OL") ol(child, obj, map);
child = child.nextElementSibling;
}
return obj;
}
function ol(el, section, map) {
var child = el.firstElementChild;
while (child !== null) {
addSubSection(section, li(child, map));
child = child.nextElementSibling;
}
}
var map = getSection();
var main = new section("___main___");
main.title = document.title;
ol(toc_element, main, map);
return main;
}
return getMap();