LibWeb: Handle calculations without a context better

This commit is contained in:
stelar7 2024-10-16 15:00:25 +02:00 committed by Andreas Kling
commit 4408ea7c9b
Notes: github-actions[bot] 2024-10-16 14:40:42 +00:00
4 changed files with 41 additions and 3 deletions

View file

@ -178,11 +178,14 @@ public:
{
if (is_auto())
return 0;
if (is_absolute())
return absolute_length_to_px();
if (is_font_relative())
return font_relative_length_to_px(font_metrics, root_font_metrics);
if (is_viewport_relative())
return viewport_relative_length_to_px(viewport_rect);
return absolute_length_to_px();
VERIFY_NOT_REACHED();
}
ALWAYS_INLINE CSSPixels absolute_length_to_px() const