Преглед изворни кода

LibWeb: Ensure layout is up to date before performing find in page query

Tim Ledbetter пре 1 година
родитељ
комит
fee7b4147c
1 измењених фајлова са 3 додато и 0 уклоњено
  1. 3 0
      Userland/Libraries/LibWeb/DOM/Document.cpp

+ 3 - 0
Userland/Libraries/LibWeb/DOM/Document.cpp

@@ -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 {};