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