1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:27:43 +00:00

LibWeb: Support CSS floats in inline flow

CSS floats are now emitted by the InlineLevelIterator. When this
happens, IFC coordinates with the parent BFC to float the box to the
side, using the current LineBuilder state for vertical placement.

This makes the "instructions" text on Acid3 render as a single
contiguous flow of inline content.
This commit is contained in:
Andreas Kling 2022-03-22 19:18:05 +01:00
parent fa64a7f6cc
commit de6f7f0029
7 changed files with 57 additions and 9 deletions

View file

@ -13,6 +13,8 @@
namespace Web::Layout {
class LineBuilder;
// https://www.w3.org/TR/css-display/#block-formatting-context
class BlockFormattingContext : public FormattingContext {
public:
@ -42,6 +44,8 @@ public:
virtual float greatest_child_width(Box const&) override;
void layout_floating_box(Box const& child, BlockContainer const& containing_block, LayoutMode, LineBuilder* = nullptr);
private:
virtual bool is_block_formatting_context() const final { return true; }
@ -58,8 +62,6 @@ private:
void place_block_level_element_in_normal_flow_horizontally(Box const& child_box, BlockContainer const&);
void place_block_level_element_in_normal_flow_vertically(Box const& child_box, BlockContainer const&);
void layout_floating_box(Box const& child, BlockContainer const& containing_block, LayoutMode);
void layout_list_item_marker(ListItemBox const&);
enum class FloatSide {