diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2023-03-24 23:56:56 +0000 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2023-03-25 16:56:04 +0000 |
commit | 4bf59c59bbb8e4636afe506f23a06200c92df75d (patch) | |
tree | 13fa19b5894385a141042e617349cbda95f0af78 /Userland | |
parent | 1d948f746244b19d106e5148ec3270cee7d279e7 (diff) | |
download | serenity-4bf59c59bbb8e4636afe506f23a06200c92df75d.zip |
LibWeb: Split UnsetStyleValue out of StyleValue.{h,cpp}
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp | 1 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/StyleValue.cpp | 1 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/StyleValue.h | 20 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/StyleValues/UnsetStyleValue.h | 36 |
4 files changed, 38 insertions, 20 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp index f5b16eef54..def048cbbb 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp @@ -68,6 +68,7 @@ #include <LibWeb/CSS/StyleValues/TimeStyleValue.h> #include <LibWeb/CSS/StyleValues/TransformationStyleValue.h> #include <LibWeb/CSS/StyleValues/UnresolvedStyleValue.h> +#include <LibWeb/CSS/StyleValues/UnsetStyleValue.h> #include <LibWeb/DOM/Document.h> #include <LibWeb/Dump.h> #include <LibWeb/Infra/Strings.h> diff --git a/Userland/Libraries/LibWeb/CSS/StyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValue.cpp index aa259167be..2ae512e95a 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValue.cpp @@ -51,6 +51,7 @@ #include <LibWeb/CSS/StyleValues/TimeStyleValue.h> #include <LibWeb/CSS/StyleValues/TransformationStyleValue.h> #include <LibWeb/CSS/StyleValues/UnresolvedStyleValue.h> +#include <LibWeb/CSS/StyleValues/UnsetStyleValue.h> #include <LibWeb/DOM/Document.h> #include <LibWeb/HTML/BrowsingContext.h> #include <LibWeb/Loader/LoadRequest.h> diff --git a/Userland/Libraries/LibWeb/CSS/StyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValue.h index bb8d0af38a..080920fc89 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValue.h @@ -622,26 +622,6 @@ private: NonnullOwnPtr<CalcSum> m_expression; }; -class UnsetStyleValue final : public StyleValueWithDefaultOperators<UnsetStyleValue> { -public: - static ValueComparingNonnullRefPtr<UnsetStyleValue> the() - { - static ValueComparingNonnullRefPtr<UnsetStyleValue> instance = adopt_ref(*new UnsetStyleValue); - return instance; - } - virtual ~UnsetStyleValue() override = default; - - ErrorOr<String> to_string() const override { return "unset"_string; } - - bool properties_equal(UnsetStyleValue const&) const { return true; } - -private: - UnsetStyleValue() - : StyleValueWithDefaultOperators(Type::Unset) - { - } -}; - class StyleValueList final : public StyleValueWithDefaultOperators<StyleValueList> { public: enum class Separator { diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/UnsetStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/UnsetStyleValue.h new file mode 100644 index 0000000000..28aba45ff3 --- /dev/null +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/UnsetStyleValue.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2021, Tobias Christiansen <tobyase@serenityos.org> + * Copyright (c) 2021-2023, Sam Atkins <atkinssj@serenityos.org> + * Copyright (c) 2022-2023, MacDue <macdue@dueutil.tech> + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#pragma once + +#include <LibWeb/CSS/StyleValue.h> + +namespace Web::CSS { + +class UnsetStyleValue final : public StyleValueWithDefaultOperators<UnsetStyleValue> { +public: + static ValueComparingNonnullRefPtr<UnsetStyleValue> the() + { + static ValueComparingNonnullRefPtr<UnsetStyleValue> instance = adopt_ref(*new UnsetStyleValue); + return instance; + } + virtual ~UnsetStyleValue() override = default; + + ErrorOr<String> to_string() const override { return "unset"_string; } + + bool properties_equal(UnsetStyleValue const&) const { return true; } + +private: + UnsetStyleValue() + : StyleValueWithDefaultOperators(Type::Unset) + { + } +}; + +} |