mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 19:59:17 +00:00
LibWeb/CSS: Merge ScaleStyleValue into TransformationStyleValue
The only ways this varies from the `scale()` function is with parsing and serialization. Parsing stays separate, and serialization is done by telling `TransformationStyleValue` which property it is, and overriding its normal `to_string()` code for properties other than `transform`.
This commit is contained in:
parent
bd5d1b092a
commit
ac15e626dd
Notes:
github-actions[bot]
2025-01-17 09:15:32 +00:00
Author: https://github.com/AtkinsSJ
Commit: ac15e626dd
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3263
12 changed files with 52 additions and 132 deletions
|
@ -16,9 +16,9 @@ namespace Web::CSS {
|
|||
|
||||
class TransformationStyleValue final : public StyleValueWithDefaultOperators<TransformationStyleValue> {
|
||||
public:
|
||||
static ValueComparingNonnullRefPtr<TransformationStyleValue> create(CSS::TransformFunction transform_function, StyleValueVector&& values)
|
||||
static ValueComparingNonnullRefPtr<TransformationStyleValue> create(PropertyID property, TransformFunction transform_function, StyleValueVector&& values)
|
||||
{
|
||||
return adopt_ref(*new (nothrow) TransformationStyleValue(transform_function, move(values)));
|
||||
return adopt_ref(*new (nothrow) TransformationStyleValue(property, transform_function, move(values)));
|
||||
}
|
||||
virtual ~TransformationStyleValue() override = default;
|
||||
|
||||
|
@ -32,14 +32,15 @@ public:
|
|||
bool properties_equal(TransformationStyleValue const& other) const { return m_properties == other.m_properties; }
|
||||
|
||||
private:
|
||||
TransformationStyleValue(CSS::TransformFunction transform_function, StyleValueVector&& values)
|
||||
TransformationStyleValue(PropertyID property, TransformFunction transform_function, StyleValueVector&& values)
|
||||
: StyleValueWithDefaultOperators(Type::Transformation)
|
||||
, m_properties { .transform_function = transform_function, .values = move(values) }
|
||||
, m_properties { .property = property, .transform_function = transform_function, .values = move(values) }
|
||||
{
|
||||
}
|
||||
|
||||
struct Properties {
|
||||
CSS::TransformFunction transform_function;
|
||||
PropertyID property;
|
||||
TransformFunction transform_function;
|
||||
StyleValueVector values;
|
||||
bool operator==(Properties const& other) const;
|
||||
} m_properties;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue