mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-28 20:29:03 +00:00
LibWeb: Ensure layout is up to date before performing find in page query
This commit is contained in:
parent
9585da37ad
commit
fee7b4147c
Notes:
sideshowbarker
2024-07-16 21:30:46 +09:00
Author: https://github.com/tcl3
Commit: fee7b4147c
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/293
1 changed files with 3 additions and 0 deletions
|
@ -5166,6 +5166,9 @@ Vector<JS::Handle<DOM::Range>> Document::find_matching_text(String const& query,
|
||||||
return text_blocks;
|
return text_blocks;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Ensure the layout tree exists before searching for text matches.
|
||||||
|
update_layout();
|
||||||
|
|
||||||
auto text_blocks = gather_text_blocks();
|
auto text_blocks = gather_text_blocks();
|
||||||
if (text_blocks.is_empty())
|
if (text_blocks.is_empty())
|
||||||
return {};
|
return {};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue