diff options
author | Rodrigo Arias Mallo <rodarima@gmail.com> | 2025-08-31 13:50:05 +0200 |
---|---|---|
committer | Rodrigo Arias Mallo <rodarima@gmail.com> | 2025-08-31 14:09:10 +0200 |
commit | 1d55cf26a355b89a007e4a9bf7361d8a5c2c64cd (patch) | |
tree | c1851d29b96d05d435a31ca8af108eb21a87b350 /test/html/render | |
parent | 47ab7c704f415454fb3c908f9fe0bdebb3239ef3 (diff) |
Fix hr width exceeding available space
The hr ruler was directly using the available content width to compute
its allocation. However, the width needs to take into account the border
of the hr element (1 pixel on each side) to avoid making the element
larger than the available space.
Co-authored-by: dogma
Diffstat (limited to 'test/html/render')
-rw-r--r-- | test/html/render/hr.html | 10 | ||||
-rw-r--r-- | test/html/render/hr.ref.html | 24 |
2 files changed, 34 insertions, 0 deletions
diff --git a/test/html/render/hr.html b/test/html/render/hr.html new file mode 100644 index 00000000..e76dde7a --- /dev/null +++ b/test/html/render/hr.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html> + <head> + <title>Test hr length</title> + </head> + <body> + <hr> + <hr style="border-width: 10px"> + </body> +</html> diff --git a/test/html/render/hr.ref.html b/test/html/render/hr.ref.html new file mode 100644 index 00000000..21064d9f --- /dev/null +++ b/test/html/render/hr.ref.html @@ -0,0 +1,24 @@ +<!DOCTYPE html> +<html> + <head> + <title>Test hr length</title> + </head> +<style> +div { + border: 1px inset; + margin-top: 5px; + margin-bottom: 5px; +} +</style> + <body> + <!-- + Default canvas width is 780, with 5 pixels of margin for body on each + side, so we have 770 pixels of space available before the scrollbar is + shown. The ruler needs one pixel on each side by default, so 768 px is the + available width. + --> + <div style="width: 768px"></div> + <!-- Same but with 20 pixels for the ruler border --> + <div style="width: 750px; border-width: 10px"></div> + </body> +</html> |