Index: third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp |
diff --git a/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp b/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp |
index 4de8fdfe02df84ea7e30dec0b42d212158c8746c..fb62e50657718f5e44de270e0613d16c0c2f8421 100644 |
--- a/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp |
+++ b/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp |
@@ -566,6 +566,10 @@ static bool executeDeleteWordForward(LocalFrame& frame, Event*, EditorCommandSou |
static bool executeFindString(LocalFrame& frame, Event*, EditorCommandSource, const String& value) |
{ |
+ DCHECK(frame.document()); |
+ // 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(); |
return frame.editor().findString(value, CaseInsensitive | WrapAround); |
} |