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

Unified Diff: third_party/WebKit/Source/web/TextFinder.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/web/TextFinder.cpp
diff --git a/third_party/WebKit/Source/web/TextFinder.cpp b/third_party/WebKit/Source/web/TextFinder.cpp
index 8ed0892928f022e5bd83388937b815fd1996dfb0..b3e0c3ca173bf9c868fd88ead8a7305990c4251b 100644
--- a/third_party/WebKit/Source/web/TextFinder.cpp
+++ b/third_party/WebKit/Source/web/TextFinder.cpp
@@ -114,9 +114,6 @@ private:
bool TextFinder::find(int identifier, const WebString& searchText, const WebFindOptions& options, bool wrapWithinFrame, WebRect* selectionRect, bool* activeNow)
{
- if (!ownerFrame().frame() || !ownerFrame().frame()->page())
- return false;
-
if (!options.findNext)
unmarkAllTextMatches();
else
@@ -252,6 +249,8 @@ void TextFinder::reportFindInPageResultToAccessibility(int identifier)
void TextFinder::scopeStringMatches(int identifier, const WebString& searchText, const WebFindOptions& options, bool reset)
{
+ // TODO(dglazkov): The reset/continue cases need to be untangled into two separate functions. This collation of logic
+ // is unnecessary and adds to overall complexity of the code.
if (reset) {
// This is a brand new search, so we need to reset everything.
// Scoping is just about to begin.
@@ -300,6 +299,10 @@ void TextFinder::scopeStringMatches(int identifier, const WebString& searchText,
return;
}
+ // TODO(dglazkov): The use of updateStyleAndLayoutIgnorePendingStylesheets needs to be audited.
+ // see http://crbug.com/590369 for more details.
+ searchStart.document()->updateStyleAndLayoutIgnorePendingStylesheets();
+
// This timeout controls how long we scope before releasing control. This
// value does not prevent us from running for longer than this, but it is
// periodically checked to see if we have exceeded our allocated time.
« no previous file with comments | « third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp ('k') | third_party/WebKit/Source/web/WebLocalFrameImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698