mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:17:44 +00:00
LibWeb: Split InitialStyleValue out of StyleValue.{h,cpp}
This commit is contained in:
parent
44c9a5b648
commit
1591352531
5 changed files with 36 additions and 20 deletions
|
@ -52,6 +52,7 @@
|
||||||
#include <LibWeb/CSS/StyleValues/IdentifierStyleValue.h>
|
#include <LibWeb/CSS/StyleValues/IdentifierStyleValue.h>
|
||||||
#include <LibWeb/CSS/StyleValues/ImageStyleValue.h>
|
#include <LibWeb/CSS/StyleValues/ImageStyleValue.h>
|
||||||
#include <LibWeb/CSS/StyleValues/InheritStyleValue.h>
|
#include <LibWeb/CSS/StyleValues/InheritStyleValue.h>
|
||||||
|
#include <LibWeb/CSS/StyleValues/InitialStyleValue.h>
|
||||||
#include <LibWeb/CSS/StyleValues/LinearGradientStyleValue.h>
|
#include <LibWeb/CSS/StyleValues/LinearGradientStyleValue.h>
|
||||||
#include <LibWeb/CSS/StyleValues/RadialGradientStyleValue.h>
|
#include <LibWeb/CSS/StyleValues/RadialGradientStyleValue.h>
|
||||||
#include <LibWeb/DOM/Document.h>
|
#include <LibWeb/DOM/Document.h>
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#include <LibWeb/CSS/StyleValues/GridTrackPlacementStyleValue.h>
|
#include <LibWeb/CSS/StyleValues/GridTrackPlacementStyleValue.h>
|
||||||
#include <LibWeb/CSS/StyleValues/GridTrackSizeStyleValue.h>
|
#include <LibWeb/CSS/StyleValues/GridTrackSizeStyleValue.h>
|
||||||
#include <LibWeb/CSS/StyleValues/IdentifierStyleValue.h>
|
#include <LibWeb/CSS/StyleValues/IdentifierStyleValue.h>
|
||||||
|
#include <LibWeb/CSS/StyleValues/InitialStyleValue.h>
|
||||||
#include <LibWeb/DOM/Document.h>
|
#include <LibWeb/DOM/Document.h>
|
||||||
#include <LibWeb/DOM/Element.h>
|
#include <LibWeb/DOM/Element.h>
|
||||||
#include <LibWeb/Layout/Viewport.h>
|
#include <LibWeb/Layout/Viewport.h>
|
||||||
|
|
|
@ -35,6 +35,7 @@
|
||||||
#include <LibWeb/CSS/StyleValues/IdentifierStyleValue.h>
|
#include <LibWeb/CSS/StyleValues/IdentifierStyleValue.h>
|
||||||
#include <LibWeb/CSS/StyleValues/ImageStyleValue.h>
|
#include <LibWeb/CSS/StyleValues/ImageStyleValue.h>
|
||||||
#include <LibWeb/CSS/StyleValues/InheritStyleValue.h>
|
#include <LibWeb/CSS/StyleValues/InheritStyleValue.h>
|
||||||
|
#include <LibWeb/CSS/StyleValues/InitialStyleValue.h>
|
||||||
#include <LibWeb/CSS/StyleValues/LinearGradientStyleValue.h>
|
#include <LibWeb/CSS/StyleValues/LinearGradientStyleValue.h>
|
||||||
#include <LibWeb/CSS/StyleValues/RadialGradientStyleValue.h>
|
#include <LibWeb/CSS/StyleValues/RadialGradientStyleValue.h>
|
||||||
#include <LibWeb/DOM/Document.h>
|
#include <LibWeb/DOM/Document.h>
|
||||||
|
|
|
@ -627,26 +627,6 @@ private:
|
||||||
NonnullOwnPtr<CalcSum> m_expression;
|
NonnullOwnPtr<CalcSum> m_expression;
|
||||||
};
|
};
|
||||||
|
|
||||||
class InitialStyleValue final : public StyleValueWithDefaultOperators<InitialStyleValue> {
|
|
||||||
public:
|
|
||||||
static ValueComparingNonnullRefPtr<InitialStyleValue> the()
|
|
||||||
{
|
|
||||||
static ValueComparingNonnullRefPtr<InitialStyleValue> instance = adopt_ref(*new InitialStyleValue);
|
|
||||||
return instance;
|
|
||||||
}
|
|
||||||
virtual ~InitialStyleValue() override = default;
|
|
||||||
|
|
||||||
ErrorOr<String> to_string() const override { return "initial"_string; }
|
|
||||||
|
|
||||||
bool properties_equal(InitialStyleValue const&) const { return true; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
InitialStyleValue()
|
|
||||||
: StyleValueWithDefaultOperators(Type::Initial)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
class LengthStyleValue : public StyleValueWithDefaultOperators<LengthStyleValue> {
|
class LengthStyleValue : public StyleValueWithDefaultOperators<LengthStyleValue> {
|
||||||
public:
|
public:
|
||||||
static ValueComparingNonnullRefPtr<LengthStyleValue> create(Length const&);
|
static ValueComparingNonnullRefPtr<LengthStyleValue> create(Length const&);
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2022-2023, Sam Atkins <atkinssj@serenityos.org>
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <LibWeb/CSS/StyleValue.h>
|
||||||
|
|
||||||
|
namespace Web::CSS {
|
||||||
|
|
||||||
|
class InitialStyleValue final : public StyleValueWithDefaultOperators<InitialStyleValue> {
|
||||||
|
public:
|
||||||
|
static ValueComparingNonnullRefPtr<InitialStyleValue> the()
|
||||||
|
{
|
||||||
|
static ValueComparingNonnullRefPtr<InitialStyleValue> instance = adopt_ref(*new InitialStyleValue);
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
virtual ~InitialStyleValue() override = default;
|
||||||
|
|
||||||
|
ErrorOr<String> to_string() const override { return "initial"_string; }
|
||||||
|
|
||||||
|
bool properties_equal(InitialStyleValue const&) const { return true; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
InitialStyleValue()
|
||||||
|
: StyleValueWithDefaultOperators(Type::Initial)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue