diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2022-03-31 14:36:12 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-04-07 21:20:14 +0200 |
commit | 611a209756da82c6c483b5cb2e2b8ca00dcd5a8d (patch) | |
tree | e294fa5e2f5f3be6843dbdcc195a1d5dda94d4ee /Userland/Libraries/LibWeb/CSS | |
parent | 8b538b157843a5c8027162d59806e05b2be643e5 (diff) | |
download | serenity-611a209756da82c6c483b5cb2e2b8ca00dcd5a8d.zip |
LibWeb: Rename StyleDeclarationRule -> Declaration
This is the term used in the CSS specs.
Diffstat (limited to 'Userland/Libraries/LibWeb/CSS')
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/Parser/Declaration.h (renamed from Userland/Libraries/LibWeb/CSS/Parser/StyleDeclarationRule.h) | 6 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/Parser/DeclarationOrAtRule.h | 8 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp | 8 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/Parser/Parser.h | 8 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/Parser/StyleRules.cpp | 10 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/Supports.h | 2 |
6 files changed, 21 insertions, 21 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/Parser/StyleDeclarationRule.h b/Userland/Libraries/LibWeb/CSS/Parser/Declaration.h index 5110481abf..f478b48964 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/StyleDeclarationRule.h +++ b/Userland/Libraries/LibWeb/CSS/Parser/Declaration.h @@ -13,12 +13,12 @@ namespace Web::CSS { -class StyleDeclarationRule { +class Declaration { friend class Parser; public: - StyleDeclarationRule(); - ~StyleDeclarationRule(); + Declaration(); + ~Declaration(); String to_string() const; diff --git a/Userland/Libraries/LibWeb/CSS/Parser/DeclarationOrAtRule.h b/Userland/Libraries/LibWeb/CSS/Parser/DeclarationOrAtRule.h index 3574d61dd9..1c3b5502a1 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/DeclarationOrAtRule.h +++ b/Userland/Libraries/LibWeb/CSS/Parser/DeclarationOrAtRule.h @@ -6,7 +6,7 @@ #pragma once -#include <LibWeb/CSS/Parser/StyleDeclarationRule.h> +#include <LibWeb/CSS/Parser/Declaration.h> #include <LibWeb/CSS/Parser/StyleRule.h> namespace Web::CSS { @@ -16,7 +16,7 @@ class DeclarationOrAtRule { public: explicit DeclarationOrAtRule(RefPtr<StyleRule> at); - explicit DeclarationOrAtRule(StyleDeclarationRule declaration); + explicit DeclarationOrAtRule(Declaration declaration); ~DeclarationOrAtRule(); enum class DeclarationType { @@ -33,7 +33,7 @@ public: return *m_at; } - StyleDeclarationRule const& declaration() const + Declaration const& declaration() const { VERIFY(is_declaration()); return m_declaration; @@ -44,7 +44,7 @@ public: private: DeclarationType m_type; RefPtr<StyleRule> m_at; - StyleDeclarationRule m_declaration; + Declaration m_declaration; }; } diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp index 3509b711f1..421e51bcb7 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp @@ -1909,7 +1909,7 @@ NonnullRefPtr<StyleFunctionRule> Parser::consume_a_function(TokenStream<T>& toke // 5.4.6. Consume a declaration // https://www.w3.org/TR/css-syntax-3/#consume-declaration template<typename T> -Optional<StyleDeclarationRule> Parser::consume_a_declaration(TokenStream<T>& tokens) +Optional<Declaration> Parser::consume_a_declaration(TokenStream<T>& tokens) { // Note: This algorithm assumes that the next input token has already been checked to // be an <ident-token>. @@ -1930,7 +1930,7 @@ Optional<StyleDeclarationRule> Parser::consume_a_declaration(TokenStream<T>& tok // Create a new declaration with its name set to the value of the current input token // and its value initially set to the empty list. - StyleDeclarationRule declaration; + Declaration declaration; declaration.m_name = ((Token)token).ident(); // 1. While the next input token is a <whitespace-token>, consume the next input token. @@ -2170,7 +2170,7 @@ Optional<StyleProperty> Parser::parse_as_supports_condition() // 5.3.6. Parse a declaration // https://www.w3.org/TR/css-syntax-3/#parse-a-declaration template<typename T> -Optional<StyleDeclarationRule> Parser::parse_a_declaration(TokenStream<T>& tokens) +Optional<Declaration> Parser::parse_a_declaration(TokenStream<T>& tokens) { // To parse a declaration from input: @@ -2513,7 +2513,7 @@ RefPtr<PropertyOwningCSSStyleDeclaration> Parser::convert_to_style_declaration(V return PropertyOwningCSSStyleDeclaration::create(move(properties), move(custom_properties)); } -Optional<StyleProperty> Parser::convert_to_style_property(StyleDeclarationRule const& declaration) +Optional<StyleProperty> Parser::convert_to_style_property(Declaration const& declaration) { auto& property_name = declaration.m_name; auto property_id = property_id_from_string(property_name); diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Parser.h b/Userland/Libraries/LibWeb/CSS/Parser/Parser.h index 448927dcee..464dece70a 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Parser.h +++ b/Userland/Libraries/LibWeb/CSS/Parser/Parser.h @@ -16,9 +16,9 @@ #include <LibWeb/CSS/GeneralEnclosed.h> #include <LibWeb/CSS/MediaQuery.h> #include <LibWeb/CSS/Parser/ComponentValue.h> +#include <LibWeb/CSS/Parser/Declaration.h> #include <LibWeb/CSS/Parser/DeclarationOrAtRule.h> #include <LibWeb/CSS/Parser/StyleBlockRule.h> -#include <LibWeb/CSS/Parser/StyleDeclarationRule.h> #include <LibWeb/CSS/Parser/StyleFunctionRule.h> #include <LibWeb/CSS/Parser/StyleRule.h> #include <LibWeb/CSS/Parser/Tokenizer.h> @@ -139,7 +139,7 @@ private: // "Parse a declaration" is used in @supports conditions. [CSS3-CONDITIONAL] template<typename T> - Optional<StyleDeclarationRule> parse_a_declaration(TokenStream<T>&); + Optional<Declaration> parse_a_declaration(TokenStream<T>&); template<typename T> Vector<DeclarationOrAtRule> parse_a_style_blocks_contents(TokenStream<T>&); @@ -192,7 +192,7 @@ private: template<typename T> [[nodiscard]] Vector<DeclarationOrAtRule> consume_a_list_of_declarations(TokenStream<T>&); template<typename T> - Optional<StyleDeclarationRule> consume_a_declaration(TokenStream<T>&); + Optional<Declaration> consume_a_declaration(TokenStream<T>&); template<typename T> [[nodiscard]] ComponentValue consume_a_component_value(TokenStream<T>&); template<typename T> @@ -206,7 +206,7 @@ private: RefPtr<CSSRule> convert_to_rule(NonnullRefPtr<StyleRule>); RefPtr<PropertyOwningCSSStyleDeclaration> convert_to_style_declaration(Vector<DeclarationOrAtRule> declarations); - Optional<StyleProperty> convert_to_style_property(StyleDeclarationRule const&); + Optional<StyleProperty> convert_to_style_property(Declaration const&); class Dimension { public: diff --git a/Userland/Libraries/LibWeb/CSS/Parser/StyleRules.cpp b/Userland/Libraries/LibWeb/CSS/Parser/StyleRules.cpp index 437f9e9fa8..fdbb112c5b 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/StyleRules.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/StyleRules.cpp @@ -6,9 +6,9 @@ */ #include <LibWeb/CSS/Parser/ComponentValue.h> +#include <LibWeb/CSS/Parser/Declaration.h> #include <LibWeb/CSS/Parser/DeclarationOrAtRule.h> #include <LibWeb/CSS/Parser/StyleBlockRule.h> -#include <LibWeb/CSS/Parser/StyleDeclarationRule.h> #include <LibWeb/CSS/Parser/StyleFunctionRule.h> #include <LibWeb/CSS/Parser/StyleRule.h> #include <LibWeb/CSS/Serialize.h> @@ -20,7 +20,7 @@ DeclarationOrAtRule::DeclarationOrAtRule(RefPtr<StyleRule> at) , m_at(move(at)) { } -DeclarationOrAtRule::DeclarationOrAtRule(StyleDeclarationRule declaration) +DeclarationOrAtRule::DeclarationOrAtRule(Declaration declaration) : m_type(DeclarationType::Declaration) , m_declaration(move(declaration)) { @@ -50,8 +50,8 @@ ComponentValue::ComponentValue(NonnullRefPtr<StyleBlockRule> block) } ComponentValue::~ComponentValue() = default; -StyleDeclarationRule::StyleDeclarationRule() = default; -StyleDeclarationRule::~StyleDeclarationRule() = default; +Declaration::Declaration() = default; +Declaration::~Declaration() = default; StyleFunctionRule::StyleFunctionRule(String name) : m_name(move(name)) @@ -146,7 +146,7 @@ String ComponentValue::to_debug_string() const }); } -String StyleDeclarationRule::to_string() const +String Declaration::to_string() const { StringBuilder builder; diff --git a/Userland/Libraries/LibWeb/CSS/Supports.h b/Userland/Libraries/LibWeb/CSS/Supports.h index e7b6fa2264..160b8287da 100644 --- a/Userland/Libraries/LibWeb/CSS/Supports.h +++ b/Userland/Libraries/LibWeb/CSS/Supports.h @@ -12,7 +12,7 @@ #include <AK/Variant.h> #include <AK/Vector.h> #include <LibWeb/CSS/GeneralEnclosed.h> -#include <LibWeb/CSS/Parser/StyleDeclarationRule.h> +#include <LibWeb/CSS/Parser/Declaration.h> namespace Web::CSS { |