LibWeb: Make Node.normalize() ignore CDATASection nodes

We hadn't modeled the "exclusive text node" concept correctly.
This commit is contained in:
Andreas Kling
2024-11-20 11:31:59 +01:00
committed by Andreas Kling
parent 6fc06f45c2
commit ab0dc83d28
4 changed files with 101 additions and 9 deletions

View File

@@ -111,6 +111,7 @@ public:
NodeType type() const { return m_type; }
bool is_element() const { return type() == NodeType::ELEMENT_NODE; }
bool is_text() const { return type() == NodeType::TEXT_NODE || type() == NodeType::CDATA_SECTION_NODE; }
bool is_exclusive_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_comment() const { return type() == NodeType::COMMENT_NODE; }