mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 21:59:07 +00:00
LibWeb: Remove a bunch of redundant Document::navigable() lookups
Document::navigable() can be unpleasantly slow, since we don't have a direct link between documents and navigables at the moment. So let's not call it twice when once is enough.
This commit is contained in:
parent
77d98b5697
commit
43c720db81
Notes:
sideshowbarker
2024-07-17 02:06:40 +09:00
Author: https://github.com/awesomekling
Commit: 43c720db81
Pull-request: https://github.com/SerenityOS/serenity/pull/23602
4 changed files with 21 additions and 14 deletions
|
@ -922,8 +922,9 @@ JS::NonnullGCPtr<Geometry::DOMRectList> Element::get_client_rects() const
|
|||
// FIXME: - Replace each anonymous block box with its child box(es) and repeat this until no anonymous block boxes
|
||||
// are left in the final list.
|
||||
const_cast<Document&>(document()).update_layout();
|
||||
VERIFY(document().navigable());
|
||||
auto viewport_offset = document().navigable()->viewport_scroll_offset();
|
||||
auto navigable = document().navigable();
|
||||
VERIFY(navigable);
|
||||
auto viewport_offset = navigable->viewport_scroll_offset();
|
||||
|
||||
if (document().paintable()) {
|
||||
// NOTE: Make sure CSS transforms are resolved before it is used to calculate the rect position.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue