mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-24 08:59:50 +00:00
LibWeb: Support tree counting functions within calc()
This commit is contained in:
parent
55bcdcf824
commit
e9036c7c75
Notes:
github-actions[bot]
2025-10-20 15:13:31 +00:00
Author: https://github.com/Calme1709
Commit: e9036c7c75
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6426
Reviewed-by: https://github.com/AtkinsSJ ✅
15 changed files with 62 additions and 44 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue