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

Unified Diff: Source/core/editing/VisibleSelection.cpp

Issue 1201423002: Use VisibleSelection::InDOMTree::equalSelections() instead of operator==() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-06-24T15:30:20 Rebase - exclude FrameSelection Created 5 years, 6 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 | « Source/core/editing/VisibleSelection.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/VisibleSelection.cpp
diff --git a/Source/core/editing/VisibleSelection.cpp b/Source/core/editing/VisibleSelection.cpp
index 0b39efb9a635dfa0b11f3d2b5143a10a0a25a017..814ddef302fb56e0251dd663d876fb10d8e417ac 100644
--- a/Source/core/editing/VisibleSelection.cpp
+++ b/Source/core/editing/VisibleSelection.cpp
@@ -1155,7 +1155,14 @@ void VisibleSelection::validatePositionsIfNeeded()
bool VisibleSelection::InDOMTree::equalSelections(const VisibleSelection& selection1, const VisibleSelection& selection2)
{
- return selection1 == selection2;
+ if (selection1.affinity() != selection2.affinity() || selection1.isDirectional() != selection2.isDirectional())
hajimehoshi 2015/06/24 06:48:45 Why is this needed? This seems redundant. The comp
yosin_UTC9 2015/06/24 07:02:52 I just copied from original code. It seems we nee
+ return false;
+
+ if (selection1.isNone())
hajimehoshi 2015/06/24 06:48:45 This could also be redundant, but I'm not sure. Wh
yosin_UTC9 2015/06/24 07:02:52 I just copied from original code. If we should rem
+ return selection2.isNone();
+
+ return selection1.start() == selection2.start() && selection1.end() == selection2.end() && selection1.affinity() == selection2.affinity()
+ && selection1.isDirectional() == selection2.isDirectional() && selection1.base() == selection2.base() && selection1.extent() == selection2.extent();
}
bool VisibleSelection::InComposedTree::equalSelections(const VisibleSelection& a, const VisibleSelection& b)
« no previous file with comments | « Source/core/editing/VisibleSelection.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698