1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-10 01:51:03 +09:00

LibXML: Set parents for text and comment nodes

This commit is contained in:
Dan Klishch 2023-08-15 10:15:43 -04:00 committed by Ali Mohammad Pur
parent 6368e6ca12
commit 1079f178cf
Notes: sideshowbarker 2024-07-17 04:10:16 +09:00

View file

@ -130,7 +130,7 @@ void Parser::append_text(StringView text, Offset offset)
}
Node::Text text_node;
text_node.builder.append(text);
node.children.append(make<Node>(offset, move(text_node)));
node.children.append(make<Node>(offset, move(text_node), m_entered_node));
},
[&](auto&) {
// Can't enter a text or comment node.
@ -152,7 +152,7 @@ void Parser::append_comment(StringView text, Offset offset)
m_entered_node->content.visit(
[&](Node::Element& node) {
node.children.append(make<Node>(offset, Node::Comment { text }));
node.children.append(make<Node>(offset, Node::Comment { text }, m_entered_node));
},
[&](auto&) {
// Can't enter a text or comment node.