Update web-platform-tests to revision 6838f7e5fbddf9c77a93b0e8cd2e27c0fcfed86f

This commit is contained in:
WPT Sync Bot 2020-04-09 08:18:59 +00:00
parent 37023b24f2
commit 17d194dd89
108 changed files with 2614 additions and 114 deletions

View file

@ -0,0 +1,45 @@
<!DOCTYPE html>
<meta charset=utf-8>
<title>naturalWidth and naturalHeight on HTMLImageElement reflect orientation metadata</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
.ignore-orientation { image-orientation: none; }
</style>
<body>
<script>
async_test(function(t) {
let img = document.createElement("img");
img.src = "/images/green-100x50.png";
img.onload = t.step_func_done(function() {
assert_equals(img.naturalWidth, 100);
assert_equals(img.naturalHeight, 50);
img.remove();
});
document.body.append(img);
}, "naturalWidth and naturalHeight return correct values for an image without orientation metadata");
async_test(function(t) {
let img = document.createElement("img");
img.src = "/images/arrow-oriented-upright.jpg";
img.onload = t.step_func_done(function() {
assert_equals(img.naturalWidth, 144);
assert_equals(img.naturalHeight, 240);
img.remove();
});
document.body.append(img);
}, "naturalWidth and naturalHeight return re-oriented values for an image with orientation metadata");
async_test(function(t) {
let img = document.createElement("img");
img.src = "/images/arrow-oriented-upright.jpg";
img.className = "ignore-orientation";
img.onload = t.step_func_done(function() {
assert_equals(img.naturalWidth, 144);
assert_equals(img.naturalHeight, 240);
img.remove();
});
document.body.append(img);
}, "naturalWidth and naturalHeight return re-oriented values for an image with orientation metadata even with image-orientation:none");
</script>