mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-21 01:40:46 +00:00
Everywhere: Hoist the Libraries folder to the top-level
This commit is contained in:
parent
950e819ee7
commit
93712b24bf
Notes:
github-actions[bot]
2024-11-10 11:51:52 +00:00
Author: https://github.com/trflynn89
Commit: 93712b24bf
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2256
Reviewed-by: https://github.com/sideshowbarker
4547 changed files with 104 additions and 113 deletions
55
Libraries/LibWeb/CSS/StyleValues/CounterStyleValue.h
Normal file
55
Libraries/LibWeb/CSS/StyleValues/CounterStyleValue.h
Normal file
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
* Copyright (c) 2024, Sam Atkins <sam@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/FlyString.h>
|
||||
#include <LibWeb/CSS/CSSStyleValue.h>
|
||||
|
||||
namespace Web::CSS {
|
||||
|
||||
// https://drafts.csswg.org/css-lists-3/#counter-functions
|
||||
class CounterStyleValue : public StyleValueWithDefaultOperators<CounterStyleValue> {
|
||||
public:
|
||||
enum class CounterFunction {
|
||||
Counter,
|
||||
Counters,
|
||||
};
|
||||
|
||||
static ValueComparingNonnullRefPtr<CounterStyleValue> create_counter(FlyString counter_name, ValueComparingNonnullRefPtr<CSSStyleValue const> counter_style)
|
||||
{
|
||||
return adopt_ref(*new (nothrow) CounterStyleValue(CounterFunction::Counter, move(counter_name), move(counter_style), {}));
|
||||
}
|
||||
static ValueComparingNonnullRefPtr<CounterStyleValue> create_counters(FlyString counter_name, FlyString join_string, ValueComparingNonnullRefPtr<CSSStyleValue const> counter_style)
|
||||
{
|
||||
return adopt_ref(*new (nothrow) CounterStyleValue(CounterFunction::Counters, move(counter_name), move(counter_style), move(join_string)));
|
||||
}
|
||||
virtual ~CounterStyleValue() override;
|
||||
|
||||
CounterFunction function_type() const { return m_properties.function; }
|
||||
auto counter_name() const { return m_properties.counter_name; }
|
||||
auto counter_style() const { return m_properties.counter_style; }
|
||||
auto join_string() const { return m_properties.join_string; }
|
||||
|
||||
String resolve(DOM::Element&) const;
|
||||
|
||||
virtual String to_string() const override;
|
||||
|
||||
bool properties_equal(CounterStyleValue const& other) const;
|
||||
|
||||
private:
|
||||
explicit CounterStyleValue(CounterFunction, FlyString counter_name, ValueComparingNonnullRefPtr<CSSStyleValue const> counter_style, FlyString join_string);
|
||||
|
||||
struct Properties {
|
||||
CounterFunction function;
|
||||
FlyString counter_name;
|
||||
ValueComparingNonnullRefPtr<CSSStyleValue const> counter_style;
|
||||
FlyString join_string;
|
||||
bool operator==(Properties const&) const = default;
|
||||
} m_properties;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue