Chromium Code Reviews| 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 308f084bb748271753315bcbb0f1f7276e5560ab..65f8e46427a3250895e0cb56bfd2b998f8c25b41 100644 |
| --- a/third_party/WebKit/Source/core/editing/FrameSelection.cpp |
| +++ b/third_party/WebKit/Source/core/editing/FrameSelection.cpp |
| @@ -1071,11 +1071,25 @@ 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); |
| } |
| String FrameSelection::selectedTextForClipboard() const |
|
yosin_UTC9
2016/08/31 04:58:21
There are only three call sites of selectedTextFor
Xiaocheng
2016/09/02 05:37:24
I guess the layout is already clean when called fr
|
| { |
| + 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(); |
| + |
| if (m_frame->settings() && m_frame->settings()->selectionIncludesAltImageText()) |
| return extractSelectedText(*this, TextIteratorEmitsImageAltText); |
| return selectedText(); |
|
yosin_UTC9
2016/08/31 04:58:21
It seems we can replace |selectedText()| call to |
Xiaocheng
2016/09/02 05:37:24
Makes sense. Done.
|