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

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

Issue 2710883002: Expand FrameSeleciton::isNone() to increase chances of hoisting update layout (Closed)
Patch Set: 2017-02-23T16:27:43 rebase to resolve conflict with DOMSelection in r452402 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
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 8db85385837d2b5d012c1d13cbed6a7897e8960a..147b10fa09c203c7d4978f25893ff29ef469de4d 100644
--- a/third_party/WebKit/Source/core/editing/Editor.cpp
+++ b/third_party/WebKit/Source/core/editing/Editor.cpp
@@ -410,7 +410,7 @@ void Editor::deleteSelectionWithSmartDelete(
DeleteMode deleteMode,
InputEvent::InputType inputType,
const Position& referenceMovePosition) {
- if (frame().selection().isNone())
+ if (frame().selection().computeVisibleSelectionInDOMTreeDeprecated().isNone())
return;
const bool kMergeBlocksAfterDelete = true;
@@ -605,7 +605,10 @@ void Editor::replaceSelectionWithFragment(DocumentFragment* fragment,
bool matchStyle,
InputEvent::InputType inputType) {
DCHECK(!frame().document()->needsLayoutTreeUpdate());
- if (frame().selection().isNone() ||
+ if (frame()
+ .selection()
+ .computeVisibleSelectionInDOMTreeDeprecated()
+ .isNone() ||
!frame()
.selection()
.computeVisibleSelectionInDOMTreeDeprecated()
@@ -796,7 +799,11 @@ void Editor::applyStyle(StylePropertySet* style,
void Editor::applyParagraphStyle(StylePropertySet* style,
InputEvent::InputType inputType) {
- if (frame().selection().isNone() || !style)
+ if (frame()
+ .selection()
+ .computeVisibleSelectionInDOMTreeDeprecated()
+ .isNone() ||
+ !style)
return;
DCHECK(frame().document());
ApplyStyleCommand::create(*frame().document(), EditingStyle::create(style),
« no previous file with comments | « third_party/WebKit/Source/core/editing/DOMSelection.cpp ('k') | third_party/WebKit/Source/core/editing/FrameSelection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698