Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Image fallback respect max-width</title>
<style>
div {
max-width: 200px;
}
img {
width: 200px;
height: auto;
}
</style>
<body>
<div>
<img src="" width="10000" height="100">
<img src="" width="10000" height="100"
alt="Lorem ipsum dolor sit amet, consectetur adipisicing elit.">
<img src="" width="1000" height="100">
</div>
</body>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Image fallback respect max-width</title>
<link rel="author" href="mailto:[email protected]">
<link rel="help" href="https://html.spec.whatwg.org/multipage/rendering.html#images-3">
<link rel="match" href="image-fallback-respect-max-width-ref.html">
<style>
div {
max-width: 200px;
}
img {
max-width: 100%;
height: auto;
}
</style>
<body>
<div>
<img src="" width="10000" height="100">
<img src="" width="10000" height="100"
alt="Lorem ipsum dolor sit amet, consectetur adipisicing elit.">
<img src="" width="1000" height="100">
</div>
</body>
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Image fallback baseline alignment</title>
<link rel="author" href="mailto:[email protected]">
<link rel="help" href="https://html.spec.whatwg.org/multipage/rendering.html#images-3">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
div {
background: red;
line-height: 200px;
width: 100px;
}
img {
border-right: solid 30px black;
width: 30px;
height: 30px;
}
</style>
<body>
<div>
<img src="">
</div>
<script>
async_test(t => {
const img = document.querySelector('img');
const div = document.querySelector('div');
img.src = '';
img.onerror = t.step_func_done(() => {
assert_greater_than(img.offsetTop, div.offsetTop);
assert_less_than(img.offsetTop + img.offsetHeight, div.offsetTop + div.offsetHeight);
});
});
</script>
</body>