mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-19 06:29:43 +00:00
LibWeb: Separate relative sizes from absolute_size_mapping
Having relative sizes handled in this function was misleading
This commit is contained in:
parent
1ca511b627
commit
d6754307f9
Notes:
github-actions[bot]
2025-09-19 09:09:15 +00:00
Author: https://github.com/Calme1709
Commit: d6754307f9
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6072
Reviewed-by: https://github.com/AtkinsSJ ✅
5 changed files with 88 additions and 42 deletions
|
@ -4613,8 +4613,15 @@ CSSPixels font_size_to_pixel_size(Utf16View const& font_size)
|
|||
if (!keyword.has_value())
|
||||
return pixel_size;
|
||||
|
||||
// Convert the keyword to an absolute-size
|
||||
auto absolute_size = CSS::keyword_to_absolute_size(keyword.value());
|
||||
|
||||
// If that failed - give up
|
||||
if (!absolute_size.has_value())
|
||||
return pixel_size;
|
||||
|
||||
// Return scaled pixel size
|
||||
return pixel_size * CSS::StyleComputer::absolute_size_mapping(keyword.release_value());
|
||||
return CSS::StyleComputer::absolute_size_mapping(absolute_size.value(), pixel_size);
|
||||
}
|
||||
|
||||
void for_each_node_effectively_contained_in_range(GC::Ptr<DOM::Range> range, Function<TraversalDecision(GC::Ref<DOM::Node>)> callback)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue