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); |