mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-01 12:07:14 +02:00
LibWeb: Support tree counting functions within calc()
This commit is contained in:
committed by
Tim Ledbetter
parent
55bcdcf824
commit
e9036c7c75
Notes:
github-actions[bot]
2025-10-20 15:13:31 +00:00
Author: https://github.com/Calme1709 Commit: https://github.com/LadybirdBrowser/ladybird/commit/e9036c7c750 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6426 Reviewed-by: https://github.com/AtkinsSJ ✅
@@ -6,11 +6,11 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibWeb/CSS/StyleValues/StyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/AbstractNonMathCalcFunctionStyleValue.h>
|
||||
|
||||
namespace Web::CSS {
|
||||
|
||||
class TreeCountingFunctionStyleValue final : public StyleValue {
|
||||
class TreeCountingFunctionStyleValue final : public AbstractNonMathCalcFunctionStyleValue {
|
||||
public:
|
||||
enum class TreeCountingFunction : u8 {
|
||||
SiblingCount,
|
||||
@@ -32,13 +32,14 @@ public:
|
||||
|
||||
size_t resolve(TreeCountingFunctionResolutionContext const&) const;
|
||||
|
||||
virtual RefPtr<CalculationNode const> resolve_to_calculation_node(CalculationContext const&, CalculationResolutionContext const&) const override;
|
||||
virtual ValueComparingNonnullRefPtr<StyleValue const> absolutized(ComputationContext const&) const override;
|
||||
|
||||
virtual bool equals(StyleValue const& other) const override;
|
||||
|
||||
private:
|
||||
TreeCountingFunctionStyleValue(TreeCountingFunction function, ComputedType computed_type)
|
||||
: StyleValue(Type::TreeCountingFunction)
|
||||
: AbstractNonMathCalcFunctionStyleValue(Type::TreeCountingFunction)
|
||||
, m_function(function)
|
||||
, m_computed_type(computed_type)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user