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

LibWeb: Only set children-are-not-inline when inserting in-flow child

We were marking block boxes as having non-inline children when inserting
any child box, even if the child was out-of-flow.
Andreas Kling 3 лет назад
Родитель
Сommit
9b0d158e69
1 измененных файлов с 4 добавлено и 1 удалено
  1. 4 1
      Userland/Libraries/LibWeb/Layout/TreeBuilder.cpp

+ 4 - 1
Userland/Libraries/LibWeb/Layout/TreeBuilder.cpp

@@ -168,7 +168,10 @@ void TreeBuilder::create_layout_tree(DOM::Node& dom_node, TreeBuilder::Context&
                 insertion_point.prepend_child(*node);
             else
                 insertion_point.append_child(*node);
-            insertion_point.set_children_are_inline(false);
+
+            // After inserting an in-flow block-level box into a parent, mark the parent as having non-inline children.
+            if (!node->is_floating() && !node->is_absolutely_positioned())
+                insertion_point.set_children_are_inline(false);
         }
     };