mirror of
https://github.com/RGBCube/serenity
synced 2025-05-29 06:55:07 +00:00
LibHTML: Add stub classes for basic table layout
This class introduces LayoutTable, LayoutTableRow and LayoutTableCell. These are produced by "display" values table, table-row and table-cell respectively. Note that there's no layout happening yet, I'm just adding the classes.
This commit is contained in:
parent
14f380f87a
commit
41896ff521
9 changed files with 107 additions and 0 deletions
|
@ -4,6 +4,9 @@
|
|||
#include <LibHTML/Layout/LayoutBlock.h>
|
||||
#include <LibHTML/Layout/LayoutInline.h>
|
||||
#include <LibHTML/Layout/LayoutListItem.h>
|
||||
#include <LibHTML/Layout/LayoutTable.h>
|
||||
#include <LibHTML/Layout/LayoutTableCell.h>
|
||||
#include <LibHTML/Layout/LayoutTableRow.h>
|
||||
|
||||
Element::Element(Document& document, const String& tag_name)
|
||||
: ParentNode(document, NodeType::ELEMENT_NODE)
|
||||
|
@ -84,6 +87,12 @@ RefPtr<LayoutNode> Element::create_layout_node(const StyleProperties* parent_sty
|
|||
return adopt(*new LayoutInline(*this, move(style)));
|
||||
if (display == "list-item")
|
||||
return adopt(*new LayoutListItem(*this, move(style)));
|
||||
if (display == "table")
|
||||
return adopt(*new LayoutTable(*this, move(style)));
|
||||
if (display == "table-row")
|
||||
return adopt(*new LayoutTableRow(*this, move(style)));
|
||||
if (display == "table-cell")
|
||||
return adopt(*new LayoutTableCell(*this, move(style)));
|
||||
|
||||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue