mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-21 23:50:06 +00:00
LibWeb: Resolve percentages in <angular-color-stop-list>
as angles
This commit is contained in:
parent
62c00712fa
commit
cc2c8e8615
Notes:
github-actions[bot]
2025-10-17 07:38:54 +00:00
Author: https://github.com/Calme1709
Commit: cc2c8e8615
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6497
Reviewed-by: https://github.com/tcl3 ✅
4 changed files with 11 additions and 5 deletions
|
@ -4110,7 +4110,8 @@ RefPtr<CalculatedStyleValue const> Parser::parse_calculated_value(ComponentValue
|
|||
return CalculationContext::for_property(PropertyNameAndID::from_id(property_id));
|
||||
},
|
||||
[](FunctionContext const& function) -> Optional<CalculationContext> {
|
||||
// Gradients resolve percentages as lengths relative to the gradient-box.
|
||||
// Gradients resolve percentages as lengths relative to the gradient-box (except within
|
||||
// <angular-color-stop-list>s which are handled by a special context)
|
||||
if (function.name.is_one_of_ignoring_ascii_case(
|
||||
"linear-gradient"sv, "repeating-linear-gradient"sv,
|
||||
"radial-gradient"sv, "repeating-radial-gradient"sv,
|
||||
|
@ -4140,6 +4141,8 @@ RefPtr<CalculatedStyleValue const> Parser::parse_calculated_value(ComponentValue
|
|||
},
|
||||
[](SpecialContext special_context) -> Optional<CalculationContext> {
|
||||
switch (special_context) {
|
||||
case SpecialContext::AngularColorStopList:
|
||||
return CalculationContext { .percentages_resolve_as = ValueType::Angle };
|
||||
case SpecialContext::ShadowBlurRadius:
|
||||
return CalculationContext { .accepted_type_ranges = { { ValueType::Length, { 0, NumericLimits<float>::max() } } } };
|
||||
case SpecialContext::TranslateZArgument:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue