1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-24 00:05:07 +00:00
serenity/Tests/LibWeb/Layout/input/block-and-inline/float-left-and-right-with-text-in-between.html
Andreas Kling bab6796099 LibWeb: Rewrite calculation of available space between floats
This code now works in terms of *intrusion* by left and right side
floats into a given box whose insides we're trying to layout.

Previously, it worked in terms of space occupied by floats in the root
box of the BFC they participated in. That created a bunch of edge cases
since the code asking about the information wasn't operating in root
coordinate space, but in the coordinate space of some arbitrarily nested
block descendant of the root.

This finally allows horizontal margins in the containing block chain to
affect floats and nested content correctly, and it also allows us to
remove a bogus workaround in InlineFormattingContext.
2023-05-16 14:35:10 +02:00

24 lines
695 B
HTML

<style>
* {
font: 20px SerenitySans;
border: 1px solid black;
}
body {
margin-left: 250px;
}
.left {
float: left;
background: pink;
width: 300px;
height: 200px;
}
.right {
float: right;
background: wheat;
width: 300px;
height: 200px;
}
</style>
<div class=left></div>
<div class=right></div>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse a placerat mauris, ut elementum mi. Morbi ut vehicula ipsum, eget placerat augue. Integer rutrum nisi eget dui dictum, eu accumsan enim tristique. Ut lobortis lorem eget est vulputate egestas. Integer laoreet lacinia ante sodales lobortis. Donec a tincidunt ante. Phasellus a arcu tortor.