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

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

Issue 2414263002: Audit the use of updateStyleAndLayoutIgnorePendingStylesheets in toNormalizedEphemeralRange (Closed)
Patch Set: fix nit 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/ContextMenuClientImpl.cpp
diff --git a/third_party/WebKit/Source/web/ContextMenuClientImpl.cpp b/third_party/WebKit/Source/web/ContextMenuClientImpl.cpp
index 02fa31866838505e4ab8ffb276f5ba349233669b..efa6a0b9ef74702c5069835da12a72774c51ad65 100644
--- a/third_party/WebKit/Source/web/ContextMenuClientImpl.cpp
+++ b/third_party/WebKit/Source/web/ContextMenuClientImpl.cpp
@@ -304,8 +304,14 @@ bool ContextMenuClientImpl::showContextMenu(const ContextMenu* defaultMenu,
if (r.isSelected()) {
if (!isHTMLInputElement(*r.innerNode()) ||
- toHTMLInputElement(r.innerNode())->type() != InputTypeNames::password)
+ toHTMLInputElement(r.innerNode())->type() != InputTypeNames::password) {
+ // TODO(xiaochengh): Use of updateStyleAndLayoutIgnorePendingStylesheets
+ // needs to be audited. See http://crbug.com/590369 for more details.
+ // Plain text extraction requires clean layout.
+ selectedFrame->document()->updateStyleAndLayoutIgnorePendingStylesheets();
+
data.selectedText = selectedFrame->selectedText().stripWhiteSpace();
+ }
}
if (r.isContentEditable()) {
« no previous file with comments | « third_party/WebKit/Source/core/testing/Internals.cpp ('k') | third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698