diff options
Diffstat (limited to 'Userland/Libraries/LibWeb/CSS')
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp | 1 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/StyleProperties.cpp | 1 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/StyleValue.cpp | 1 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/StyleValue.h | 22 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/StyleValues/StringStyleValue.h | 36 |
5 files changed, 39 insertions, 22 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp index 924e8c374d..557dfdf69a 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp @@ -63,6 +63,7 @@ #include <LibWeb/CSS/StyleValues/RadialGradientStyleValue.h> #include <LibWeb/CSS/StyleValues/ResolutionStyleValue.h> #include <LibWeb/CSS/StyleValues/ShadowStyleValue.h> +#include <LibWeb/CSS/StyleValues/StringStyleValue.h> #include <LibWeb/DOM/Document.h> #include <LibWeb/Dump.h> #include <LibWeb/Infra/Strings.h> diff --git a/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp b/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp index cf930a5cb3..6245117c8f 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp @@ -16,6 +16,7 @@ #include <LibWeb/CSS/StyleValues/GridTrackSizeStyleValue.h> #include <LibWeb/CSS/StyleValues/PercentageStyleValue.h> #include <LibWeb/CSS/StyleValues/ShadowStyleValue.h> +#include <LibWeb/CSS/StyleValues/StringStyleValue.h> #include <LibWeb/FontCache.h> #include <LibWeb/Layout/BlockContainer.h> #include <LibWeb/Layout/Node.h> diff --git a/Userland/Libraries/LibWeb/CSS/StyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValue.cpp index b1dc817e27..9354b1ba17 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValue.cpp @@ -46,6 +46,7 @@ #include <LibWeb/CSS/StyleValues/RadialGradientStyleValue.h> #include <LibWeb/CSS/StyleValues/ResolutionStyleValue.h> #include <LibWeb/CSS/StyleValues/ShadowStyleValue.h> +#include <LibWeb/CSS/StyleValues/StringStyleValue.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 dc1649efb3..11eab4ea40 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValue.h @@ -622,28 +622,6 @@ private: NonnullOwnPtr<CalcSum> m_expression; }; -class StringStyleValue : public StyleValueWithDefaultOperators<StringStyleValue> { -public: - static ValueComparingNonnullRefPtr<StringStyleValue> create(String const& string) - { - return adopt_ref(*new StringStyleValue(string)); - } - virtual ~StringStyleValue() override = default; - - ErrorOr<String> to_string() const override { return m_string; } - - bool properties_equal(StringStyleValue const& other) const { return m_string == other.m_string; } - -private: - explicit StringStyleValue(String const& string) - : StyleValueWithDefaultOperators(Type::String) - , m_string(string) - { - } - - String m_string; -}; - class TextDecorationStyleValue final : public StyleValueWithDefaultOperators<TextDecorationStyleValue> { public: static ValueComparingNonnullRefPtr<TextDecorationStyleValue> create( diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/StringStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/StringStyleValue.h new file mode 100644 index 0000000000..0650fa4e4a --- /dev/null +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/StringStyleValue.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2022-2023, Sam Atkins <atkinssj@serenityos.org> + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#pragma once + +#include <AK/String.h> +#include <LibWeb/CSS/StyleValue.h> + +namespace Web::CSS { + +class StringStyleValue : public StyleValueWithDefaultOperators<StringStyleValue> { +public: + static ValueComparingNonnullRefPtr<StringStyleValue> create(String const& string) + { + return adopt_ref(*new StringStyleValue(string)); + } + virtual ~StringStyleValue() override = default; + + ErrorOr<String> to_string() const override { return m_string; } + + bool properties_equal(StringStyleValue const& other) const { return m_string == other.m_string; } + +private: + explicit StringStyleValue(String const& string) + : StyleValueWithDefaultOperators(Type::String) + , m_string(string) + { + } + + String m_string; +}; + +} |