mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:37:45 +00:00
LibWeb: Rename StyleDeclarationRule -> Declaration
This is the term used in the CSS specs.
This commit is contained in:
parent
8b538b1578
commit
611a209756
6 changed files with 21 additions and 21 deletions
|
@ -13,12 +13,12 @@
|
|||
|
||||
namespace Web::CSS {
|
||||
|
||||
class StyleDeclarationRule {
|
||||
class Declaration {
|
||||
friend class Parser;
|
||||
|
||||
public:
|
||||
StyleDeclarationRule();
|
||||
~StyleDeclarationRule();
|
||||
Declaration();
|
||||
~Declaration();
|
||||
|
||||
String to_string() const;
|
||||
|
|
@ -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;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue