mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 18:17:22 +02: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:
committed by
Andreas Kling
parent
f7c79de0c5
commit
a558916e1f
Notes:
sideshowbarker
2024-07-18 09:15:11 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/a558916e1f7 Pull-request: https://github.com/SerenityOS/serenity/pull/8341
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user