LibWeb: Factor out the "stack of open elements" into its own class

This will allow us to write more expressive parsing code. :^)
This commit is contained in:
Andreas Kling 2020-05-24 19:24:36 +02:00
commit 53d2f4df70
Notes: sideshowbarker 2024-07-19 06:10:28 +09:00
5 changed files with 93 additions and 28 deletions

View file

@ -29,6 +29,7 @@
#include <AK/NonnullRefPtrVector.h>
#include <LibWeb/DOM/Node.h>
#include <LibWeb/Parser/HTMLTokenizer.h>
#include <LibWeb/Parser/StackOfOpenElements.h>
#define ENUMERATE_INSERTION_MODES \
__ENUMERATE_INSERTION_MODE(Initial) \
@ -93,10 +94,10 @@ private:
NonnullRefPtr<Element> create_element_for(HTMLToken&);
RefPtr<Node> find_appropriate_place_for_inserting_node();
RefPtr<Element> insert_html_element(HTMLToken&);
NonnullRefPtr<Node> current_node();
Element& current_node();
InsertionMode m_insertion_mode { InsertionMode::Initial };
NonnullRefPtrVector<Node> m_stack_of_open_elements;
StackOfOpenElements m_stack_of_open_elements;
HTMLTokenizer m_tokenizer;