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

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

Issue 2698793003: Get rid of redundant layout tree update related to selection (Closed)
Patch Set: 2017-02-17T00:37:54 FrameSelection::selectFrameElementInParentIfFullySelected() to use FS::isRange() 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 4bf340fd5f88a108d11159655cef891e15700d7c..fbc8b898c9a41d7e48aabfe9bf0d3364538c6314 100644
--- a/third_party/WebKit/Source/core/editing/Editor.cpp
+++ b/third_party/WebKit/Source/core/editing/Editor.cpp
@@ -1623,12 +1623,20 @@ void Editor::setMarkedTextMatchesAreHighlighted(bool flag) {
frame().document()->markers().repaintMarkers(DocumentMarker::TextMatch);
}
+SelectionType computeSelectionType(const SelectionInDOMTree& selection) {
+ if (selection.isNone())
yoichio 2017/02/17 04:35:16 As commented, we should rename to computeIsNone()
yosin_UTC9 2017/02/17 05:14:49 This will be done in another patch. To make this p
+ return NoSelection;
+ if (selection.isCaret() && selection.granularity() == CharacterGranularity)
+ return CaretSelection;
+ return RangeSelection;
+}
+
void Editor::respondToChangedSelection(
const Position& oldSelectionStart,
FrameSelection::SetSelectionOptions options) {
spellChecker().respondToChangedSelection(oldSelectionStart, options);
- client().respondToChangedSelection(&frame(),
- frame().selection().getSelectionType());
+ client().respondToChangedSelection(
+ &frame(), computeSelectionType(frame().selection().selectionInDOMTree()));
setStartNewKillRingSequence(true);
}

Powered by Google App Engine
This is Rietveld 408576698