mirror of
https://github.com/RGBCube/serenity
synced 2025-05-18 21:35:06 +00:00
LibWeb: Implement the first half of the Adoption Agency Algorithm
The AAA is a somewhat daunting algorithm you have to run for certain tag when inserted inside the <body> element. The purpose of it is to resolve issues with mismatched tags. This patch implements the first half of the AAA. We also move the "list of active formatting elements" to its own class, since it kept accumulating little behaviors. "Marker" entries are now signified by null Element pointers in the list.
This commit is contained in:
parent
4c9c6b3a7b
commit
db6cf9b37d
7 changed files with 248 additions and 16 deletions
|
@ -48,12 +48,15 @@ public:
|
|||
bool has_in_button_scope(const FlyString& tag_name) const;
|
||||
bool has_in_table_scope(const FlyString& tag_name) const;
|
||||
|
||||
bool has_in_scope(const Element&) const;
|
||||
|
||||
bool contains(const Element&) const;
|
||||
|
||||
const NonnullRefPtrVector<Element>& elements() const { return m_elements; }
|
||||
|
||||
private:
|
||||
bool has_in_scope_impl(const FlyString& tag_name, const Vector<FlyString>&) const;
|
||||
bool has_in_scope_impl(const Element& target_node, const Vector<FlyString>&) const;
|
||||
|
||||
NonnullRefPtrVector<Element> m_elements;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue