mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-02 07:37:03 +00:00
LibWeb: Rename IdentifierStyleValue -> CSSKeywordValue
This matches the name in the CSS Typed OM spec. https://drafts.css-houdini.org/css-typed-om-1/#csskeywordvalue
This commit is contained in:
parent
0e3487b9ab
commit
9559f0f123
Notes:
github-actions[bot]
2024-08-15 12:59:38 +00:00
Author: https://github.com/AtkinsSJ
Commit: 9559f0f123
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1076
25 changed files with 137 additions and 136 deletions
45
Userland/Libraries/LibWeb/CSS/StyleValues/CSSKeywordValue.h
Normal file
45
Userland/Libraries/LibWeb/CSS/StyleValues/CSSKeywordValue.h
Normal file
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2021, Tobias Christiansen <tobyase@serenityos.org>
|
||||
* Copyright (c) 2021-2024, Sam Atkins <sam@ladybird.org>
|
||||
* Copyright (c) 2022-2023, MacDue <macdue@dueutil.tech>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibWeb/CSS/CSSStyleValue.h>
|
||||
#include <LibWeb/CSS/ValueID.h>
|
||||
|
||||
namespace Web::CSS {
|
||||
|
||||
// https://drafts.css-houdini.org/css-typed-om-1/#csskeywordvalue
|
||||
class CSSKeywordValue final : public StyleValueWithDefaultOperators<CSSKeywordValue> {
|
||||
public:
|
||||
static ValueComparingNonnullRefPtr<CSSKeywordValue> create(ValueID id)
|
||||
{
|
||||
return adopt_ref(*new (nothrow) CSSKeywordValue(id));
|
||||
}
|
||||
virtual ~CSSKeywordValue() override = default;
|
||||
|
||||
ValueID id() const { return m_id; }
|
||||
|
||||
static bool is_color(ValueID);
|
||||
virtual bool has_color() const override;
|
||||
virtual Color to_color(Optional<Layout::NodeWithStyle const&> node) const override;
|
||||
virtual String to_string() const override;
|
||||
|
||||
bool properties_equal(CSSKeywordValue const& other) const { return m_id == other.m_id; }
|
||||
|
||||
private:
|
||||
explicit CSSKeywordValue(ValueID id)
|
||||
: StyleValueWithDefaultOperators(Type::Keyword)
|
||||
, m_id(id)
|
||||
{
|
||||
}
|
||||
|
||||
ValueID m_id { ValueID::Invalid };
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue