From 6c22b46b37c271deb6cd7989c6949efcca2f8a13 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 17 Oct 2019 23:34:52 +0200 Subject: [PATCH] LibHTML: Hard-code LayoutTable to never have inline children This is a total hack to get around the auto-detection mechanism for whether a block has inline or block children. We'll say that tables never have inline children for now, and then anything that actually turns out to be an inline child will just be ignored by layout. --- Libraries/LibHTML/Layout/LayoutTreeBuilder.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Libraries/LibHTML/Layout/LayoutTreeBuilder.cpp b/Libraries/LibHTML/Layout/LayoutTreeBuilder.cpp index 571734134b..c690818dec 100644 --- a/Libraries/LibHTML/Layout/LayoutTreeBuilder.cpp +++ b/Libraries/LibHTML/Layout/LayoutTreeBuilder.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include @@ -45,6 +46,10 @@ static RefPtr create_layout_tree(Node& node, const StyleProperties* if (have_inline_children && !have_block_children) layout_node->set_children_are_inline(true); + // FIXME: This is really hackish. Some layout nodes don't care about inline children. + if (is(layout_node)) + layout_node->set_children_are_inline(false); + return layout_node; }