mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-04 07:09:47 +00:00
LibWeb: Make Node::is_text() return true for CDATASection nodes
CDATASection inherits from Text, and so it was incorrect for them to claim not to be Text nodes. This fixes at least two WPT subtests. :^) It also exposed a bug in the DOM Parsing and Serialization spec, where we're not told how to serialize CDATASection nodes. Spec bug: https://github.com/w3c/DOM-Parsing/issues/38
This commit is contained in:
parent
564dc0a434
commit
6ffc7ea36d
Notes:
github-actions[bot]
2024-11-19 19:25:35 +00:00
Author: https://github.com/awesomekling
Commit: 6ffc7ea36d
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2441
Reviewed-by: https://github.com/tcl3 ✅
5 changed files with 2545 additions and 7 deletions
|
@ -110,7 +110,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; }
|
||||
bool is_text() const { return type() == NodeType::TEXT_NODE || type() == NodeType::CDATA_SECTION_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; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue