1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-17 19:15:08 +00:00

LibHTML: Add parse_html_fragment()

This function parses a partial DOM and returns it wrapped in a document
fragment node (DocumentFragment.)

There are now two entrances into the HTML parser, one for parsing full
documents, and one for parsing fragments. Internally the both wrap the
same parsing function.
This commit is contained in:
Andreas Kling 2019-11-06 20:28:36 +01:00
parent f404a1dc16
commit 635717ed0f
2 changed files with 28 additions and 8 deletions

View file

@ -3,5 +3,7 @@
#include <AK/NonnullRefPtr.h>
#include <LibHTML/DOM/Document.h>
NonnullRefPtr<Document> parse_html(const StringView&, const URL& = URL());
class DocumentFragment;
NonnullRefPtr<Document> parse_html(const StringView&, const URL& = URL());
RefPtr<DocumentFragment> parse_html_fragment(Document&, const StringView&);