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

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

Issue 2791753002: Revert of Reland: Do not send redundant selectionchange-events (Closed)
Patch Set: Add a NeedsRebaseline to manage conflict with http://crrev.com/460732 Created 3 years, 9 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/PendingSelection.cpp
diff --git a/third_party/WebKit/Source/core/editing/PendingSelection.cpp b/third_party/WebKit/Source/core/editing/PendingSelection.cpp
index 8ffc8e7fe380de3dcdca49a8453493e0a42ab10c..1b106656d49673990d8f12016ed2f04fad889264 100644
--- a/third_party/WebKit/Source/core/editing/PendingSelection.cpp
+++ b/third_party/WebKit/Source/core/editing/PendingSelection.cpp
@@ -123,11 +123,10 @@ void PendingSelection::commit(LayoutView& layoutView) {
// necessarily valid, and the following steps assume a valid selection. See
// <https://bugs.webkit.org/show_bug.cgi?id=69563> and
// <rdar://problem/10232866>.
- const SelectionInFlatTree selection = calcVisibleSelection(originalSelection);
- const VisibleSelectionInFlatTree& visibleSelection =
- createVisibleSelection(selection);
+ const VisibleSelectionInFlatTree& selection =
+ createVisibleSelection(calcVisibleSelection(originalSelection));
- if (!visibleSelection.isRange() || !selectionHasFocus(selection)) {
+ if (!selection.isRange()) {
layoutView.clearSelection();
return;
}
@@ -138,11 +137,11 @@ void PendingSelection::commit(LayoutView& layoutView) {
// If we pass [foo, 3] as the start of the selection, the selection painting
// code will think that content on the line containing 'foo' is selected
// and will fill the gap before 'bar'.
- PositionInFlatTree startPos = visibleSelection.start();
+ PositionInFlatTree startPos = selection.start();
PositionInFlatTree candidate = mostForwardCaretPosition(startPos);
if (isVisuallyEquivalentCandidate(candidate))
startPos = candidate;
- PositionInFlatTree endPos = visibleSelection.end();
+ PositionInFlatTree endPos = selection.end();
candidate = mostBackwardCaretPosition(endPos);
if (isVisuallyEquivalentCandidate(candidate))
endPos = candidate;
@@ -151,8 +150,8 @@ void PendingSelection::commit(LayoutView& layoutView) {
// |VisiblePosition| when a selection is deleted because we don't yet notify
// the |FrameSelection| of text removal.
if (startPos.isNull() || endPos.isNull() ||
- visibleSelection.visibleStart().deepEquivalent() ==
- visibleSelection.visibleEnd().deepEquivalent())
+ selection.visibleStart().deepEquivalent() ==
+ selection.visibleEnd().deepEquivalent())
return;
LayoutObject* startLayoutObject = startPos.anchorNode()->layoutObject();
LayoutObject* endLayoutObject = endPos.anchorNode()->layoutObject();
« no previous file with comments | « third_party/WebKit/Source/core/editing/EditingUtilities.cpp ('k') | third_party/WebKit/Source/core/page/FocusController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698