Skip to content

Commit

Permalink
Add img-aspect-ratio-relative-inside-fixed test
Browse files Browse the repository at this point in the history
  • Loading branch information
rodarima committed Oct 6, 2024
1 parent 2837c96 commit 47ae7bf
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/html/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@ TESTS = \
render/float-img-justify.html \
render/github-infinite-loop.html \
render/hackernews.html \
render/img-aspect-ratio.html \
render/img-aspect-ratio-div.html \
render/img-aspect-ratio-absolute.html \
render/img-aspect-ratio-div.html \
render/img-aspect-ratio-relative-inside-fixed.html \
render/img-aspect-ratio.html \
render/img-max-bounds.html \
render/main-style.html \
render/margin-auto.html \
render/max-width-body.html \
render/max-width-div.html \
render/max-width-div-clamp.html \
render/max-width-div.html \
render/max-width-html.html \
render/max-width-nested-div.html \
render/meta-refresh-0-no-url.html \
Expand Down
25 changes: 25 additions & 0 deletions test/html/render/img-aspect-ratio-relative-inside-fixed.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<title>Test image aspect ratio when both dimensions are relative and container is fixed</title>
<style>
div {
border: 1px solid black;
width: 64px;
height: 256px;
}
img {
width:100%;
height:100%;
}
</style>
</head>
<body>
<p>The image must fill the complete div even if that means distorting it.
The image specifies the size as 100% of the container in both dimensions and
the container has a fixed size.</p>
<div>
<img src="pic.png">
</div>
</body>
</html>
25 changes: 25 additions & 0 deletions test/html/render/img-aspect-ratio-relative-inside-fixed.ref.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<title>Test image aspect ratio when both dimensions are relative and container is fixed</title>
<style>
div {
border: 1px solid black;
width: 64px;
height: 256px;
}
img {
width:64px;
height:256px;
}
</style>
</head>
<body>
<p>The image must fill the complete div even if that means distorting it.
The image specifies the size as 100% of the container in both dimensions and
the container has a fixed size.</p>
<div>
<img src="pic.png">
</div>
</body>
</html>

0 comments on commit 47ae7bf

Please sign in to comment.