mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 19:38:12 +00:00
LibWeb: Make CSS selector parsing use StyleComponentValueRules
Also added some pseudo-classes that were handled in the deprecated parser: - :disabled - :enabled - :checked - :nth-child - :nth-last-child - :not
This commit is contained in:
parent
f7c79de0c5
commit
a558916e1f
5 changed files with 167 additions and 108 deletions
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2020-2021, the SerenityOS developers.
|
||||
* Copyright (c) 2021, Sam Atkins <atkinssj@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -25,6 +26,19 @@ public:
|
|||
explicit StyleComponentValueRule(ComponentType);
|
||||
~StyleComponentValueRule();
|
||||
|
||||
bool is_block() const { return m_type == ComponentType::Block; }
|
||||
StyleBlockRule const& block() const { return m_block; }
|
||||
|
||||
bool is_function() const { return m_type == ComponentType::Function; }
|
||||
StyleFunctionRule const& function() const { return m_function; }
|
||||
|
||||
bool is(Token::TokenType type) const
|
||||
{
|
||||
return m_type == ComponentType::Token && m_token.is(type);
|
||||
}
|
||||
Token const& token() const { return m_token; }
|
||||
operator Token() const { return m_token; }
|
||||
|
||||
String to_string() const;
|
||||
|
||||
private:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue