mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-05 07:39:16 +00:00
LibWeb/CSS: Implement CSSMathValue
This is a base class for the various math functions, so it's not used directly anywhere.
This commit is contained in:
parent
ef8ca729cc
commit
6c8876cdb8
Notes:
github-actions[bot]
2025-08-29 10:00:11 +00:00
Author: https://github.com/AtkinsSJ
Commit: 6c8876cdb8
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5955
Reviewed-by: https://github.com/trflynn89
8 changed files with 96 additions and 3 deletions
|
@ -7,6 +7,7 @@
|
|||
#include "CSSNumericValue.h"
|
||||
#include <LibWeb/Bindings/CSSNumericValuePrototype.h>
|
||||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/CSS/CSSMathValue.h>
|
||||
#include <LibWeb/CSS/CSSUnitValue.h>
|
||||
#include <LibWeb/CSS/NumericType.h>
|
||||
#include <LibWeb/CSS/Serialize.h>
|
||||
|
@ -107,9 +108,11 @@ String CSSNumericValue::to_string(SerializationParams const& params) const
|
|||
if (auto* unit_value = as_if<CSSUnitValue>(this)) {
|
||||
return unit_value->serialize_unit_value(params.minimum, params.maximum);
|
||||
}
|
||||
// FIXME: 2. Otherwise, serialize a CSSMathValue from this, and return the result.
|
||||
|
||||
return {};
|
||||
// 2. Otherwise, serialize a CSSMathValue from this, and return the result.
|
||||
auto& math_value = as<CSSMathValue>(*this);
|
||||
return math_value.serialize_math_value(
|
||||
params.nested ? CSSMathValue::Nested::Yes : CSSMathValue::Nested::No,
|
||||
params.parenless ? CSSMathValue::Parens::Without : CSSMathValue::Parens::With);
|
||||
}
|
||||
|
||||
// https://drafts.css-houdini.org/css-typed-om-1/#rectify-a-numberish-value
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue