mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 16:47:44 +00:00
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.
This commit is contained in:
parent
9bd4add734
commit
bab6796099
8 changed files with 159 additions and 40 deletions
|
@ -0,0 +1,24 @@
|
|||
<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.
|
Loading…
Add table
Add a link
Reference in a new issue