Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(294)

Unified Diff: third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp

Issue 2144673003: Audit the use of updateStyleAndLayoutIgnorePendingStylesheets in SearchBuffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Feedback addressed. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
diff --git a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
index f7a1145f7dc9e1e0aa06929c976bae891fb6a690..22291aa3c05690538af0ccf754f876fbfc602d74 100644
--- a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
+++ b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
@@ -857,6 +857,10 @@ bool LocalDOMWindow::find(const String& string, bool caseSensitive, bool backwar
if (!isCurrentlyDisplayedInFrame())
return false;
+ // Up-to-date, clean tree is required for finding text in page, since it relies
+ // on TextIterator to look over the text.
+ frame()->document()->updateStyleAndLayoutIgnorePendingStylesheets();
+
// FIXME (13016): Support searchInFrames and showDialog
FindOptions options = (backwards ? Backwards : 0) | (caseSensitive ? 0 : CaseInsensitive) | (wrap ? WrapAround : 0) | (wholeWord ? WholeWord | AtWordStarts : 0);
return frame()->editor().findString(string, options);
« no previous file with comments | « third_party/WebKit/Source/core/editing/iterators/SearchBuffer.cpp ('k') | third_party/WebKit/Source/web/TextFinder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698