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

LibWeb: Implement the rest of the Adoption Agency Algorithm

This gets us 2 points on html5test.com :^)
- Before: https://html5te.st/4cf57659bc08272e (208)
- After: https://html5te.st/fb8a9259bda1c115 (210)
This commit is contained in:
Simon Wanner 2022-03-20 02:11:42 +01:00 committed by Andreas Kling
parent e165ae5b60
commit 1d95745901
6 changed files with 226 additions and 30 deletions

View file

@ -29,6 +29,9 @@ public:
bool is_empty() const { return m_elements.is_empty(); }
void push(NonnullRefPtr<DOM::Element> element) { m_elements.append(move(element)); }
NonnullRefPtr<DOM::Element> pop() { return m_elements.take_last(); }
void remove(DOM::Element const& element);
void replace(DOM::Element const& to_remove, NonnullRefPtr<DOM::Element> to_add);
void insert_immediately_below(NonnullRefPtr<DOM::Element> element_to_add, DOM::Element const& target);
const DOM::Element& current_node() const { return m_elements.last(); }
DOM::Element& current_node() { return m_elements.last(); }