mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 17:49:40 +00:00
LibWeb: Move update_layout() to happen earlier in find_matching_text()
update_layout() need to be invoked before checking if layout node is present, because layout not being updated might be the reason why layout node doesn't exist yet.
This commit is contained in:
parent
32e79bd12e
commit
9754b480fa
Notes:
github-actions[bot]
2024-10-04 05:08:03 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 9754b480fa
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1616
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/awesomekling
1 changed files with 3 additions and 3 deletions
|
@ -5337,12 +5337,12 @@ void Document::set_needs_to_refresh_scroll_state(bool b)
|
|||
|
||||
Vector<JS::Handle<DOM::Range>> Document::find_matching_text(String const& query, CaseSensitivity case_sensitivity)
|
||||
{
|
||||
if (!layout_node())
|
||||
return {};
|
||||
|
||||
// Ensure the layout tree exists before searching for text matches.
|
||||
update_layout();
|
||||
|
||||
if (!layout_node())
|
||||
return {};
|
||||
|
||||
auto const& text_blocks = layout_node()->text_blocks();
|
||||
if (text_blocks.is_empty())
|
||||
return {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue