1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-24 15:45:07 +00:00
serenity/LibHTML/CSS/StyledNode.cpp
Andreas Kling 7eef69ad4b 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.
2019-06-29 21:42:07 +02:00

25 lines
531 B
C++

#include <LibHTML/CSS/StyledNode.h>
StyledNode::StyledNode(const Node* node)
: m_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();
}