瀏覽代碼

LibWeb: Whine in debug log instead of asserting on partial layout FIXME

We don't support incremental relayout of subtrees (only single nodes)
but let's not crash the browser just because this happens. We can keep
the browser up and just complain in the debug log instead.
Andreas Kling 5 年之前
父節點
當前提交
5e9d1b2165
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      Libraries/LibWeb/Layout/LayoutTreeBuilder.cpp

+ 4 - 2
Libraries/LibWeb/Layout/LayoutTreeBuilder.cpp

@@ -79,8 +79,10 @@ static RefPtr<LayoutNode> create_layout_tree(Node& node, const StyleProperties*
 
 
 RefPtr<LayoutNode> LayoutTreeBuilder::build(Node& node)
 RefPtr<LayoutNode> LayoutTreeBuilder::build(Node& node)
 {
 {
-    // FIXME: Support building partial trees.
-    ASSERT(is<Document>(node) || !node.has_children());
+    if (!is<Document>(node) && node.has_children()) {
+        dbg() << "FIXME: Support building partial layout trees.";
+        return nullptr;
+    }
     return create_layout_tree(node, nullptr);
     return create_layout_tree(node, nullptr);
 }
 }