Просмотр исходного кода

LibWeb: Don't assume the parent is BFC in the IFC

Tobias Christiansen 3 лет назад
Родитель
Сommit
0ccde5417b
1 измененных файлов с 3 добавлено и 0 удалено
  1. 3 0
      Userland/Libraries/LibWeb/Layout/InlineFormattingContext.cpp

+ 3 - 0
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!