From 59de4adb607b3196297dadf1a22d1e56c4e0083b Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 6 Dec 2020 19:48:02 +0100 Subject: LibWeb: Pass current target box to BFC::run() The BFC "context box" is now the outer box of the block formatting context. Previously the context box was always the current target box, which made it hard to reason about who was really the containing block of whom in various places. Note that IFC still has the containing block as its context box, this change only affects BFC. However, to clarify the situation in IFC, I've added a containing_block() getter than returns the context_box(). --- Libraries/LibWeb/Layout/TextNode.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Libraries/LibWeb/Layout/TextNode.cpp') diff --git a/Libraries/LibWeb/Layout/TextNode.cpp b/Libraries/LibWeb/Layout/TextNode.cpp index 5438054e9d..a4f59874a4 100644 --- a/Libraries/LibWeb/Layout/TextNode.cpp +++ b/Libraries/LibWeb/Layout/TextNode.cpp @@ -192,7 +192,8 @@ void TextNode::for_each_chunk(Callback callback, LayoutMode layout_mode, bool do void TextNode::split_into_lines_by_rules(InlineFormattingContext& context, LayoutMode layout_mode, bool do_collapse, bool do_wrap_lines, bool do_wrap_breaks) { - auto& containing_block = context.context_box(); + auto& containing_block = context.containing_block(); + auto& font = specified_style().font(); float space_width = font.glyph_width(' ') + font.glyph_spacing(); -- cgit v1.2.3