mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 18:10:56 +09:00
LibWeb: Add fast-path for absolute lengths in Length::to_px()
Absolute lengths can be resolved immediately without looking up the viewport size, etc.
This commit is contained in:
parent
30b1772eeb
commit
88aca4c996
Notes:
sideshowbarker
2024-07-17 16:49:24 +09:00
Author: https://github.com/awesomekling
Commit: 88aca4c996
1 changed files with 3 additions and 0 deletions
|
@ -97,6 +97,9 @@ float Length::to_px(Layout::Node const& layout_node) const
|
|||
if (is_calculated())
|
||||
return m_calculated_style->resolve_length(layout_node)->to_px(layout_node);
|
||||
|
||||
if (is_absolute())
|
||||
return absolute_length_to_px();
|
||||
|
||||
if (!layout_node.document().browsing_context())
|
||||
return 0;
|
||||
auto viewport_rect = layout_node.document().browsing_context()->viewport_rect();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue