1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:17:35 +00:00

LibWeb: Add namespaces to Universal and TagName selectors

This commit is contained in:
Sam Atkins 2023-08-08 15:11:48 +01:00 committed by Sam Atkins
parent 6c2ed0f51b
commit 1858f06881
13 changed files with 245 additions and 49 deletions

View file

@ -562,7 +562,7 @@ WebIDL::ExceptionOr<bool> Element::matches(StringView selectors) const
// 3. If the result of match a selector against an element, using s, this, and scoping root this, returns success, then return true; otherwise, return false.
auto sel = maybe_selectors.value();
for (auto& s : sel) {
if (SelectorEngine::matches(s, *this, {}, static_cast<ParentNode const*>(this)))
if (SelectorEngine::matches(s, {}, *this, {}, static_cast<ParentNode const*>(this)))
return true;
}
return false;
@ -581,7 +581,7 @@ WebIDL::ExceptionOr<DOM::Element const*> Element::closest(StringView selectors)
auto matches_selectors = [this](CSS::SelectorList const& selector_list, Element const* element) {
// 4. For each element in elements, if match a selector against an element, using s, element, and scoping root this, returns success, return element.
for (auto& selector : selector_list) {
if (!SelectorEngine::matches(selector, *element, {}, this))
if (!SelectorEngine::matches(selector, {}, *element, {}, this))
return false;
}
return true;