ladybird/Userland/Libraries/LibWeb/CSS/StyleValues/ResolutionStyleValue.h
Sam Atkins 0e3487b9ab LibWeb: Rename StyleValue -> CSSStyleValue
This matches the name in the CSS Typed OM spec.
https://drafts.css-houdini.org/css-typed-om-1/#cssstylevalue

No behaviour changes.
2024-08-15 13:58:38 +01:00

38 lines
1 KiB
C++

/*
* Copyright (c) 2022-2023, Sam Atkins <atkinssj@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/CSS/CSSStyleValue.h>
#include <LibWeb/CSS/Resolution.h>
namespace Web::CSS {
class ResolutionStyleValue : public StyleValueWithDefaultOperators<ResolutionStyleValue> {
public:
static ValueComparingNonnullRefPtr<ResolutionStyleValue> create(Resolution resolution)
{
return adopt_ref(*new (nothrow) ResolutionStyleValue(move(resolution)));
}
virtual ~ResolutionStyleValue() override = default;
Resolution const& resolution() const { return m_resolution; }
virtual 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;
};
}