mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:38:10 +00:00
LibWeb: Port Element::local_name and TagNames from Deprecated String
Which pretty much needs to be done together due to the amount of places where they are compared together. This also involves porting over StackOfOpenElements over to FlyString from DeprecatedFly string to prevent a gazillion calls to `.to_deprecated_fly_string` calls in HTMLParser.
This commit is contained in:
parent
bbfe0d3a82
commit
9303e9e76f
30 changed files with 163 additions and 158 deletions
|
@ -35,21 +35,21 @@ public:
|
|||
const DOM::Element& current_node() const { return *m_elements.last(); }
|
||||
DOM::Element& current_node() { return *m_elements.last(); }
|
||||
|
||||
bool has_in_scope(DeprecatedFlyString const& tag_name) const;
|
||||
bool has_in_button_scope(DeprecatedFlyString const& tag_name) const;
|
||||
bool has_in_table_scope(DeprecatedFlyString const& tag_name) const;
|
||||
bool has_in_list_item_scope(DeprecatedFlyString const& tag_name) const;
|
||||
bool has_in_select_scope(DeprecatedFlyString const& tag_name) const;
|
||||
bool has_in_scope(FlyString const& tag_name) const;
|
||||
bool has_in_button_scope(FlyString const& tag_name) const;
|
||||
bool has_in_table_scope(FlyString const& tag_name) const;
|
||||
bool has_in_list_item_scope(FlyString const& tag_name) const;
|
||||
bool has_in_select_scope(FlyString const& tag_name) const;
|
||||
|
||||
bool has_in_scope(const DOM::Element&) const;
|
||||
|
||||
bool contains(const DOM::Element&) const;
|
||||
bool contains(DeprecatedFlyString const& tag_name) const;
|
||||
bool contains(FlyString const& tag_name) const;
|
||||
|
||||
auto const& elements() const { return m_elements; }
|
||||
auto& elements() { return m_elements; }
|
||||
|
||||
void pop_until_an_element_with_tag_name_has_been_popped(DeprecatedFlyString const&);
|
||||
void pop_until_an_element_with_tag_name_has_been_popped(FlyString const&);
|
||||
|
||||
JS::GCPtr<DOM::Element> topmost_special_node_below(DOM::Element const&);
|
||||
|
||||
|
@ -57,14 +57,14 @@ public:
|
|||
JS::GCPtr<DOM::Element> element;
|
||||
ssize_t index;
|
||||
};
|
||||
LastElementResult last_element_with_tag_name(DeprecatedFlyString const&);
|
||||
LastElementResult last_element_with_tag_name(FlyString const&);
|
||||
JS::GCPtr<DOM::Element> element_immediately_above(DOM::Element const&);
|
||||
|
||||
void visit_edges(JS::Cell::Visitor&);
|
||||
|
||||
private:
|
||||
bool has_in_scope_impl(DeprecatedFlyString const& tag_name, Vector<DeprecatedFlyString> const&) const;
|
||||
bool has_in_scope_impl(const DOM::Element& target_node, Vector<DeprecatedFlyString> const&) const;
|
||||
bool has_in_scope_impl(FlyString const& tag_name, Vector<FlyString> const&) const;
|
||||
bool has_in_scope_impl(const DOM::Element& target_node, Vector<FlyString> const&) const;
|
||||
|
||||
Vector<JS::NonnullGCPtr<DOM::Element>> m_elements;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue