mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 02:40:49 +00:00
LibHTML: Refactor to go from DOM -> styled tree -> layout tree.
Frame::layout() drives everything now, it takes the DOM contained in the frame and puts it through the tree transformations.
This commit is contained in:
@@ -8,3 +8,18 @@ StyledNode::StyledNode(const Node* node)
|
||||
StyledNode::~StyledNode()
|
||||
{
|
||||
}
|
||||
|
||||
Display StyledNode::display() const
|
||||
{
|
||||
auto it = m_property_values.find("display");
|
||||
if (it == m_property_values.end())
|
||||
return Display::Inline;
|
||||
auto value = it->value->to_string();
|
||||
if (value == "none")
|
||||
return Display::None;
|
||||
if (value == "block")
|
||||
return Display::Block;
|
||||
if (value == "inline")
|
||||
return Display::Inline;
|
||||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user