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

Side by Side Diff: third_party/WebKit/Source/core/editing/Position.h

Issue 2875253002: Introduce Position::IsEquivalent() (Closed)
Patch Set: 2017-05-15T13:06:34 Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/Position.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 // Note: Comparison of positions require both parameters are non-null. You 165 // Note: Comparison of positions require both parameters are non-null. You
166 // should check null-position before comparing them. 166 // should check null-position before comparing them.
167 // TODO(yosin): We should use |Position::operator<()| instead of 167 // TODO(yosin): We should use |Position::operator<()| instead of
168 // |Position::comapreTo()| to utilize |DHCECK_XX()|. 168 // |Position::comapreTo()| to utilize |DHCECK_XX()|.
169 int CompareTo(const PositionTemplate<Strategy>&) const; 169 int CompareTo(const PositionTemplate<Strategy>&) const;
170 bool operator<(const PositionTemplate<Strategy>&) const; 170 bool operator<(const PositionTemplate<Strategy>&) const;
171 bool operator<=(const PositionTemplate<Strategy>&) const; 171 bool operator<=(const PositionTemplate<Strategy>&) const;
172 bool operator>(const PositionTemplate<Strategy>&) const; 172 bool operator>(const PositionTemplate<Strategy>&) const;
173 bool operator>=(const PositionTemplate<Strategy>&) const; 173 bool operator>=(const PositionTemplate<Strategy>&) const;
174 174
175 bool IsEquivalent(const PositionTemplate<Strategy>&) const;
176
175 // These can be either inside or just before/after the node, depending on 177 // These can be either inside or just before/after the node, depending on
176 // if the node is ignored by editing or not. 178 // if the node is ignored by editing or not.
177 // FIXME: These should go away. They only make sense for legacy positions. 179 // FIXME: These should go away. They only make sense for legacy positions.
178 bool AtFirstEditingPositionForNode() const; 180 bool AtFirstEditingPositionForNode() const;
179 bool AtLastEditingPositionForNode() const; 181 bool AtLastEditingPositionForNode() const;
180 182
181 bool AtStartOfTree() const; 183 bool AtStartOfTree() const;
182 bool AtEndOfTree() const; 184 bool AtEndOfTree() const;
183 185
184 static PositionTemplate<Strategy> BeforeNode(Node* anchor_node); 186 static PositionTemplate<Strategy> BeforeNode(Node* anchor_node);
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 277
276 } // namespace blink 278 } // namespace blink
277 279
278 #ifndef NDEBUG 280 #ifndef NDEBUG
279 // Outside the WebCore namespace for ease of invocation from gdb. 281 // Outside the WebCore namespace for ease of invocation from gdb.
280 void showTree(const blink::Position&); 282 void showTree(const blink::Position&);
281 void showTree(const blink::Position*); 283 void showTree(const blink::Position*);
282 #endif 284 #endif
283 285
284 #endif // Position_h 286 #endif // Position_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/Position.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698