mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 09:39:39 +00:00
LibWeb/CSS: Remove an unnecessary ParsingContext constructor
Anywhere we have a Node, we have a Document. So just use that.
This commit is contained in:
parent
0ac133d73b
commit
ca5dee4c55
Notes:
github-actions[bot]
2025-02-06 16:49:02 +00:00
Author: https://github.com/AtkinsSJ
Commit: ca5dee4c55
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3464
Reviewed-by: https://github.com/ADKaster
4 changed files with 3 additions and 12 deletions
|
@ -744,7 +744,7 @@ GC::Ptr<ShadowRoot> Element::shadow_root_for_bindings() const
|
|||
WebIDL::ExceptionOr<bool> Element::matches(StringView selectors) const
|
||||
{
|
||||
// 1. Let s be the result of parse a selector from selectors.
|
||||
auto maybe_selectors = parse_selector(CSS::Parser::ParsingContext(static_cast<ParentNode&>(const_cast<Element&>(*this))), selectors);
|
||||
auto maybe_selectors = parse_selector(CSS::Parser::ParsingContext(document()), selectors);
|
||||
|
||||
// 2. If s is failure, then throw a "SyntaxError" DOMException.
|
||||
if (!maybe_selectors.has_value())
|
||||
|
@ -764,7 +764,7 @@ WebIDL::ExceptionOr<bool> Element::matches(StringView selectors) const
|
|||
WebIDL::ExceptionOr<DOM::Element const*> Element::closest(StringView selectors) const
|
||||
{
|
||||
// 1. Let s be the result of parse a selector from selectors.
|
||||
auto maybe_selectors = parse_selector(CSS::Parser::ParsingContext(static_cast<ParentNode&>(const_cast<Element&>(*this))), selectors);
|
||||
auto maybe_selectors = parse_selector(CSS::Parser::ParsingContext(document()), selectors);
|
||||
|
||||
// 2. If s is failure, then throw a "SyntaxError" DOMException.
|
||||
if (!maybe_selectors.has_value())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue