mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-17 21:49:42 +00:00
LibWeb: Clamp dimension percentage values to the specified percentage
Previously we would clamp the percentage value to the allowed range for canonical dimension values rather than the percentage value. Also fixes an issue where we would clamp pure percentages (i.e. percentages that don't have a hint) against the allowed values for the first dimension we checked (i.e. angle)
This commit is contained in:
parent
b52525b454
commit
073d10c6d1
Notes:
github-actions[bot]
2025-09-19 09:08:11 +00:00
Author: https://github.com/Calme1709
Commit: 073d10c6d1
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6072
Reviewed-by: https://github.com/AtkinsSJ ✅
1 changed files with 4 additions and 4 deletions
|
@ -2955,19 +2955,19 @@ Optional<CalculatedStyleValue::ResolvedValue> CalculatedStyleValue::resolve_valu
|
|||
|
||||
if (value->type()->matches_number(m_context.percentages_resolve_as))
|
||||
accepted_range = m_context.resolve_numbers_as_integers ? m_context.accepted_type_ranges.get(ValueType::Integer) : m_context.accepted_type_ranges.get(ValueType::Number);
|
||||
else if (value->type()->matches_angle_percentage(m_context.percentages_resolve_as))
|
||||
else if (value->type()->matches_angle(m_context.percentages_resolve_as))
|
||||
accepted_range = m_context.accepted_type_ranges.get(ValueType::Angle);
|
||||
else if (value->type()->matches_flex(m_context.percentages_resolve_as))
|
||||
accepted_range = m_context.accepted_type_ranges.get(ValueType::Flex);
|
||||
else if (value->type()->matches_frequency_percentage(m_context.percentages_resolve_as))
|
||||
else if (value->type()->matches_frequency(m_context.percentages_resolve_as))
|
||||
accepted_range = m_context.accepted_type_ranges.get(ValueType::Frequency);
|
||||
else if (value->type()->matches_length_percentage(m_context.percentages_resolve_as))
|
||||
else if (value->type()->matches_length(m_context.percentages_resolve_as))
|
||||
accepted_range = m_context.accepted_type_ranges.get(ValueType::Length);
|
||||
else if (value->type()->matches_percentage())
|
||||
accepted_range = m_context.accepted_type_ranges.get(ValueType::Percentage);
|
||||
else if (value->type()->matches_resolution(m_context.percentages_resolve_as))
|
||||
accepted_range = m_context.accepted_type_ranges.get(ValueType::Resolution);
|
||||
else if (value->type()->matches_time_percentage(m_context.percentages_resolve_as))
|
||||
else if (value->type()->matches_time(m_context.percentages_resolve_as))
|
||||
accepted_range = m_context.accepted_type_ranges.get(ValueType::Time);
|
||||
|
||||
if (!accepted_range.has_value()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue