mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-08 10:36:02 +00:00
LibWeb: Add namespaces to Universal and TagName selectors
This commit is contained in:
parent
6c2ed0f51b
commit
1858f06881
Notes:
sideshowbarker
2024-07-17 05:09:48 +09:00
Author: https://github.com/AtkinsSJ
Commit: 1858f06881
Pull-request: https://github.com/SerenityOS/serenity/pull/20429
13 changed files with 245 additions and 49 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue