mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 21:58:12 +00:00
LibWeb: Move CSS Parser into new Web::CSS::Parser namespace
The goal here is to move the parser-internal classes into this namespace so they can have more convenient names without causing collisions. The Parser itself won't collide, and would be more convenient to just remain `CSS::Parser`, but having a namespace and a class with the same name makes C++ unhappy.
This commit is contained in:
parent
1304bf5a21
commit
c449cabae3
23 changed files with 61 additions and 58 deletions
|
@ -313,7 +313,7 @@ void Element::parse_attribute(FlyString const& name, String const& value)
|
|||
// https://drafts.csswg.org/cssom/#ref-for-cssstyledeclaration-updating-flag
|
||||
if (m_inline_style && m_inline_style->is_updating())
|
||||
return;
|
||||
m_inline_style = parse_css_style_attribute(CSS::ParsingContext(document()), value, *this);
|
||||
m_inline_style = parse_css_style_attribute(CSS::Parser::ParsingContext(document()), value, *this);
|
||||
set_needs_style_update(true);
|
||||
}
|
||||
}
|
||||
|
@ -422,7 +422,7 @@ RefPtr<DOMTokenList> const& Element::class_list()
|
|||
// https://dom.spec.whatwg.org/#dom-element-matches
|
||||
DOM::ExceptionOr<bool> Element::matches(StringView selectors) const
|
||||
{
|
||||
auto maybe_selectors = parse_selector(CSS::ParsingContext(static_cast<ParentNode&>(const_cast<Element&>(*this))), selectors);
|
||||
auto maybe_selectors = parse_selector(CSS::Parser::ParsingContext(static_cast<ParentNode&>(const_cast<Element&>(*this))), selectors);
|
||||
if (!maybe_selectors.has_value())
|
||||
return DOM::SyntaxError::create("Failed to parse selector");
|
||||
|
||||
|
@ -437,7 +437,7 @@ DOM::ExceptionOr<bool> Element::matches(StringView selectors) const
|
|||
// https://dom.spec.whatwg.org/#dom-element-closest
|
||||
DOM::ExceptionOr<DOM::Element const*> Element::closest(StringView selectors) const
|
||||
{
|
||||
auto maybe_selectors = parse_selector(CSS::ParsingContext(static_cast<ParentNode&>(const_cast<Element&>(*this))), selectors);
|
||||
auto maybe_selectors = parse_selector(CSS::Parser::ParsingContext(static_cast<ParentNode&>(const_cast<Element&>(*this))), selectors);
|
||||
if (!maybe_selectors.has_value())
|
||||
return DOM::SyntaxError::create("Failed to parse selector");
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ namespace Web::DOM {
|
|||
|
||||
ExceptionOr<RefPtr<Element>> ParentNode::query_selector(StringView selector_text)
|
||||
{
|
||||
auto maybe_selectors = parse_selector(CSS::ParsingContext(*this), selector_text);
|
||||
auto maybe_selectors = parse_selector(CSS::Parser::ParsingContext(*this), selector_text);
|
||||
if (!maybe_selectors.has_value())
|
||||
return DOM::SyntaxError::create("Failed to parse selector");
|
||||
|
||||
|
@ -40,7 +40,7 @@ ExceptionOr<RefPtr<Element>> ParentNode::query_selector(StringView selector_text
|
|||
|
||||
ExceptionOr<NonnullRefPtr<NodeList>> ParentNode::query_selector_all(StringView selector_text)
|
||||
{
|
||||
auto maybe_selectors = parse_selector(CSS::ParsingContext(*this), selector_text);
|
||||
auto maybe_selectors = parse_selector(CSS::Parser::ParsingContext(*this), selector_text);
|
||||
if (!maybe_selectors.has_value())
|
||||
return DOM::SyntaxError::create("Failed to parse selector");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue