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

Unified Diff: third_party/WebKit/Source/web/WebFrameWidgetImpl.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/WebFrameWidgetImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp b/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
index 132364a8ffea5ca12541469836fe9348350d9801..9a0a197d941fb125ea7bed701bc26998ad2690c1 100644
--- a/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
+++ b/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
@@ -751,12 +751,16 @@ bool WebFrameWidgetImpl::selectionBounds(WebRect& anchor, WebRect& focus) const
return false;
FrameSelection& selection = localFrame->selection();
+ if (selection.isNone())
+ 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