1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 07:47:35 +00:00

LibWeb: Move ComponentValue to CSS::Parser namespace

This commit is contained in:
Sam Atkins 2022-04-12 12:13:10 +01:00 committed by Andreas Kling
parent c449cabae3
commit fff2c35f51
11 changed files with 26 additions and 23 deletions

View file

@ -9,7 +9,7 @@
#include <LibWeb/CSS/Parser/StyleBlockRule.h>
#include <LibWeb/CSS/Parser/StyleFunctionRule.h>
namespace Web::CSS {
namespace Web::CSS::Parser {
ComponentValue::ComponentValue(Token token)
: m_value(token)

View file

@ -12,9 +12,11 @@
#include <LibWeb/CSS/Parser/Token.h>
namespace Web::CSS {
class StyleBlockRule;
class StyleFunctionRule;
}
namespace Web::CSS::Parser {
// https://www.w3.org/TR/css-syntax-3/#component-value
class ComponentValue {

View file

@ -21,14 +21,14 @@ public:
~Declaration();
String const& name() const { return m_name; }
Vector<ComponentValue> const& values() const { return m_values; }
Vector<Parser::ComponentValue> const& values() const { return m_values; }
Important importance() const { return m_important; }
String to_string() const;
private:
String m_name;
Vector<ComponentValue> m_values;
Vector<Parser::ComponentValue> m_values;
Important m_important { Important::No };
};

View file

@ -20,7 +20,7 @@ class StyleBlockRule : public RefCounted<StyleBlockRule> {
public:
StyleBlockRule();
explicit StyleBlockRule(Token token, Vector<ComponentValue>&& values)
explicit StyleBlockRule(Token token, Vector<Parser::ComponentValue>&& values)
: m_token(move(token))
, m_values(move(values))
{
@ -33,12 +33,12 @@ public:
Token const& token() const { return m_token; }
Vector<ComponentValue> const& values() const { return m_values; }
Vector<Parser::ComponentValue> const& values() const { return m_values; }
String to_string() const;
private:
Token m_token;
Vector<ComponentValue> m_values;
Vector<Parser::ComponentValue> m_values;
};
}

View file

@ -20,16 +20,16 @@ class StyleFunctionRule : public RefCounted<StyleFunctionRule> {
public:
explicit StyleFunctionRule(String name);
StyleFunctionRule(String name, Vector<ComponentValue>&& values);
StyleFunctionRule(String name, Vector<Parser::ComponentValue>&& values);
~StyleFunctionRule();
String const& name() const { return m_name; }
Vector<ComponentValue> const& values() const { return m_values; }
Vector<Parser::ComponentValue> const& values() const { return m_values; }
String to_string() const;
private:
String m_name;
Vector<ComponentValue> m_values;
Vector<Parser::ComponentValue> m_values;
};
}

View file

@ -29,7 +29,7 @@ public:
bool is_qualified_rule() const { return m_type == Type::Qualified; }
bool is_at_rule() const { return m_type == Type::At; }
Vector<ComponentValue> const& prelude() const { return m_prelude; }
Vector<Parser::ComponentValue> const& prelude() const { return m_prelude; }
RefPtr<StyleBlockRule const> block() const { return m_block; }
String const& at_rule_name() const { return m_at_rule_name; }
@ -38,7 +38,7 @@ public:
private:
Type const m_type;
String m_at_rule_name;
Vector<ComponentValue> m_prelude;
Vector<Parser::ComponentValue> m_prelude;
RefPtr<StyleBlockRule> m_block;
};

View file

@ -44,7 +44,7 @@ StyleFunctionRule::StyleFunctionRule(String name)
{
}
StyleFunctionRule::StyleFunctionRule(String name, Vector<ComponentValue>&& values)
StyleFunctionRule::StyleFunctionRule(String name, Vector<Parser::ComponentValue>&& values)
: m_name(move(name))
, m_values(move(values))
{