Update web-platform-tests to revision d55d764f159f5d8dd3e0b30e9d38f75af4feb438

This commit is contained in:
WPT Sync Bot 2019-12-21 08:23:02 +00:00
parent bb5cd02da3
commit 865f7c03e9
228 changed files with 6505 additions and 2813 deletions

View file

@ -0,0 +1,16 @@
<!doctype html>
<title>Adopt img from image document</title>
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-img-element">
<link rel="match" href="document-base-url-ref.html">
<!-- Counteract any style added by the image document -->
<style>img { width: initial; height: initial; }</style>
<iframe></iframe>
<script>
var iframe = document.querySelector('iframe');
iframe.onload = function() {
let img = iframe.contentDocument.body.firstChild;
document.body.appendChild(img);
iframe.remove();
};
iframe.src = 'resources/cat.jpg';
</script>

View file

@ -3,7 +3,7 @@
<meta name="timeout" content="long">
<title>HTMLImageElement.prototype.decode(), iframe tests.</title>
<link rel="author" title="Vladimir Levin" href="mailto:vmpstr@chromium.org">
<link rel=help href="https://html.spec.whatwg.org/multipage/embedded-content.html#dom-img-decode">
<link rel="help" href="https://html.spec.whatwg.org/multipage/embedded-content.html#dom-img-decode">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
@ -23,7 +23,7 @@ promise_test(function() {
// At this point the frame which created the img is removed, so decode() should fail.
frame.parentNode.removeChild(frame);
img.decode().then(function() {
assert_false(true, "Unexpected success");
assert_unreached("Unexpected success");
}, function() {
resolve();
});

View file

@ -0,0 +1,25 @@
<!DOCTYPE html>
<title>HTMLImageElement.prototype.decode(), image document tests.</title>
<link rel="help" href="https://html.spec.whatwg.org/multipage/embedded-content.html#dom-img-decode">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<iframe id="frame_imgdoc" src="about:blank"></iframe>
<script>
"use strict";
promise_test(function() {
return new Promise(function(resolve) {
var frame = document.getElementById("frame_imgdoc");
// Load an image in the iframe and then replace that.
frame.src = "/images/red.png";
frame.onload = function() {
let img = frame.contentDocument.body.firstElementChild;
img.src = "/images/green.png";
img.decode().then(function() {
resolve();
});
};
});
}, document.title + " Decode from iframe with image document, succeeds (img not loaded)");
</script>