diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2023-03-24 17:40:28 +0000 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2023-03-25 16:56:04 +0000 |
commit | 6cedf5e05b3a36c2678c37f346559f4dbd8a9436 (patch) | |
tree | 209be4b41df8de154c7ae2703a1d0e55dba758a7 /Userland | |
parent | b1ccd30b02ad9b000d01f3e60a3a64153265d23c (diff) | |
download | serenity-6cedf5e05b3a36c2678c37f346559f4dbd8a9436.zip |
LibWeb: Split ResolutionStyleValue out of StyleValue.{h,cpp}
Diffstat (limited to 'Userland')
4 files changed, 40 insertions, 24 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp index 7f716df634..a94a643752 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp @@ -61,6 +61,7 @@ #include <LibWeb/CSS/StyleValues/PercentageStyleValue.h> #include <LibWeb/CSS/StyleValues/PositionStyleValue.h> #include <LibWeb/CSS/StyleValues/RadialGradientStyleValue.h> +#include <LibWeb/CSS/StyleValues/ResolutionStyleValue.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 1e42bc81b4..02883f8ebc 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValue.cpp @@ -44,6 +44,7 @@ #include <LibWeb/CSS/StyleValues/PercentageStyleValue.h> #include <LibWeb/CSS/StyleValues/PositionStyleValue.h> #include <LibWeb/CSS/StyleValues/RadialGradientStyleValue.h> +#include <LibWeb/CSS/StyleValues/ResolutionStyleValue.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 847f74b179..1a51dd80d8 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValue.h @@ -627,30 +627,6 @@ private: NonnullOwnPtr<CalcSum> m_expression; }; -class ResolutionStyleValue : public StyleValueWithDefaultOperators<ResolutionStyleValue> { -public: - static ValueComparingNonnullRefPtr<ResolutionStyleValue> create(Resolution resolution) - { - return adopt_ref(*new ResolutionStyleValue(move(resolution))); - } - virtual ~ResolutionStyleValue() override { } - - Resolution const& resolution() const { return m_resolution; } - - virtual ErrorOr<String> to_string() const override { return m_resolution.to_string(); } - - bool properties_equal(ResolutionStyleValue const& other) const { return m_resolution == other.m_resolution; } - -private: - explicit ResolutionStyleValue(Resolution resolution) - : StyleValueWithDefaultOperators(Type::Resolution) - , m_resolution(move(resolution)) - { - } - - Resolution m_resolution; -}; - class ShadowStyleValue final : public StyleValueWithDefaultOperators<ShadowStyleValue> { public: static ValueComparingNonnullRefPtr<ShadowStyleValue> diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/ResolutionStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/ResolutionStyleValue.h new file mode 100644 index 0000000000..f609db9176 --- /dev/null +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/ResolutionStyleValue.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2022-2023, Sam Atkins <atkinssj@serenityos.org> + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#pragma once + +#include <LibWeb/CSS/Resolution.h> +#include <LibWeb/CSS/StyleValue.h> + +namespace Web::CSS { + +class ResolutionStyleValue : public StyleValueWithDefaultOperators<ResolutionStyleValue> { +public: + static ValueComparingNonnullRefPtr<ResolutionStyleValue> create(Resolution resolution) + { + return adopt_ref(*new ResolutionStyleValue(move(resolution))); + } + virtual ~ResolutionStyleValue() override = default; + + Resolution const& resolution() const { return m_resolution; } + + virtual ErrorOr<String> to_string() const override { return m_resolution.to_string(); } + + bool properties_equal(ResolutionStyleValue const& other) const { return m_resolution == other.m_resolution; } + +private: + explicit ResolutionStyleValue(Resolution resolution) + : StyleValueWithDefaultOperators(Type::Resolution) + , m_resolution(move(resolution)) + { + } + + Resolution m_resolution; +}; + +} |