2024-08-14 16:25:48 +01:00
|
|
|
/*
|
2025-07-10 12:17:27 +01:00
|
|
|
* Copyright (c) 2024-2025, Sam Atkins <sam@ladybird.org>
|
2024-08-14 16:25:48 +01:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <AK/FlyString.h>
|
2025-07-10 12:17:27 +01:00
|
|
|
#include <LibWeb/CSS/Parser/ComponentValue.h>
|
|
|
|
#include <LibWeb/CSS/Parser/Token.h>
|
2025-08-08 10:33:27 +01:00
|
|
|
#include <LibWeb/CSS/StyleValues/StyleValue.h>
|
2024-08-14 16:25:48 +01:00
|
|
|
|
|
|
|
namespace Web::CSS {
|
|
|
|
|
2025-08-08 11:08:54 +01:00
|
|
|
class DimensionStyleValue : public StyleValue {
|
2024-08-14 16:25:48 +01:00
|
|
|
public:
|
2025-08-08 11:08:54 +01:00
|
|
|
virtual ~DimensionStyleValue() override = default;
|
2024-08-14 16:25:48 +01:00
|
|
|
|
2025-08-08 11:08:54 +01:00
|
|
|
virtual double raw_value() const = 0;
|
2025-09-11 11:50:59 +01:00
|
|
|
virtual FlyString unit_name() const = 0;
|
2025-08-18 15:29:22 +01:00
|
|
|
virtual Vector<Parser::ComponentValue> tokenize() const override;
|
|
|
|
virtual GC::Ref<CSSStyleValue> reify(JS::Realm&, String const& associated_property) const override;
|
2024-08-14 16:25:48 +01:00
|
|
|
|
|
|
|
protected:
|
2025-08-08 11:08:54 +01:00
|
|
|
explicit DimensionStyleValue(Type type)
|
2025-08-08 10:33:27 +01:00
|
|
|
: StyleValue(type)
|
2024-08-14 16:25:48 +01:00
|
|
|
{
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|