LibXML+LibWeb: Store the XML document's original source

Similar to how we store an HTML document's original source. This allows
the source to be inspected with "View Source" in the Browser.
This commit is contained in:
Timothy Flynn 2022-11-03 09:43:34 -04:00 committed by Linus Groh
commit b10bbac061
Notes: sideshowbarker 2024-07-17 04:50:07 +09:00
4 changed files with 8 additions and 0 deletions

View file

@ -174,6 +174,7 @@ ErrorOr<void, ParseError> Parser::parse_with_listener(Listener& listener)
{
m_listener = &listener;
ScopeGuard unset_listener { [this] { m_listener = nullptr; } };
m_listener->set_source(m_source);
m_listener->document_start();
auto result = parse_internal();
if (result.is_error())