StyledNode.cpp 531 B

12345678910111213141516171819202122232425
  1. #include <LibHTML/CSS/StyledNode.h>
  2. StyledNode::StyledNode(const Node* node)
  3. : m_node(node)
  4. {
  5. }
  6. StyledNode::~StyledNode()
  7. {
  8. }
  9. Display StyledNode::display() const
  10. {
  11. auto it = m_property_values.find("display");
  12. if (it == m_property_values.end())
  13. return Display::Inline;
  14. auto value = it->value->to_string();
  15. if (value == "none")
  16. return Display::None;
  17. if (value == "block")
  18. return Display::Block;
  19. if (value == "inline")
  20. return Display::Inline;
  21. ASSERT_NOT_REACHED();
  22. }