| Index: third_party/WebKit/Source/web/WebViewImpl.cpp
|
| diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp
|
| index 5ed461fbbaa76539893737d19cb4c5facf81b548..5d780c3fe4859cf042965e752cf21e37dfdf091d 100644
|
| --- a/third_party/WebKit/Source/web/WebViewImpl.cpp
|
| +++ b/third_party/WebKit/Source/web/WebViewImpl.cpp
|
| @@ -2642,16 +2642,18 @@ bool WebViewImpl::selectionBounds(WebRect& anchor, WebRect& focus) const
|
| if (!localFrame)
|
| return false;
|
| FrameSelection& selection = localFrame->selection();
|
| - if (!selection.isAvailable()) {
|
| + if (!selection.isAvailable() || selection.isNone()) {
|
| // plugins/mouse-capture-inside-shadow.html reaches here.
|
| return false;
|
| }
|
|
|
| - if (selection.isCaret()) {
|
| - // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
|
| - // needs to be audited. See http://crbug.com/590369 for more details.
|
| - localFrame->document()->updateStyleAndLayoutIgnorePendingStylesheets();
|
| + // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
|
| + // needs to be audited. See http://crbug.com/590369 for more details.
|
| + localFrame->document()->updateStyleAndLayoutIgnorePendingStylesheets();
|
| +
|
| + DocumentLifecycle::DisallowTransitionScope disallowTransition(localFrame->document()->lifecycle());
|
|
|
| + if (selection.isCaret()) {
|
| anchor = focus = selection.absoluteCaretBounds();
|
| } else {
|
| const EphemeralRange selectedRange = selection.selection().toNormalizedEphemeralRange();
|
|
|