mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-11 02:29:21 +00:00
LibWeb: Make storage of CSS::StyleValues const-correct
Now we consistently use `RefPtr<StyleValue const>` for all StyleValues.
This commit is contained in:
parent
3fdad8fe22
commit
6d11414957
Notes:
github-actions[bot]
2025-04-16 16:44:32 +00:00
Author: https://github.com/ADKaster
Commit: 6d11414957
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4362
Reviewed-by: https://github.com/AtkinsSJ
Reviewed-by: https://github.com/Hendiadyoin1
113 changed files with 628 additions and 629 deletions
|
@ -14,7 +14,7 @@ namespace Web::CSS {
|
|||
// https://drafts.css-houdini.org/css-typed-om-1/#csshsl
|
||||
class CSSHSL final : public CSSColorValue {
|
||||
public:
|
||||
static ValueComparingNonnullRefPtr<CSSHSL> create(ValueComparingNonnullRefPtr<CSSStyleValue> h, ValueComparingNonnullRefPtr<CSSStyleValue> s, ValueComparingNonnullRefPtr<CSSStyleValue> l, ValueComparingRefPtr<CSSStyleValue> alpha, ColorSyntax color_syntax)
|
||||
static ValueComparingNonnullRefPtr<CSSHSL const> create(ValueComparingNonnullRefPtr<CSSStyleValue const> h, ValueComparingNonnullRefPtr<CSSStyleValue const> s, ValueComparingNonnullRefPtr<CSSStyleValue const> l, ValueComparingRefPtr<CSSStyleValue const> alpha, ColorSyntax color_syntax)
|
||||
{
|
||||
// alpha defaults to 1
|
||||
if (!alpha)
|
||||
|
@ -36,17 +36,17 @@ public:
|
|||
virtual bool equals(CSSStyleValue const& other) const override;
|
||||
|
||||
private:
|
||||
CSSHSL(ValueComparingNonnullRefPtr<CSSStyleValue> h, ValueComparingNonnullRefPtr<CSSStyleValue> s, ValueComparingNonnullRefPtr<CSSStyleValue> l, ValueComparingNonnullRefPtr<CSSStyleValue> alpha, ColorSyntax color_syntax)
|
||||
CSSHSL(ValueComparingNonnullRefPtr<CSSStyleValue const> h, ValueComparingNonnullRefPtr<CSSStyleValue const> s, ValueComparingNonnullRefPtr<CSSStyleValue const> l, ValueComparingNonnullRefPtr<CSSStyleValue const> alpha, ColorSyntax color_syntax)
|
||||
: CSSColorValue(ColorType::HSL, color_syntax)
|
||||
, m_properties { .h = move(h), .s = move(s), .l = move(l), .alpha = move(alpha) }
|
||||
{
|
||||
}
|
||||
|
||||
struct Properties {
|
||||
ValueComparingNonnullRefPtr<CSSStyleValue> h;
|
||||
ValueComparingNonnullRefPtr<CSSStyleValue> s;
|
||||
ValueComparingNonnullRefPtr<CSSStyleValue> l;
|
||||
ValueComparingNonnullRefPtr<CSSStyleValue> alpha;
|
||||
ValueComparingNonnullRefPtr<CSSStyleValue const> h;
|
||||
ValueComparingNonnullRefPtr<CSSStyleValue const> s;
|
||||
ValueComparingNonnullRefPtr<CSSStyleValue const> l;
|
||||
ValueComparingNonnullRefPtr<CSSStyleValue const> alpha;
|
||||
bool operator==(Properties const&) const = default;
|
||||
} m_properties;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue