diff options
Diffstat (limited to 'Userland/Libraries/LibWeb/CSS/Parser/StyleComponentValueRule.h')
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/Parser/StyleComponentValueRule.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/Parser/StyleComponentValueRule.h b/Userland/Libraries/LibWeb/CSS/Parser/StyleComponentValueRule.h index 40a77826de..f03265dbef 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/StyleComponentValueRule.h +++ b/Userland/Libraries/LibWeb/CSS/Parser/StyleComponentValueRule.h @@ -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: |