mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 06:57:46 +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
|
@ -40,6 +40,7 @@ public:
|
|||
void add_absolutely_positioned_box(Box const& box) { m_absolutely_positioned_boxes.append(box); }
|
||||
|
||||
SpaceUsedByFloats space_used_by_floats(CSSPixels y) const;
|
||||
SpaceUsedByFloats intrusion_by_floats_into_box(Box const&, CSSPixels y_in_box) const;
|
||||
|
||||
virtual CSSPixels greatest_child_width(Box const&) const override;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue