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

@ -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>