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

Unified Diff: third_party/WebKit/Source/core/editing/FrameSelection.cpp

Issue 2292913002: Ensure clean layout before calling plainText() (flat tree version) (Closed)
Patch Set: 201609021415 Created 4 years, 3 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/SelectionController.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/FrameSelection.cpp
diff --git a/third_party/WebKit/Source/core/editing/FrameSelection.cpp b/third_party/WebKit/Source/core/editing/FrameSelection.cpp
index 74496ba8aa75966a2bc24c1cc4a04e1198fbe180..0b531a01bd6ac9f54d208fbd7c4aba01d462b94a 100644
--- a/third_party/WebKit/Source/core/editing/FrameSelection.cpp
+++ b/third_party/WebKit/Source/core/editing/FrameSelection.cpp
@@ -1071,6 +1071,13 @@ String FrameSelection::selectedHTMLForClipboard() const
String FrameSelection::selectedText(TextIteratorBehavior behavior) const
{
+ if (!isAvailable())
+ return emptyString();
+
+ // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
+ // needs to be audited. See http://crbug.com/590369 for more details.
+ m_document->updateStyleAndLayoutIgnorePendingStylesheets();
+
return extractSelectedText(*this, behavior);
}
@@ -1078,7 +1085,7 @@ String FrameSelection::selectedTextForClipboard() const
{
if (m_frame->settings() && m_frame->settings()->selectionIncludesAltImageText())
return extractSelectedText(*this, TextIteratorEmitsImageAltText);
- return selectedText();
+ return extractSelectedText(*this, TextIteratorDefaultBehavior);
}
LayoutRect FrameSelection::bounds() const
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/SelectionController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698