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
Notes: sideshowbarker 2024-07-19 05:22:28 +09:00
7 changed files with 91 additions and 18 deletions

View file

@ -70,6 +70,8 @@ public:
Document& document();
static NonnullRefPtrVector<Node> parse_html_fragment(Element& context_element, const StringView&);
enum class InsertionMode {
#define __ENUMERATE_INSERTION_MODE(mode) mode,
ENUMERATE_INSERTION_MODES
@ -134,7 +136,7 @@ private:
void increment_script_nesting_level();
void decrement_script_nesting_level();
size_t script_nesting_level() const { return m_script_nesting_level; }
void reset_the_insertion_mode_appropriately();
void reset_the_insertion_mode_appropriately(const Element* context_element = nullptr);
void adjust_mathml_attributes(HTMLToken&);
void adjust_svg_attributes(HTMLToken&);