aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRodrigo Arias Mallo <rodarima@gmail.com>2024-08-16 18:30:04 +0200
committerRodrigo Arias Mallo <rodarima@gmail.com>2024-10-17 20:38:16 +0200
commitdf3ed4822cbbdb7c5553ad9f03ecdbd53654aa65 (patch)
treeb75f4404825a11a94a7bffb63999c3ca6c0fbfd2
parent15b878cef14c1a62783a59c6bd06097856f22807 (diff)
Add img-aspect-ratio-relative-inside-fixed test
-rw-r--r--test/html/Makefile.am7
-rw-r--r--test/html/render/img-aspect-ratio-relative-inside-fixed.html25
-rw-r--r--test/html/render/img-aspect-ratio-relative-inside-fixed.ref.html25
3 files changed, 54 insertions, 3 deletions
diff --git a/test/html/Makefile.am b/test/html/Makefile.am
index 013429f6..52ddf7f7 100644
--- a/test/html/Makefile.am
+++ b/test/html/Makefile.am
@@ -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 \
diff --git a/test/html/render/img-aspect-ratio-relative-inside-fixed.html b/test/html/render/img-aspect-ratio-relative-inside-fixed.html
new file mode 100644
index 00000000..51536eac
--- /dev/null
+++ b/test/html/render/img-aspect-ratio-relative-inside-fixed.html
@@ -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>
diff --git a/test/html/render/img-aspect-ratio-relative-inside-fixed.ref.html b/test/html/render/img-aspect-ratio-relative-inside-fixed.ref.html
new file mode 100644
index 00000000..e9a45ca7
--- /dev/null
+++ b/test/html/render/img-aspect-ratio-relative-inside-fixed.ref.html
@@ -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>