mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 18:17:22 +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 ✅
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
#include "TreeCountingFunctionStyleValue.h"
|
||||
#include <LibWeb/CSS/StyleValues/CalculatedStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/IntegerStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/NumberStyleValue.h>
|
||||
|
||||
@@ -34,6 +35,14 @@ size_t TreeCountingFunctionStyleValue::resolve(TreeCountingFunctionResolutionCon
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
RefPtr<CalculationNode const> TreeCountingFunctionStyleValue::resolve_to_calculation_node(CalculationContext const& calculation_context, CalculationResolutionContext const& calculation_resolution_context) const
|
||||
{
|
||||
if (!calculation_resolution_context.tree_counting_function_resolution_context.has_value())
|
||||
return nullptr;
|
||||
|
||||
return NumericCalculationNode::create(Number { Number::Type::Number, static_cast<double>(resolve(calculation_resolution_context.tree_counting_function_resolution_context.value())) }, calculation_context);
|
||||
}
|
||||
|
||||
ValueComparingNonnullRefPtr<StyleValue const> TreeCountingFunctionStyleValue::absolutized(ComputationContext const& computation_context) const
|
||||
{
|
||||
// FIXME: We should clamp this value in case it falls outside the valid range for the context it is in
|
||||
|
||||
Reference in New Issue
Block a user