mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-19 15:43:20 +00:00
LibWeb/CSS: Implement CSSNumericType.equals()
This commit is contained in:
parent
d29084997e
commit
7be645a091
Notes:
github-actions[bot]
2025-08-29 09:58:23 +00:00
Author: https://github.com/AtkinsSJ
Commit: 7be645a091
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5955
Reviewed-by: https://github.com/trflynn89
22 changed files with 181 additions and 16 deletions
|
@ -25,6 +25,9 @@ struct CSSNumericType {
|
|||
Optional<Bindings::CSSNumericBaseType> percent_hint;
|
||||
};
|
||||
|
||||
// https://drafts.css-houdini.org/css-typed-om-1/#typedefdef-cssnumberish
|
||||
using CSSNumberish = Variant<double, GC::Root<CSSNumericValue>>;
|
||||
|
||||
// https://drafts.css-houdini.org/css-typed-om-1/#cssnumericvalue
|
||||
class CSSNumericValue : public CSSStyleValue {
|
||||
WEB_PLATFORM_OBJECT(CSSNumericValue, CSSStyleValue);
|
||||
|
@ -39,6 +42,9 @@ public:
|
|||
};
|
||||
virtual ~CSSNumericValue() override = default;
|
||||
|
||||
bool equals_for_bindings(Vector<CSSNumberish>) const;
|
||||
virtual bool is_equal_numeric_value(GC::Ref<CSSNumericValue> other) const = 0;
|
||||
|
||||
CSSNumericType type_for_bindings() const;
|
||||
NumericType const& type() const { return m_type; }
|
||||
|
||||
|
@ -55,9 +61,6 @@ protected:
|
|||
NumericType m_type;
|
||||
};
|
||||
|
||||
// https://drafts.css-houdini.org/css-typed-om-1/#typedefdef-cssnumberish
|
||||
using CSSNumberish = Variant<double, GC::Root<CSSNumericValue>>;
|
||||
|
||||
GC::Ref<CSSNumericValue> rectify_a_numberish_value(JS::Realm&, CSSNumberish const&, Optional<FlyString> unit = {});
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue