summaryrefslogtreecommitdiff
path: root/Libraries/LibWeb/Layout/TextNode.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-12-06 19:48:02 +0100
committerAndreas Kling <kling@serenityos.org>2020-12-06 20:05:04 +0100
commit59de4adb607b3196297dadf1a22d1e56c4e0083b (patch)
treed40e23a3b405e77a836e05ae4cf96443dc2fe996 /Libraries/LibWeb/Layout/TextNode.cpp
parentb638e74b6898359886a69c7004930a3036282c47 (diff)
downloadserenity-59de4adb607b3196297dadf1a22d1e56c4e0083b.zip
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().
Diffstat (limited to 'Libraries/LibWeb/Layout/TextNode.cpp')
-rw-r--r--Libraries/LibWeb/Layout/TextNode.cpp3
1 files changed, 2 insertions, 1 deletions
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();