1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:08:10 +00:00

LibXML+LibWeb: Avoid implicit cast from StringView{}->DeprecatedString

This produces a (truly) null DeprecatedString, which is not expected to
occur by CharacterData (where this string ends up).
Simply pass an "empty" DeprecatedString manually instead.
This commit is contained in:
Ali Mohammad Pur 2023-01-08 14:18:33 +03:30 committed by Andreas Kling
parent 356e58332c
commit 803ff81d4a
4 changed files with 19 additions and 13 deletions

View file

@ -78,7 +78,7 @@ void Parser::append_node(NonnullOwnPtr<Node> node)
}
}
void Parser::append_text(DeprecatedString text)
void Parser::append_text(StringView text)
{
if (m_listener) {
m_listener->text(text);
@ -111,7 +111,7 @@ void Parser::append_text(DeprecatedString text)
});
}
void Parser::append_comment(DeprecatedString text)
void Parser::append_comment(StringView text)
{
if (m_listener) {
m_listener->comment(text);
@ -125,7 +125,7 @@ void Parser::append_comment(DeprecatedString text)
m_entered_node->content.visit(
[&](Node::Element& node) {
node.children.append(make<Node>(Node::Comment { move(text) }));
node.children.append(make<Node>(Node::Comment { text }));
},
[&](auto&) {
// Can't enter a text or comment node.