mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:38:10 +00:00
LibHTML: Add basic <!DOCTYPE> parsing and a DocumentType class
Plus, Document::fixup() will now make sure that the document always starts with a doctype node, followed by an <html> element.
This commit is contained in:
parent
850955053f
commit
fc53867937
9 changed files with 84 additions and 6 deletions
|
@ -11,6 +11,7 @@ enum class NodeType : unsigned {
|
|||
ELEMENT_NODE = 1,
|
||||
TEXT_NODE = 3,
|
||||
DOCUMENT_NODE = 9,
|
||||
DOCUMENT_TYPE_NODE = 10,
|
||||
};
|
||||
|
||||
class Document;
|
||||
|
@ -30,9 +31,10 @@ public:
|
|||
bool is_element() const { return type() == NodeType::ELEMENT_NODE; }
|
||||
bool is_text() const { return type() == NodeType::TEXT_NODE; }
|
||||
bool is_document() const { return type() == NodeType::DOCUMENT_NODE; }
|
||||
bool is_document_type() const { return type() == NodeType::DOCUMENT_TYPE_NODE; }
|
||||
bool is_parent_node() const { return is_element() || is_document(); }
|
||||
|
||||
virtual RefPtr<LayoutNode> create_layout_node(const StyleResolver&, const StyleProperties* parent_style) const = 0;
|
||||
virtual RefPtr<LayoutNode> create_layout_node(const StyleResolver&, const StyleProperties* parent_style) const;
|
||||
RefPtr<LayoutNode> create_layout_tree(const StyleResolver&, const StyleProperties* parent_style) const;
|
||||
|
||||
virtual String tag_name() const = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue