mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Update web-platform-tests to revision 6838f7e5fbddf9c77a93b0e8cd2e27c0fcfed86f
This commit is contained in:
parent
37023b24f2
commit
17d194dd89
108 changed files with 2614 additions and 114 deletions
|
@ -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>
|
Loading…
Add table
Add a link
Reference in a new issue