mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibWeb: Avoid copying viewport rect when converting length to pixels
See https://github.com/SerenityOS/serenity/pull/3433#discussion_r484570948
This commit is contained in:
parent
be41b19146
commit
9ff6c1e692
Notes:
sideshowbarker
2024-07-17 07:16:32 +09:00
Author: https://github.com/networkException
Commit: 9ff6c1e692
Pull-request: https://github.com/SerenityOS/serenity/pull/15203
Reviewed-by: https://github.com/linusg ✅
1 changed files with 1 additions and 1 deletions
|
@ -104,7 +104,7 @@ float Length::to_px(Layout::Node const& layout_node) const
|
||||||
|
|
||||||
if (!layout_node.document().browsing_context())
|
if (!layout_node.document().browsing_context())
|
||||||
return 0;
|
return 0;
|
||||||
auto viewport_rect = layout_node.document().browsing_context()->viewport_rect();
|
auto const& viewport_rect = layout_node.document().browsing_context()->viewport_rect();
|
||||||
auto* root_element = layout_node.document().document_element();
|
auto* root_element = layout_node.document().document_element();
|
||||||
if (!root_element || !root_element->layout_node())
|
if (!root_element || !root_element->layout_node())
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue