diff options
author | Andreas Kling <kling@serenityos.org> | 2022-09-22 14:07:28 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-09-22 16:54:12 +0200 |
commit | 389f47f6fe63e2defe4a7a91ae6fdf5a5ac5c5e7 (patch) | |
tree | 2a69b6dc7718430e1e087e504ffb5183e8ea74f9 /Base/res/html/misc | |
parent | 82e730eba10c7dbfad4a15056b26efa943920f71 (diff) | |
download | serenity-389f47f6fe63e2defe4a7a91ae6fdf5a5ac5c5e7.zip |
LibWeb: Check both top and bottom of float position when looking for fit
We have to check that there's enough space at both the top and bottom of
the float's margin box, otherwise we risk overlapping existing content.
Diffstat (limited to 'Base/res/html/misc')
-rw-r--r-- | Base/res/html/misc/float-stress-2.html | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/Base/res/html/misc/float-stress-2.html b/Base/res/html/misc/float-stress-2.html new file mode 100644 index 0000000000..4f4c5bea6d --- /dev/null +++ b/Base/res/html/misc/float-stress-2.html @@ -0,0 +1,42 @@ +<!DOCTYPE html> +<html class="js" lang="en-US"> + <head> + <style> + * { + border: 0px solid black !important; + } + + html, body { + margin: 0; + } + + #page { + background: cyan; + padding-left: 50px; + padding-top: 50px; + } + + #content_box { + float: left; + background: lime; + width: 400px; + height: 150px; + } + + .first { + background: pink; + + width: 300px; + height: 100px; + float: left; + } + + .second { + background: orange; + + width: 200px; + height: 50px; + float: left; + } + </style> + </head><body><div id="page"><div id="content_box"><article class="first">first</article><article class="second">second</article> </div></div></body></html> |