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

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

Issue 2708703003: Expand FrameSeleciton::isRange() to increase chances of hoisting update layout (Closed)
Patch Set: 2017-02-21T23:48:22 rebase Created 3 years, 10 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/FrameSelection.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/Editor.cpp
diff --git a/third_party/WebKit/Source/core/editing/Editor.cpp b/third_party/WebKit/Source/core/editing/Editor.cpp
index e60d713e0572c727203061fb096f0ce1e3dc8ef3..6008e418aaaa921a84af3afe33cd1559e58ffc59 100644
--- a/third_party/WebKit/Source/core/editing/Editor.cpp
+++ b/third_party/WebKit/Source/core/editing/Editor.cpp
@@ -316,7 +316,8 @@ bool Editor::canCopy() const {
if (imageElementFromImageDocument(frame().document()))
return true;
FrameSelection& selection = frame().selection();
- return selection.isRange() && !selection.isInPasswordField();
+ return selection.computeVisibleSelectionInDOMTreeDeprecated().isRange() &&
+ !selection.isInPasswordField();
}
bool Editor::canPaste() const {
@@ -325,7 +326,8 @@ bool Editor::canPaste() const {
bool Editor::canDelete() const {
FrameSelection& selection = frame().selection();
- return selection.isRange() && selection.rootEditableElement();
+ return selection.computeVisibleSelectionInDOMTreeDeprecated().isRange() &&
+ selection.rootEditableElement();
}
bool Editor::smartInsertDeleteEnabled() const {
@@ -353,7 +355,10 @@ bool Editor::deleteWithDirection(DeleteDirection direction,
return false;
EditingState editingState;
- if (frame().selection().isRange()) {
+ if (frame()
+ .selection()
+ .computeVisibleSelectionInDOMTreeDeprecated()
+ .isRange()) {
if (isTypingAction) {
DCHECK(frame().document());
TypingCommand::deleteKeyPressed(
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/FrameSelection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698