mirror of
https://github.com/servo/servo.git
synced 2025-08-12 00:45:33 +01:00
Update web-platform-tests to revision 4a5223502fa660ce03e470af6a61c8bc26c5a8ee
This commit is contained in:
parent
c5f7c9ccf3
commit
e891345f26
1328 changed files with 36632 additions and 20588 deletions
|
@ -4,17 +4,17 @@
|
|||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
var t = async_test(undefined, {timeout:2000});
|
||||
var t = async_test();
|
||||
|
||||
var loaded = false;
|
||||
var unload_fired = false;
|
||||
var timeout_fired = false;
|
||||
|
||||
function start_test() {
|
||||
setTimeout(t.step_func(function() {
|
||||
assert_true(unload_fired);
|
||||
assert_false(timeout_fired);
|
||||
t.done()
|
||||
step_timeout(t.step_func(function() {
|
||||
assert_true(unload_fired);
|
||||
assert_false(timeout_fired);
|
||||
t.done()
|
||||
}), 1000);
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
test(t => {
|
||||
assert_false('applicationCache' in window);
|
||||
assert_equals(window.applicationCache, undefined);
|
||||
}, "window.applicationCache does not exist in non-secure contexts.");
|
||||
|
||||
test(t => {
|
||||
assert_false('ApplicationCache' in window);
|
||||
assert_equals(typeof ApplicationCache, "undefined");
|
||||
}, "ApplicationCache interface does not exist in non-secure contexts.");
|
||||
|
||||
test(t => {
|
||||
assert_false('ApplicationCacheErrorEvent' in window);
|
||||
assert_equals(typeof ApplicationCacheErrorEvent, "undefined");
|
||||
}, "ApplicationCacheErrorEvent interface does not exist in non-secure contexts.");
|
||||
</script>
|
||||
</head>
|
||||
</html>
|
|
@ -195,7 +195,7 @@ onload = function() {
|
|||
var frame = document.createElement('iframe');
|
||||
frame.id = "fr";
|
||||
frame.setAttribute("style", "display:none");
|
||||
frame.setAttribute('src', get_host_info().HTTP_REMOTE_ORIGIN + "/");
|
||||
frame.setAttribute('src', get_host_info().HTTPS_REMOTE_ORIGIN + "/");
|
||||
frame.setAttribute("onload", "fr_load()");
|
||||
document.body.appendChild(frame);
|
||||
}
|
|
@ -52,4 +52,36 @@ test(function() {
|
|||
assert_equals(document.embeds, document.plugins,
|
||||
"embeds should be the same as plugins");
|
||||
}, "Two plugins");
|
||||
|
||||
test(function() {
|
||||
var embed1 = document.createElement("embed"),
|
||||
embed2 = document.createElement("embed");
|
||||
document.body.appendChild(embed1);
|
||||
this.add_cleanup(function() { document.body.removeChild(embed1) });
|
||||
var embeds = document.embeds;
|
||||
assert_true(embeds instanceof HTMLCollection);
|
||||
assert_equals(embeds.length, 1);
|
||||
|
||||
document.body.appendChild(embed2);
|
||||
assert_equals(embeds.length, 2);
|
||||
|
||||
document.body.removeChild(embed2);
|
||||
assert_equals(embeds.length, 1);
|
||||
}, "Document.embeds should be a live collection");
|
||||
|
||||
test(function() {
|
||||
var embed1 = document.createElement("embed"),
|
||||
embed2 = document.createElement("embed");
|
||||
document.body.appendChild(embed1);
|
||||
this.add_cleanup(function() { document.body.removeChild(embed1) });
|
||||
var pls = document.plugins;
|
||||
assert_true(pls instanceof HTMLCollection);
|
||||
assert_equals(pls.length, 1);
|
||||
|
||||
document.body.appendChild(embed2);
|
||||
assert_equals(pls.length, 2);
|
||||
|
||||
document.body.removeChild(embed2);
|
||||
assert_equals(pls.length, 1);
|
||||
}, "Document.plugins should be a live collection");
|
||||
</script>
|
||||
|
|
|
@ -67,4 +67,17 @@ test(function() {
|
|||
var result = Object.getOwnPropertyNames(document.forms);
|
||||
assert_array_equals(result, ["0", "1", "2", "form1", "form2"])
|
||||
}, "document.forms getOwnPropertyNames")
|
||||
|
||||
test(function() {
|
||||
var forms = document.forms;
|
||||
assert_true(forms instanceof HTMLCollection);
|
||||
assert_equals(forms.length, 3);
|
||||
|
||||
var form = document.createElement("form");
|
||||
document.body.appendChild(form);
|
||||
assert_equals(forms.length, 4);
|
||||
|
||||
document.body.removeChild(form);
|
||||
assert_equals(forms.length, 3);
|
||||
}, "Document.forms should be a live collection");
|
||||
</script>
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
<!DOCTYPE html>
|
||||
<title>Document.getElementsByName: liveness</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
var input = document.createElement("input"),
|
||||
embed = document.createElement("embed");
|
||||
input.setAttribute("name", "test");
|
||||
input.setAttribute("type", "text");
|
||||
embed.setAttribute("name", "test");
|
||||
document.body.appendChild(input);
|
||||
this.add_cleanup(function() { document.body.removeChild(input) });
|
||||
var e = document.getElementsByName("test");
|
||||
assert_true(e instanceof NodeList);
|
||||
assert_equals(e.length, 1);
|
||||
|
||||
document.body.appendChild(embed);
|
||||
assert_equals(e.length, 2);
|
||||
|
||||
document.body.removeChild(embed);
|
||||
assert_equals(e.length, 1);
|
||||
}, "Document.getElementsByName() should be a live collection");
|
||||
</script>
|
|
@ -102,4 +102,18 @@ test(function() {
|
|||
assert_equals(c.namedItem(""), null);
|
||||
assert_false("" in c, '"" in c');
|
||||
}, "The empty string should not be in the collections");
|
||||
|
||||
test(function() {
|
||||
var div = document.getElementById("test");
|
||||
var imgs = document.images;
|
||||
assert_true(imgs instanceof HTMLCollection);
|
||||
assert_equals(imgs.length, 10);
|
||||
|
||||
var img = document.createElement("img");
|
||||
div.appendChild(img);
|
||||
assert_equals(imgs.length, 11);
|
||||
|
||||
div.removeChild(img);
|
||||
assert_equals(imgs.length, 10);
|
||||
}, "Document.images should be a live collection");
|
||||
</script>
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>Document.links</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com">
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<div id=log></div>
|
||||
<div id=test>
|
||||
<a href=""></a>
|
||||
<a href=""></a>
|
||||
</div>
|
||||
<script>
|
||||
test(function() {
|
||||
var div = document.getElementById("test");
|
||||
var links = document.links;
|
||||
assert_true(links instanceof HTMLCollection);
|
||||
assert_equals(links.length, 2);
|
||||
|
||||
var a = document.createElement("a");
|
||||
a.setAttribute("href", "");
|
||||
div.appendChild(a);
|
||||
assert_equals(links.length, 3);
|
||||
|
||||
div.removeChild(a);
|
||||
assert_equals(links.length, 2);
|
||||
}, "Document.links should be a live collection");
|
||||
</script>
|
|
@ -0,0 +1,21 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>Document.scripts</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com">
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<div id=log></div>
|
||||
<script>
|
||||
test(function() {
|
||||
var scripts = document.scripts;
|
||||
assert_true(scripts instanceof HTMLCollection);
|
||||
assert_equals(scripts.length, 3);
|
||||
|
||||
var script = document.createElement("script");
|
||||
document.body.appendChild(script);
|
||||
assert_equals(scripts.length, 4);
|
||||
|
||||
document.body.removeChild(script);
|
||||
assert_equals(scripts.length, 3);
|
||||
}, "Document.scripts should be a live collection");
|
||||
</script>
|
|
@ -0,0 +1 @@
|
|||
Some text.
|
|
@ -0,0 +1,23 @@
|
|||
["replace",
|
||||
"NOBODY",
|
||||
"@ FD ;",
|
||||
"it does not matter, you see \f",
|
||||
"text/plain",
|
||||
"text/xml",
|
||||
"application/octet-stream",
|
||||
"\0"].forEach(type => {
|
||||
async_test(t => {
|
||||
const frame = document.createElement("iframe");
|
||||
frame.src = "type-argument-plaintext-subframe.txt";
|
||||
document.body.appendChild(frame);
|
||||
t.add_cleanup(() => frame.remove());
|
||||
frame.onload = t.step_func_done(() => {
|
||||
frame.contentDocument.open(type);
|
||||
frame.contentDocument.write("<B>heya</b>");
|
||||
frame.contentDocument.close();
|
||||
assert_equals(frame.contentDocument.body.firstChild.localName, "b");
|
||||
assert_equals(frame.contentDocument.body.textContent, "heya");
|
||||
assert_equals(frame.contentDocument.contentType, "text/plain");
|
||||
});
|
||||
}, "document.open() on plaintext document with type set to: " + type + " (type argument is supposed to be ignored)");
|
||||
});
|
|
@ -197,7 +197,7 @@ function doTest([html, dom, cssom, uievents, touchevents]) {
|
|||
PeerConnection: [],
|
||||
MediaStreamEvent: [],
|
||||
ErrorEvent: [],
|
||||
WebSocket: ['new WebSocket("ws://foo")'],
|
||||
WebSocket: ['new WebSocket("wss://foo")'],
|
||||
CloseEvent: ['new CloseEvent("close")'],
|
||||
AbstractWorker: [],
|
||||
Worker: [],
|
|
@ -7,17 +7,12 @@
|
|||
<meta assert="assert" content="Check if the key events received by document are targeted at the element when it is focused">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<h2>Steps:</h2>
|
||||
<ol>
|
||||
<li>Input any character into the textbox by keyboard in 10 seconds.</li>
|
||||
</ol>
|
||||
<h2>Expect results:</h2>
|
||||
<p>PASS</p>
|
||||
<script src="/resources/testdriver.js"></script>
|
||||
<script src="/resources/testdriver-vendor.js"></script>
|
||||
<div id="log"></div>
|
||||
<input id="test">
|
||||
<script>
|
||||
|
||||
//These tests can be automated once we have an uniform way to use webdriver.
|
||||
var t1 = async_test("The keydown event must be targeted at the input element"),
|
||||
t2 = async_test("The keypress event must be targeted at the input element"),
|
||||
t3 = async_test("The keyup event must be targeted at the input element"),
|
||||
|
@ -40,4 +35,10 @@ document.onkeyup = t3.step_func_done(function(evt){
|
|||
assert_equals(evt.target, testEle, "The keyup events must be targeted at the input element.");
|
||||
});
|
||||
|
||||
var input_element = document.getElementById("test");
|
||||
|
||||
t1.step(function() {
|
||||
test_driver.send_keys(input_element, "a");
|
||||
});
|
||||
|
||||
</script>
|
|
@ -7,16 +7,11 @@
|
|||
<meta assert="assert" content="Check if the key events received by document are targeted at the element when no element is focused">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<h2>Steps:</h2>
|
||||
<ol>
|
||||
<li>Press any key in [0-9a-zA-Z].</li>
|
||||
</ol>
|
||||
<h2>Expect results:</h2>
|
||||
<p>PASS</p>
|
||||
<script src="/resources/testdriver.js"></script>
|
||||
<script src="/resources/testdriver-vendor.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
|
||||
//These tests can be automated once we have an uniform way to use webdriver.
|
||||
var t1 = async_test("The keydown event must be targeted at the body element"),
|
||||
t2 = async_test("The keypress event must be targeted at the body element"),
|
||||
t3 = async_test("The keyup event must be targeted at the body element");
|
||||
|
@ -35,4 +30,8 @@ document.onkeyup = t3.step_func_done(function(evt){
|
|||
assert_equals(evt.target, document.body, "The keyup events must be targeted at the document's body.");
|
||||
});
|
||||
|
||||
t1.step(function() {
|
||||
test_driver.send_keys(document.body, "a");
|
||||
});
|
||||
|
||||
</script>
|
|
@ -7,12 +7,8 @@
|
|||
<meta assert="assert" content="Check if the tabindex attribute controls whether an element is supposed to be focusable">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<h2>Steps:</h2>
|
||||
<ol>
|
||||
<li>Press 'Tab' key in 10 seconds.</li>
|
||||
</ol>
|
||||
<h2>Expect results:</h2>
|
||||
<p>PASS</p>
|
||||
<script src="/resources/testdriver.js"></script>
|
||||
<script src="/resources/testdriver-vendor.js"></script>
|
||||
<div id="log"></div>
|
||||
<form id="fm">
|
||||
<input id="test1" tabindex="-1">
|
||||
|
@ -20,7 +16,6 @@
|
|||
</form>
|
||||
<script>
|
||||
|
||||
//This test can be automated once we have an uniform way to use webdriver.
|
||||
var t = async_test("The element with a negative tabindex must not be focused by press 'Tab' key");
|
||||
|
||||
setup({timeout: 10000});
|
||||
|
@ -41,4 +36,9 @@ document.addEventListener("keydown", function (evt) {
|
|||
});
|
||||
}, true);
|
||||
|
||||
t.step(function () {
|
||||
// TAB = '\ue004'
|
||||
test_driver.send_keys(document.body, "\ue004");
|
||||
});
|
||||
|
||||
</script>
|
|
@ -2,17 +2,13 @@
|
|||
<meta charset="utf-8">
|
||||
<title>HTML Test: focus - the sequential focus navigation order</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com/">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#sequential-focus-navigation-and-the-tabindex-attribute">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/interaction.html#sequential-focus-navigation">
|
||||
<meta assert="flag" content="interact">
|
||||
<meta assert="assert" content="Check the sequential focus navigation order">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<h2>Steps:</h2>
|
||||
<ol>
|
||||
<li>Press 'Tab' key at least 10 times in 20 seconds.(Long press the 'Tab' key will be better.)</li>
|
||||
</ol>
|
||||
<h2>Expect results:</h2>
|
||||
<p>PASS</p>
|
||||
<script src="/resources/testdriver.js"></script>
|
||||
<script src="/resources/testdriver-vendor.js"></script>
|
||||
<div id="log"></div>
|
||||
<form id="fm">
|
||||
<button id="btn0">tabindex(omitted)</button>
|
||||
|
@ -28,32 +24,41 @@
|
|||
</form>
|
||||
<script>
|
||||
|
||||
//This test can be automated once we have an uniform way to use webdriver.
|
||||
var i = 0,
|
||||
expectation = ["btn9", "btn6", "btn7", "btn8", "btn5", "btn0", "btn1", "btn2", "btn4"],
|
||||
results = [],
|
||||
t = async_test("The element with a zero tabindex must be focused by press 'Tab' key");
|
||||
t = async_test("Elements with different tabindex must be focused sequentially when pressing 'Tab' keys");
|
||||
|
||||
setup(function () {
|
||||
document.body.focus();
|
||||
}, {timeout: 20000});
|
||||
|
||||
|
||||
|
||||
document.forms.fm.addEventListener("focus", function (evt) {
|
||||
results.push(evt.target.id);
|
||||
if (i >= 9) {
|
||||
if (i >= 8) {
|
||||
t.step(function () {
|
||||
assert_array_equals(results, expectation);
|
||||
});
|
||||
t.done();
|
||||
} else {
|
||||
t.step(function () {
|
||||
// TAB = '\ue004'
|
||||
test_driver.send_keys(document.body, "\ue004");
|
||||
});
|
||||
}
|
||||
i++;
|
||||
}, true);
|
||||
|
||||
document.addEventListener("keydown", function (evt) {
|
||||
if (evt.keyCode === 9) {
|
||||
i += 1;
|
||||
if (i === 10) {
|
||||
t.done();
|
||||
}
|
||||
}
|
||||
t.step(function () {
|
||||
assert_equals(evt.keyCode, 9, "Please press 'Tab' key.");
|
||||
});
|
||||
}, true);
|
||||
|
||||
t.step(function () {
|
||||
// TAB = '\ue004'
|
||||
test_driver.send_keys(document.body, "\ue004");
|
||||
});
|
||||
</script>
|
|
@ -7,19 +7,14 @@
|
|||
<meta assert="assert" content="Check if the tabindex attribute controls whether an element is supposed to be focusable">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<h2>Steps:</h2>
|
||||
<ol>
|
||||
<li>Press 'Tab' key in 10 seconds.</li>
|
||||
</ol>
|
||||
<h2>Expect results:</h2>
|
||||
<p>PASS</p>
|
||||
<script src="/resources/testdriver.js"></script>
|
||||
<script src="/resources/testdriver-vendor.js"></script>
|
||||
<div id="log"></div>
|
||||
<form id="fm">
|
||||
<input id="test" tabindex="1">
|
||||
</form>
|
||||
<script>
|
||||
|
||||
//This test can be automated once we have an uniform way to use webdriver.
|
||||
var t = async_test("The element with a positive tabindex must be focused by press 'Tab' key");
|
||||
|
||||
setup({timeout: 10000});
|
||||
|
@ -40,4 +35,9 @@ document.addEventListener("keydown", function (evt) {
|
|||
});
|
||||
}, true);
|
||||
|
||||
t.step(function () {
|
||||
// TAB = '\ue004'
|
||||
test_driver.send_keys(document.body, "\ue004");
|
||||
});
|
||||
|
||||
</script>
|
|
@ -8,20 +8,15 @@
|
|||
<meta assert="assert" content="Check if the tabindex attribute controls whether an element is supposed to be focusable">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/resources/testdriver.js"></script>
|
||||
<script src="/resources/testdriver-vendor.js"></script>
|
||||
</head>
|
||||
<h2>Steps:</h2>
|
||||
<ol>
|
||||
<li>Press 'Tab' key in 10 seconds.</li>
|
||||
</ol>
|
||||
<h2>Expect results:</h2>
|
||||
<p>PASS</p>
|
||||
<div id="log"></div>
|
||||
<form id="fm">
|
||||
<input id="test" tabindex="0">
|
||||
</form>
|
||||
<script>
|
||||
|
||||
//This test can be automated once we have an uniform way to use webdriver.
|
||||
var t = async_test("The element with a zero tabindex must be focused by press 'Tab' key");
|
||||
|
||||
setup({timeout: 10000});
|
||||
|
@ -42,4 +37,9 @@ document.addEventListener("keydown", function (evt) {
|
|||
});
|
||||
}, true);
|
||||
|
||||
t.step(function () {
|
||||
// TAB = '\ue004'
|
||||
test_driver.send_keys(document.body, "\ue004");
|
||||
});
|
||||
|
||||
</script>
|
|
@ -0,0 +1,44 @@
|
|||
<!DOCTYPE html>
|
||||
<script src = "/resources/testharness.js"></script>
|
||||
<script src = "/resources/testharnessreport.js"></script>
|
||||
|
||||
<link id="light-link" rel="stylesheet" href="resources/link-rel-attribute.css">
|
||||
<div id="light-div" class="green">I"m green when light DOM link is on</div>
|
||||
|
||||
<div id="host">
|
||||
I"m green when Shadow DOM link is on
|
||||
<template id="shadow-dom">
|
||||
<link id="shadow-link" rel="stylesheet" href="resources/link-rel-attribute.css">
|
||||
<div id="shadow-div" class="green">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var host = document.querySelector("#host");
|
||||
var shadow = host.attachShadow({ mode: "open" });
|
||||
var tmpl = document.querySelector("template#shadow-dom");
|
||||
var clone = document.importNode(tmpl.content, true);
|
||||
shadow.appendChild(clone);
|
||||
|
||||
function testLinkRelModification(testDiv, testLink) {
|
||||
assert_equals(getComputedStyle(testDiv).color, "rgb(0, 128, 0)");
|
||||
testLink.setAttribute("rel", "no-stylesheet");
|
||||
assert_equals(getComputedStyle(testDiv).color, "rgb(0, 0, 0)");
|
||||
testLink.setAttribute("rel", "stylesheet");
|
||||
assert_equals(getComputedStyle(testDiv).color, "rgb(0, 128, 0)");
|
||||
testLink.removeAttribute("rel");
|
||||
assert_equals(getComputedStyle(testDiv).color, "rgb(0, 0, 0)");
|
||||
}
|
||||
|
||||
test (() => {
|
||||
testLinkRelModification(document.querySelector("#light-div"),
|
||||
document.querySelector("#light-link"));
|
||||
}, "Removing stylesheet from link rel attribute should remove the stylesheet for light DOM");
|
||||
|
||||
test (() => {
|
||||
testLinkRelModification(shadow.querySelector("#shadow-div"),
|
||||
shadow.querySelector("#shadow-link"));
|
||||
}, "Removing stylesheet from link rel attribute should remove the stylesheet for shadow DOM");
|
||||
</script>
|
|
@ -7,6 +7,10 @@
|
|||
* avoids issues around caching of sheets based on URL.
|
||||
*/
|
||||
|
||||
// Our URLs are random, so we don't use them in error messages by
|
||||
// default, but enable doing it if someone wants to debug things.
|
||||
const DEBUG_URLS = false;
|
||||
|
||||
var isHttps = location.protocol == "https:";
|
||||
|
||||
var tests = [
|
||||
|
@ -113,12 +117,13 @@ for (var test of tests) {
|
|||
var t = async_test(description);
|
||||
var link = document.createElement("link");
|
||||
link.rel = "stylesheet";
|
||||
hrefString = DEBUG_URLS ? `: ${href}` : "";
|
||||
if (success) {
|
||||
link.onload = t.step_func_done(() => {});
|
||||
link.onerror = t.step_func_done(() => assert_unreached(`error fired when load expected: ${href}`) );
|
||||
link.onerror = t.step_func_done(() => assert_unreached(`error fired when load expected${hrefString}`) );
|
||||
} else {
|
||||
link.onerror = t.step_func_done(() => {});
|
||||
link.onload = t.step_func_done(() => assert_unreached(`load fired when error expected: ${href}`) );
|
||||
link.onload = t.step_func_done(() => assert_unreached(`load fired when error expected${hrefString}`) );
|
||||
}
|
||||
link.href = href;
|
||||
document.head.appendChild(link);
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
.green {
|
||||
color: green;
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset=utf-8>
|
||||
<title>Test that getSVGDocument() returns null for a cross-origin document.</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<body>
|
||||
<embed src='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><rect height="100" width="100"/></svg>'></embed>
|
||||
<script>
|
||||
const embed = document.querySelector('embed');
|
||||
var t = async_test('HTMLEmbedElement.getSVGDocument() for cross-origin document');
|
||||
window.addEventListener(
|
||||
'load', t.step_func_done(() => { assert_equals(embed.getSVGDocument(), null); }));
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,13 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset=utf-8>
|
||||
<title>Test that contentDocument returns null for a cross-origin document.</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
var t = async_test('HTMLFrameElement.contentDocument for cross-origin document');
|
||||
window.addEventListener(
|
||||
'load', t.step_func_done(() => { assert_equals(document.querySelector('frame').contentDocument, null); }));
|
||||
</script>
|
||||
<frameset>
|
||||
<frame src='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><rect height="100" width="100"/></svg>'></frame>
|
||||
</frameset>
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset=utf-8>
|
||||
<title>Test that contentDocument/getSVGDocument() return null for a cross-origin document.</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<body>
|
||||
<iframe src='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><rect height="100" width="100"/></svg>'></iframe>
|
||||
<script>
|
||||
const iframe = document.querySelector('iframe');
|
||||
var t1 = async_test('HTMLIFrameElement.contentDocument for cross-origin document');
|
||||
window.addEventListener(
|
||||
'load', t1.step_func_done(() => { assert_equals(iframe.contentDocument, null); }));
|
||||
var t2 = async_test('HTMLIFrameElement.getSVGDocument() for cross-origin document');
|
||||
window.addEventListener(
|
||||
'load', t2.step_func_done(() => { assert_equals(iframe.getSVGDocument(), null); }));
|
||||
</script>
|
||||
</body>
|
|
@ -14,7 +14,7 @@ setup({explicit_done:true});
|
|||
function check(p, iframe) {
|
||||
var current = p.firstElementChild;
|
||||
var ref_sizes = current.getAttribute('sizes');
|
||||
var expect = p.firstElementChild.currentSrc;
|
||||
var expect = current.currentSrc;
|
||||
if (expect) {
|
||||
expect = expect.split('?')[0];
|
||||
}
|
||||
|
|
|
@ -52,8 +52,14 @@
|
|||
<img srcset='/images/green-1x1.png?e34 50w, /images/green-16x16.png?e34 51w' sizes='\[,1px'>
|
||||
<img srcset='/images/green-1x1.png?e35 50w, /images/green-16x16.png?e35 51w' sizes='1\p\x'>
|
||||
<img srcset='/images/green-1x1.png?e36 50w, /images/green-16x16.png?e36 51w' sizes='calc(1px)'>
|
||||
<img srcset='/images/green-1x1.png?e36a 50w, /images/green-16x16.png?e36a 51w' sizes='min(1px, 100px)'>
|
||||
<img srcset='/images/green-1x1.png?e36b 50w, /images/green-16x16.png?e36b 51w' sizes='min(-100px, 1px)'>
|
||||
<img srcset='/images/green-1x1.png?e37 50w, /images/green-16x16.png?e37 51w' sizes='(min-width:0) calc(1px)'>
|
||||
<img srcset='/images/green-1x1.png?e37a 50w, /images/green-16x16.png?e37a 51w' sizes='(min-width:0) min(1px, 100px)'>
|
||||
<img srcset='/images/green-1x1.png?e37b 50w, /images/green-16x16.png?e37b 51w' sizes='(min-width:0) max(-100px, 1px)'>
|
||||
<img srcset='/images/green-1x1.png?e38 50w, /images/green-16x16.png?e38 51w' sizes='(min-width:calc(0)) 1px'>
|
||||
<img srcset='/images/green-1x1.png?e38a 50w, /images/green-16x16.png?e38a 51w' sizes='(min-width:min(0, 200vw)) 1px'>
|
||||
<img srcset='/images/green-1x1.png?e38b 50w, /images/green-16x16.png?e38b 51w' sizes='(min-width:max(-200vw, 0)) 1px'>
|
||||
<img srcset='/images/green-1x1.png?e39 50w, /images/green-16x16.png?e39 51w' sizes='(min-width:0) 1px, 100vw'>
|
||||
<img srcset='/images/green-1x1.png?e40 50w, /images/green-16x16.png?e40 51w' sizes='(min-width:0) 1px, (min-width:0) 100vw, 100vw'>
|
||||
<img srcset='/images/green-1x1.png?e41 50w, /images/green-16x16.png?e41 51w' sizes='(min-width:0) 1px'>
|
||||
|
@ -126,7 +132,11 @@
|
|||
<img srcset='/images/green-1x1.png?e108 50w, /images/green-16x16.png?e108 51w' sizes='(max-width:0) or (unknown-general-enclosed !) 100vw, 1px'>
|
||||
<img srcset='/images/green-1x1.png?e109 50w, /images/green-16x16.png?e109 51w' sizes='not ((max-width:0) or (unknown "general-enclosed")) 100vw, 1px'>
|
||||
<img srcset='/images/green-1x1.png?f48 50w, /images/green-16x16.png?f48 51w' sizes='calc(1px'>
|
||||
<img srcset='/images/green-1x1.png?f48a 50w, /images/green-16x16.png?f48a 51w' sizes='min(1px, 200vw'>
|
||||
<img srcset='/images/green-1x1.png?f48b 50w, /images/green-16x16.png?f48b 51w' sizes='max(-200vw, 1px'>
|
||||
<img srcset='/images/green-1x1.png?f49 50w, /images/green-16x16.png?f49 51w' sizes='(min-width:0) calc(1px'>
|
||||
<img srcset='/images/green-1x1.png?f49a 50w, /images/green-16x16.png?f49a 51w' sizes='(min-width:0) min(1px, 200vw'>
|
||||
<img srcset='/images/green-1x1.png?f49b 50w, /images/green-16x16.png?f49b 51w' sizes='(min-width:0) max(-200vw, 1px'>
|
||||
|
||||
<p>
|
||||
<img srcset='/images/green-1x1.png?f1 50w, /images/green-16x16.png?f1 51w' sizes='100vw'>
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset=utf-8>
|
||||
<title>Test that contentDocument/getSVGDocument() return null for a cross-origin document.</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<body>
|
||||
<object data='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><rect height="100" width="100"/></svg>'></object>
|
||||
<script>
|
||||
const object = document.querySelector('object');
|
||||
var t1 = async_test('HTMLObjectElement.contentDocument for cross-origin document');
|
||||
window.addEventListener(
|
||||
'load', t1.step_func_done(() => { assert_equals(object.contentDocument, null); }));
|
||||
var t2 = async_test('HTMLObjectElement.getSVGDocument() for cross-origin document');
|
||||
window.addEventListener(
|
||||
'load', t2.step_func_done(() => { assert_equals(object.getSVGDocument(), null); }));
|
||||
</script>
|
||||
</body>
|
|
@ -65,6 +65,7 @@ function test_rellist(tag_name, rel_table) {
|
|||
let supported = rel_table['supported'];
|
||||
for (let link_type in supported) {
|
||||
assert_true(element.relList.supports(supported[link_type]), 'tag = ' + tag + ', link type = ' + supported[link_type] + ' must be supported');
|
||||
assert_true(element.relList.supports(supported[link_type].toUpperCase()), 'tag = ' + tag + ', link type = ' + supported[link_type].toUpperCase() + ' must be supported');
|
||||
}
|
||||
let unsupported = rel_table['unsupported'];
|
||||
for (let link_type in unsupported) {
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
|
||||
<meta http-equiv="Content-Security-Policy" content="require-sri-for script">
|
||||
|
||||
<script src="/resources/testharness.js" integrity="sha384-4Nybydhnr3tOpv1yrTkDxu3RFpnxWAxlU5kGn7c8ebKvh1iUdfVMjqP6jf0dacrV"></script>
|
||||
<script src="/resources/testharnessreport.js" integrity="sha384-GOnHxuyo+nnsFAe4enY+RAl4/+w5NPMJPCQiDroTjxtR7ndRz7Uan8vNbM2qWKmU"></script>
|
||||
<script src="/resources/testharness.js" integrity="sha384-{{file_hash(sha384, resources/testharness.js)}}"></script>
|
||||
<script src="/resources/testharnessreport.js" integrity="sha384-{{file_hash(sha384, resources/testharnessreport.js)}}"></script>
|
||||
|
||||
<div id="dummy"></div>
|
||||
|
|
@ -4,8 +4,8 @@
|
|||
<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
|
||||
<meta http-equiv="Content-Security-Policy" content="require-sri-for script">
|
||||
|
||||
<script src="/resources/testharness.js" integrity="sha384-4Nybydhnr3tOpv1yrTkDxu3RFpnxWAxlU5kGn7c8ebKvh1iUdfVMjqP6jf0dacrV"></script>
|
||||
<script src="/resources/testharnessreport.js" integrity="sha384-GOnHxuyo+nnsFAe4enY+RAl4/+w5NPMJPCQiDroTjxtR7ndRz7Uan8vNbM2qWKmU"></script>
|
||||
<script src="/resources/testharness.js" integrity="sha384-{{file_hash(sha384, resources/testharness.js)}}"></script>
|
||||
<script src="/resources/testharnessreport.js" integrity="sha384-{{file_hash(sha384, resources/testharnessreport.js)}}"></script>
|
||||
|
||||
<div id="dummy"></div>
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>import() inside compiled strings inside a classic script</title>
|
||||
<link rel="help" href="https://github.com/whatwg/html/pull/3163">
|
||||
<link rel="help" href="https://github.com/tc39/ecma262/issues/871#issuecomment-292493142">
|
||||
<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me">
|
||||
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
|
||||
<script>
|
||||
"use strict";
|
||||
|
||||
self.ran = false;
|
||||
|
||||
promise_test(t => {
|
||||
t.add_cleanup(() => {
|
||||
self.ran = false;
|
||||
})
|
||||
|
||||
return Promise.resolve(`import("../imports-a.js?1").then(() => { self.ran = true; })`)
|
||||
.then(eval)
|
||||
.then(() => {
|
||||
assert_true(self.ran);
|
||||
});
|
||||
}, "Evaled the script via eval, successful import");
|
||||
|
||||
promise_test(t => {
|
||||
t.add_cleanup(() => {
|
||||
self.ran = false;
|
||||
})
|
||||
|
||||
return Promise.resolve(`import("bad-specifier?1").catch(() => { self.ran = true; })`)
|
||||
.then(eval)
|
||||
.then(() => {
|
||||
assert_true(self.ran);
|
||||
});
|
||||
}, "Evaled the script via eval, failed import");
|
||||
|
||||
promise_test(t => {
|
||||
t.add_cleanup(() => {
|
||||
self.ran = false;
|
||||
})
|
||||
|
||||
return Promise.resolve(`return import("../imports-a.js?2").then(() => { self.ran = true; })`)
|
||||
.then(Function)
|
||||
.then(Function.prototype.call.bind(Function.prototype.call))
|
||||
.then(() => {
|
||||
assert_true(self.ran);
|
||||
});
|
||||
}, "Evaled the script via Function, successful import");
|
||||
|
||||
promise_test(t => {
|
||||
t.add_cleanup(() => {
|
||||
self.ran = false;
|
||||
})
|
||||
|
||||
return Promise.resolve(`return import("bad-specifier?2").catch(() => { self.ran = true; })`)
|
||||
.then(Function)
|
||||
.then(Function.prototype.call.bind(Function.prototype.call))
|
||||
.then(() => {
|
||||
assert_true(self.ran);
|
||||
});
|
||||
}, "Evaled the script via Function, failed import");
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue