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

Unified Diff: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp

Issue 2414263002: Audit the use of updateStyleAndLayoutIgnorePendingStylesheets in toNormalizedEphemeralRange (Closed)
Patch Set: Patched in copy/paste Created 4 years, 2 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/WebLocalFrameImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
index f766178768616d43e898a6ba39e676d5f6801429..11c0cfc183155f65c5906955e0139497960b01a9 100644
--- a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
+++ b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
@@ -1111,6 +1111,11 @@ void WebLocalFrameImpl::replaceMisspelledRange(const WebString& text) {
// does.
if (pluginContainerFromFrame(frame()))
return;
+
+ // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
+ // needs to be audited. see http://crbug.com/590369 for more details.
+ frame()->document()->updateStyleAndLayoutIgnorePendingStylesheets();
+
frame()->spellChecker().replaceMisspelledRange(text);
}
@@ -1128,6 +1133,10 @@ bool WebLocalFrameImpl::hasSelection() const {
}
WebRange WebLocalFrameImpl::selectionRange() const {
+ // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
+ // needs to be audited. See http://crbug.com/590369 for more details.
+ frame()->document()->updateStyleAndLayoutIgnorePendingStylesheets();
+
return frame()->selection().selection().toNormalizedEphemeralRange();
}
@@ -1154,6 +1163,11 @@ WebString WebLocalFrameImpl::selectionAsMarkup() const {
if (pluginContainer)
return pluginContainer->plugin()->selectionAsMarkup();
+ // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
+ // needs to be audited. See http://crbug.com/590369 for more details.
+ // Selection normalization and markup generation require clean layout.
+ frame()->document()->updateStyleAndLayoutIgnorePendingStylesheets();
+
return frame()->selection().selectedHTMLForClipboard();
}

Powered by Google App Engine
This is Rietveld 408576698