summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorTobias Christiansen <tobyase@serenityos.org>2021-09-23 16:58:57 +0200
committerAndreas Kling <kling@serenityos.org>2021-09-23 17:48:11 +0200
commit0ccde5417b3bd786755b22e30a39b25575ea7bd6 (patch)
tree7b56d585830aeed524c2bd094b086d7c479470f3 /Userland/Libraries
parent4560a8b83fc9e8a87a1e6875613f176d5eebc227 (diff)
downloadserenity-0ccde5417b3bd786755b22e30a39b25575ea7bd6.zip
LibWeb: Don't assume the parent is BFC in the IFC
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibWeb/Layout/InlineFormattingContext.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/InlineFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/InlineFormattingContext.cpp
index 99669b26aa..850e18c347 100644
--- a/Userland/Libraries/LibWeb/Layout/InlineFormattingContext.cpp
+++ b/Userland/Libraries/LibWeb/Layout/InlineFormattingContext.cpp
@@ -31,6 +31,9 @@ struct AvailableSpaceForLineInfo {
static AvailableSpaceForLineInfo available_space_for_line(const InlineFormattingContext& context, size_t line_index)
{
+ if (!context.parent()->is_block_formatting_context())
+ return { 0, context.context_box().width() };
+
AvailableSpaceForLineInfo info;
// FIXME: This is a total hack guess since we don't actually know the final y position of lines here!