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

LibWeb: Implement fragment parsing and use it for Element.innerHTML

This patch implements most of the HTML fragment parsing algorithm and
ports Element::set_inner_html() to it. This was the last remaining user
of the old HTML parser. :^)
This commit is contained in:
Andreas Kling 2020-06-25 23:42:08 +02:00
parent eb33021d65
commit 92d831c25b
7 changed files with 91 additions and 18 deletions

View file

@ -91,8 +91,8 @@ public:
virtual String text_content() const;
Document& document() { return m_document; }
const Document& document() const { return m_document; }
Document& document() { return *m_document; }
const Document& document() const { return *m_document; }
const HTMLAnchorElement* enclosing_link_element() const;
const HTMLElement* enclosing_html_element() const;
@ -140,10 +140,12 @@ public:
virtual void document_did_attach_to_frame(Frame&) {}
virtual void document_will_detach_from_frame(Frame&) {}
void set_document(Badge<Document>, Document&);
protected:
Node(Document&, NodeType);
Document& m_document;
Document* m_document { nullptr };
mutable LayoutNode* m_layout_node { nullptr };
NodeType m_type { NodeType::INVALID };
bool m_needs_style_update { true };