1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:47:36 +00:00

LibWeb: Remove Layout::TableBox

Solves conflict in layout tree "type system" when elements <label> (or
<button>) can't have `display: table` because Box can't be
Layout::Label (or Layout::ButtonBox) and Layout::TableBox at the same
time.
This commit is contained in:
Aliaksandr Kalenik 2023-05-29 14:11:19 +03:00 committed by Andreas Kling
parent 269310268d
commit 258f3ea952
34 changed files with 55 additions and 118 deletions

View file

@ -49,7 +49,6 @@
#include <LibWeb/Layout/BlockContainer.h>
#include <LibWeb/Layout/InlineNode.h>
#include <LibWeb/Layout/ListItemBox.h>
#include <LibWeb/Layout/TableBox.h>
#include <LibWeb/Layout/TableCellBox.h>
#include <LibWeb/Layout/TableRowBox.h>
#include <LibWeb/Layout/TableRowGroupBox.h>
@ -326,7 +325,7 @@ JS::GCPtr<Layout::Node> Element::create_layout_node(NonnullRefPtr<CSS::StyleProp
JS::GCPtr<Layout::Node> Element::create_layout_node_for_display_type(DOM::Document& document, CSS::Display const& display, NonnullRefPtr<CSS::StyleProperties> style, Element* element)
{
if (display.is_table_inside())
return document.heap().allocate_without_realm<Layout::TableBox>(document, element, move(style));
return document.heap().allocate_without_realm<Layout::Box>(document, element, move(style));
if (display.is_list_item())
return document.heap().allocate_without_realm<Layout::ListItemBox>(document, element, move(style));