Update web-platform-tests to revision 155daf0c385420faf208b8bd5e319e244ec7f9cc

This commit is contained in:
WPT Sync Bot 2018-05-27 21:17:21 -04:00 committed by Josh Matthews
parent 4e6b100c7e
commit e9bdf87a27
768 changed files with 5782 additions and 26218 deletions

View file

@ -11,17 +11,17 @@
<script>
var host_info = get_host_info();
var HTTP_PORT = host_info.HTTP_PORT;
var ORIGINAL_HOST = host_info.ORIGINAL_HOST; // e.g. "web-platform.test"
var ORIGINAL_HOST = host_info.ORIGINAL_HOST;
var SUFFIX_HOST = ORIGINAL_HOST.substring(ORIGINAL_HOST.lastIndexOf('.') + 1); // e.g. "test"
var PREFIX_HOST = "www1." + ORIGINAL_HOST; // e.g. "www1.web-platform.test"
var REMOTE_HOST = host_info.REMOTE_HOST;
var iframe = document.getElementById("iframe");
var iframe_url = new URL("support/document_domain_setter_iframe.html", document.location);
iframe_url.hostname = PREFIX_HOST;
iframe_url.hostname = REMOTE_HOST;
iframe.src = iframe_url;
test(function() {
assert_throws("SecurityError", function() { document.domain = SUFFIX_HOST; });
assert_throws("SecurityError", function() { document.domain = "." + SUFFIX_HOST; });
assert_throws("SecurityError", function() { document.domain = PREFIX_HOST; });
assert_throws("SecurityError", function() { document.domain = REMOTE_HOST; });
assert_throws("SecurityError", function() { document.domain = "example.com"; });
}, "failed setting of document.domain");
async_test(function(t) {

View file

@ -1,66 +1,66 @@
<!DOCTYPE html>
<meta charset="utf-8"/>
<title>HTML Test: window.frameElement</title>
<link rel="author" title="Intel" href="http://www.intel.com/" />
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
<html>
<head>
<meta charset="utf-8"/>
<title>HTML Test: window.frameElement</title>
<link rel="author" title="Intel" href="http://www.intel.com/" />
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<!-- t1 (same-origin)-->
<iframe id="iframe_0"></iframe>
<iframe id="iframe_1" src="./resources/frameElement-nested-frame.html"></iframe>
<object id="object_id" name="object_name" type="text/html" data="about:blank"></object>
<embed id="embed_id" name="embed_name" type="image/svg+xml" src="/images/green.svg" />
var t1 = async_test("The window's frameElement attribute must return its container element if it is a nested browsing context");
var t2 = async_test("The SecurityError must be thrown if the window accesses to frameElement attribute of a Window which does not have the same effective script origin");
var t3 = async_test("The window's frameElement attribute must return null if the container's document does not have the same effective script origin");
<!-- t2 (cross-origin) -->
<iframe name="iframe_2" src="http://{{hosts[alt][]}}:{{ports[http][0]}}/html/browsers/windows/nested-browsing-contexts/resources/frameElement-nested-frame.html"></iframe>
function on_load() {
t1.step(function () {
assert_equals(frames[0].frameElement, document.getElementById("fr1"),
"The frameElement attribute should be the first iframe element.");
assert_equals(window["win2"].frameElement, document.getElementById("obj"),
"The frameElement attribute should be the object element.");
assert_equals(window["win3"].frameElement, document.getElementById("emb"),
"The frameElement attribute should be the embed element.");
assert_equals(document.getElementById("fr4").contentWindow[0].frameElement,
document.getElementById("fr4").contentDocument.getElementById("f1"),
"The frameElement attribute should be the frame element in 'resources/frameElement-nested-frame.html'.");
});
t1.done();
<!-- t3 (cross-origin) -->
<iframe id="iframe_3" src="http://{{hosts[alt][]}}:{{ports[http][0]}}/html/browsers/windows/nested-browsing-contexts/resources/frameElement-window-post.html"></iframe>
t2.step(function () {
assert_throws("SecurityError", function () { frames[1].frameElement; },
"The SecurityError exception should be thrown.");
});
t2.done();
<script>
test(function() {
assert_equals(window.frameElement, null,
"The frameElement attribute should be null.");
}, "The window's frameElement attribute must return null if it is not a nested browsing context");
t3.step(function () {
document.getElementById("fr5").contentWindow.postMessage(null, "*");
});
window.addEventListener("message", function (event) {
var data = JSON.parse(event.data);
if (data.name == "testcase3") {
t3.step(function () {
assert_equals(data.result, "window.frameElement = null",
"The frameElement attribute should be null.");
});
t3.done();
}
}, false);
}
var t1 = async_test("The window's frameElement attribute must return its container element if it is a nested browsing context");
window.addEventListener("load", t1.step_func_done(function() {
assert_equals(frames[0].frameElement, document.getElementById("iframe_0"),
"The frameElement attribute should be the first iframe element.");
assert_equals(window["object_name"].frameElement, document.getElementById("object_id"),
"The frameElement attribute should be the object element.");
assert_equals(window["embed_name"].frameElement, document.getElementById("embed_id"),
"The frameElement attribute should be the embed element.");
assert_equals(document.getElementById("iframe_1").contentWindow[0].frameElement,
document.getElementById("iframe_1").contentDocument.getElementById("f1"),
"The frameElement attribute should be the frame element in 'resources/frameElement-nested-frame.html'.");
}));
</script>
<body onload="on_load()">
<div id="log"></div>
<iframe id="fr1"></iframe>
<iframe id="fr2" src="http://{{hosts[alt][]}}:{{ports[http][0]}}/html/browsers/windows/nested-browsing-contexts/resources/frameElement-nested-frame.html"></iframe><!--cross origin -->
<iframe id="fr3" src="" style="display:none"></iframe>
<object id="obj" name="win2" type="text/html" data="about:blank"></object>
<embed id="emb" name="win3" type="image/svg+xml" src="/images/green.svg" />
<iframe id="fr4" src="resources/frameElement-nested-frame.html"></iframe> <!-- same origin -->
<iframe id="fr5" src="http://{{hosts[alt][]}}:{{ports[http][0]}}/html/browsers/windows/nested-browsing-contexts/resources/frameElement-window-post.html"></iframe> <!-- cross origin -->
<script>
var t2 = async_test("The SecurityError must be thrown if the window accesses to frameElement attribute of a Window which does not have the same effective script origin");
window.addEventListener("load", t2.step_func_done(function() {
assert_throws("SecurityError", function() {
frames["iframe_2"].frameElement;
},
"The SecurityError exception should be thrown.");
}));
test(function () {
assert_equals(window.frameElement, null,
"The frameElement attribute should be null.");
}, "The window's frameElement attribute must return null if it is not a nested browsing context");
</script>
</body>
var t3 = async_test("The window's frameElement attribute must return null if the container's document does not have the same effective script origin");
window.addEventListener("load", function() {
window.addEventListener("message", function(event) {
var data = JSON.parse(event.data);
if (data.name == "testcase3") {
t3.step(function() {
assert_equals(data.result, "window.frameElement = null",
"The frameElement attribute should be null.");
t3.done();
});
}
}, false);
document.getElementById("iframe_3").contentWindow.postMessage(null, "*");
})
</script>
</body>
</html>

View file

@ -0,0 +1,12 @@
<!doctype html>
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
<link rel="help" title="https://github.com/whatwg/html/pull/3686">
<link rel="help" title="https://html.spec.whatwg.org/multipage/#the-details-element">
<link rel="mismatch" href="single-summary.html">
<title>CSS Test: details ::after pseudo-element</title>
<style>
details::after { content: "::after" }
</style>
<details>
<summary>This is the main summary</summary>
</details>

View file

@ -0,0 +1,12 @@
<!doctype html>
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
<link rel="help" title="https://github.com/whatwg/html/pull/3686">
<link rel="help" title="https://html.spec.whatwg.org/multipage/#the-details-element">
<link rel="mismatch" href="single-summary.html">
<title>CSS Test: details ::before pseudo-element</title>
<style>
details::before { content: "::before" }
</style>
<details>
<summary>This is the main summary</summary>
</details>

View file

@ -0,0 +1,6 @@
<!doctype html>
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
<title>CSS Test Reference</title>
<details>
<summary>This is the main summary</summary>
</details>

View file

@ -0,0 +1,3 @@
<!doctype html>
<title> An empty test page </title>
<p> This is test page </p>

View file

@ -0,0 +1,82 @@
<!doctype html>
<html>
<head>
<title>
&lt;embed&gt;'s browsing context is discarded on 'src' attribute change.
</title>
<link rel="author" title="Ehsan Karamad" href="ekaramad@chromium.org">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
let url1 = "../resources/test_page.html";
let url2 = "../resources/should-load.html";
function onLoadPromise(el) {
return new Promise((resolve) => {
function onLoad() {
resolve();
el.removeEventListener("load", onLoad);
}
el.addEventListener("load", onLoad);
});
}
promise_test(async() => {
let old_windows = [];
let embed = document.createElement("embed");
embed.type = "text/html";
embed.src = url1;
let onEmbedLoad = onLoadPromise(embed);
document.body.appendChild(embed);
await onEmbedLoad;
old_windows.push(window[0]);
assert_equals(
window[0].frameElement,
embed,
"<embed> is attached and loaded with html content.");
let iframe = document.createElement("iframe");
iframe.src = url1;
let onIframeLoad = onLoadPromise(iframe);
document.body.appendChild(iframe);
await onIframeLoad;
old_windows.push(window[1]);
assert_equals(
window[1].frameElement,
iframe,
"<iframe> is attached and loaded with html content after <embed>.");
assert_equals(
window[0],
old_windows[0],
"The first window is that of <embed>'s frame.");
// Now navigate the embed element again.
onEmbedLoad = onLoadPromise(embed);
embed.src = url2;
await onEmbedLoad;
assert_equals(
window[0].frameElement,
iframe,
"<embed>'s previous frame must have been destroyed.");
assert_equals(
window[1].frameElement,
embed,
"<embed>'s new window should be appended after navigation.");
assert_not_equals(
old_windows[0],
window[1],
"The old window and new window are different for <embed>.");
assert_equals(
old_windows[1],
window[0],
"The old and new window are the same for <iframe>.");
}, "Verify that changing 'src' attribute of an <embed> element discards" +
" the old browsing context and creates a new browsing context.");
</script>
</body>
</html>

View file

@ -5,7 +5,7 @@
<script src="/resources/testharnessreport.js"></script>
<script src="iframe_harness.js"></script>
<body>
<iframe src="http://www1.web-platform.test:8000/html/semantics/embedded-content/the-iframe-element/cross_origin_child.html"></iframe>
<iframe src="http://{{domains[www1]}}:{{ports[http][0]}}/html/semantics/embedded-content/the-iframe-element/cross_origin_child.html"></iframe>
</body>
<script>
get_test_results('bffa23ee-b45a-4e9a-9405-87ab437d5cfa');

View file

@ -0,0 +1,4 @@
<!doctype html>
<title>Test reference</title>
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
<iframe width="500" height="500" srcdoc='<!doctype html><img alt="FAIL" srcset="/images/green-256x256.png 100w" style="max-width: 100%" sizes="10px">'></iframe>

View file

@ -0,0 +1,20 @@
<!doctype html>
<html class="reftest-wait">
<title>Image intrinsic size specified via sizes attribute reacts properly to media changes</title>
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
<link rel="match" href="sizes-dynamic-001-ref.html">
<link rel="help" href="https://html.spec.whatwg.org/#sizes-attributes">
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1149357">
<script>
function frameLoaded(frame) {
frame.width = "500";
let img = frame.contentDocument.querySelector('img');
// Trigger the viewport resize, which will trigger the image load task.
img.offsetWidth;
// Wait for the image load task to run.
setTimeout(() => document.documentElement.removeAttribute("class"), 0);
}
</script>
<iframe onload="frameLoaded(this)" width="200" height="500" srcdoc='<!doctype html><img srcset="/images/green-256x256.png 100w" style="max-width: 100%" sizes="(min-width: 400px) 10px, 20px">'></iframe>

View file

@ -0,0 +1,83 @@
<!doctype html>
<html>
<head>
<title>
&lt;object&gt;'s browsing context is discarded on 'data' attribute change.
</title>
<link rel="author" title="Ehsan Karamad" href="ekaramad@chromium.org">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
let url1 = "../resources/test_page.html";
let url2 = "../resources/should-load.html";
function onLoadPromise(el) {
return new Promise((resolve) => {
function onLoad() {
resolve();
el.removeEventListener("load", onLoad);
}
el.addEventListener("load", onLoad);
});
}
promise_test(async() => {
let old_windows = [];
let object = document.createElement("object");
object.type = "text/html";
object.data = url1;
let onObjectLoad = onLoadPromise(object);
document.body.appendChild(object);
await onObjectLoad;
old_windows.push(window[0]);
assert_equals(
window[0].frameElement,
object,
"<object> is attached and loaded with html content.");
let iframe = document.createElement("iframe");
iframe.src = url1;
let onIframeLoad = onLoadPromise(iframe);
document.body.appendChild(iframe);
await onIframeLoad;
old_windows.push(window[1]);
assert_equals(
window[1].frameElement,
iframe,
"<iframe> is attached and loaded with html content after <object>.");
assert_equals(
window[0],
old_windows[0],
"The first window is that of <object>'s frame.");
// Now navigate the object element again.
onObjectLoad = onLoadPromise(object);
object.data = url2;
await onObjectLoad;
assert_equals(
window[0].frameElement,
iframe,
"<object>'s previous frame must have been destroyed.");
assert_equals(
window[1].frameElement,
object,
"<object>'s new window should be appended after navigation.");
assert_not_equals(
old_windows[0],
window[1],
"The old window and new window are different for <object>.");
assert_equals(
old_windows[1],
window[0],
"The old and new window are the same for <iframe>.");
}, "Verify that changing 'data' attribute of an <object> element discards" +
" the old browsing context and creates a new browsing context.");
</script>
</body>
</html>

View file

@ -222,7 +222,7 @@
"The number of labels should be 2 after the labelable element is moved to iframe.");
});
iframe.setAttribute('src', 'http://web-platform.test:8000/html/semantics/forms/the-label-element/iframe-label-attributes.html');
iframe.setAttribute('src', 'http://{{domains[]}}:{{ports[http][0]}}/html/semantics/forms/the-label-element/iframe-label-attributes.html');
document.body.appendChild(iframe);
}, "A labelable element is moved to iframe.");