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

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

Issue 2352763004: Prune CreateVisiblePositionDeprecated from Editor::firstRectForRange (Closed)
Patch Set: 201609231108 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
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();

Powered by Google App Engine
This is Rietveld 408576698