2023-04-26 16:05:38 -03:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2023, Emil Militzer <emil.militzer@posteo.de>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <LibWeb/CSS/Display.h>
|
2025-08-08 06:11:51 -03:00
|
|
|
#include <LibWeb/CSS/StyleValues/StyleValue.h>
|
2025-07-19 23:35:33 -03:00
|
|
|
#include <LibWeb/Export.h>
|
2023-04-26 16:05:38 -03:00
|
|
|
|
|
|
|
|
namespace Web::CSS {
|
|
|
|
|
|
2025-07-19 23:35:33 -03:00
|
|
|
class WEB_API DisplayStyleValue : public StyleValueWithDefaultOperators<DisplayStyleValue> {
|
2023-04-26 16:05:38 -03:00
|
|
|
public:
|
2025-04-15 18:18:27 -03:00
|
|
|
static ValueComparingNonnullRefPtr<DisplayStyleValue const> create(Display const&);
|
2023-04-26 16:05:38 -03:00
|
|
|
virtual ~DisplayStyleValue() override = default;
|
|
|
|
|
|
2026-01-08 09:02:18 -03:00
|
|
|
virtual void serialize(StringBuilder& builder, SerializationMode) const override { builder.append(m_display.to_string()); }
|
2023-04-26 16:05:38 -03:00
|
|
|
|
|
|
|
|
Display display() const { return m_display; }
|
|
|
|
|
|
|
|
|
|
bool properties_equal(DisplayStyleValue const& other) const { return m_display == other.m_display; }
|
2026-06-08 15:31:27 -03:00
|
|
|
virtual GC::Ref<CSSStyleValue> reify(JS::Realm&, Utf16FlyString const& associated_property) const override;
|
2023-04-26 16:05:38 -03:00
|
|
|
|
2026-03-08 00:19:00 -03:00
|
|
|
virtual bool is_computationally_independent() const override { return true; }
|
|
|
|
|
|
2023-04-26 16:05:38 -03:00
|
|
|
private:
|
|
|
|
|
explicit DisplayStyleValue(Display const& display)
|
|
|
|
|
: StyleValueWithDefaultOperators(Type::Display)
|
|
|
|
|
, m_display(display)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Display m_display;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|