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

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

Issue 1300303002: Introduce isVisuallyEquivalentCandidate() as replacement of PositionAlgorithm::isCandidate() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-21T01:27:16 Rebase Created 5 years, 4 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 | « Source/core/editing/FrameSelection.cpp ('k') | 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 bool atLastEditingPositionForNode() const; 180 bool atLastEditingPositionForNode() const;
181 181
182 bool atStartOfTree() const; 182 bool atStartOfTree() const;
183 bool atEndOfTree() const; 183 bool atEndOfTree() const;
184 184
185 // These return useful visually equivalent positions. 185 // These return useful visually equivalent positions.
186 // FIXME: We should use mostForwardCaretPosition and mostBackwardPosition. 186 // FIXME: We should use mostForwardCaretPosition and mostBackwardPosition.
187 PositionAlgorithm<Strategy> upstream(EditingBoundaryCrossingRule = CannotCro ssEditingBoundary) const; 187 PositionAlgorithm<Strategy> upstream(EditingBoundaryCrossingRule = CannotCro ssEditingBoundary) const;
188 PositionAlgorithm<Strategy> downstream(EditingBoundaryCrossingRule = CannotC rossEditingBoundary) const; 188 PositionAlgorithm<Strategy> downstream(EditingBoundaryCrossingRule = CannotC rossEditingBoundary) const;
189 189
190 bool isCandidate() const;
191
192 static PositionAlgorithm<Strategy> beforeNode(Node* anchorNode); 190 static PositionAlgorithm<Strategy> beforeNode(Node* anchorNode);
193 static PositionAlgorithm<Strategy> afterNode(Node* anchorNode); 191 static PositionAlgorithm<Strategy> afterNode(Node* anchorNode);
194 static PositionAlgorithm<Strategy> inParentBeforeNode(const Node& anchorNode ); 192 static PositionAlgorithm<Strategy> inParentBeforeNode(const Node& anchorNode );
195 static PositionAlgorithm<Strategy> inParentAfterNode(const Node& anchorNode) ; 193 static PositionAlgorithm<Strategy> inParentAfterNode(const Node& anchorNode) ;
196 static int lastOffsetInNode(Node* anchorNode); 194 static int lastOffsetInNode(Node* anchorNode);
197 static PositionAlgorithm<Strategy> firstPositionInNode(Node* anchorNode); 195 static PositionAlgorithm<Strategy> firstPositionInNode(Node* anchorNode);
198 static PositionAlgorithm<Strategy> lastPositionInNode(Node* anchorNode); 196 static PositionAlgorithm<Strategy> lastPositionInNode(Node* anchorNode);
199 static int minOffsetForNode(Node* anchorNode, int offset); 197 static int minOffsetForNode(Node* anchorNode, int offset);
200 static bool offsetIsBeforeLastNodeOffset(int offset, Node* anchorNode); 198 static bool offsetIsBeforeLastNodeOffset(int offset, Node* anchorNode);
201 static PositionAlgorithm<Strategy> firstPositionInOrBeforeNode(Node* anchorN ode); 199 static PositionAlgorithm<Strategy> firstPositionInOrBeforeNode(Node* anchorN ode);
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 CORE_EXPORT InlineBoxPosition computeInlineBoxPosition(const PositionInComposedT ree&, TextAffinity, TextDirection primaryDirection); 435 CORE_EXPORT InlineBoxPosition computeInlineBoxPosition(const PositionInComposedT ree&, TextAffinity, TextDirection primaryDirection);
438 436
439 // TODO(yosin) We should move |inRenderedText()| to "VisibleUnits.h" for 437 // TODO(yosin) We should move |inRenderedText()| to "VisibleUnits.h" for
440 // reduce dependency of |LayoutObject| in |Position| class. 438 // reduce dependency of |LayoutObject| in |Position| class.
441 CORE_EXPORT bool inRenderedText(const Position&); 439 CORE_EXPORT bool inRenderedText(const Position&);
442 CORE_EXPORT bool inRenderedText(const PositionInComposedTree&); 440 CORE_EXPORT bool inRenderedText(const PositionInComposedTree&);
443 441
444 CORE_EXPORT int uncheckedPreviousOffset(const Node*, int current); 442 CORE_EXPORT int uncheckedPreviousOffset(const Node*, int current);
445 CORE_EXPORT int uncheckedNextOffset(const Node*, int current); 443 CORE_EXPORT int uncheckedNextOffset(const Node*, int current);
446 444
445 // TODO(yosin) We should move |isVisuallyEquivalentCandidate()| to
446 // "VisibleUnits.cpp" to reduce |LayoutObject| dependency in "Position.cpp".
447 CORE_EXPORT bool isVisuallyEquivalentCandidate(const Position&);
448 CORE_EXPORT bool isVisuallyEquivalentCandidate(const PositionInComposedTree&);
449
447 } // namespace blink 450 } // namespace blink
448 451
449 #ifndef NDEBUG 452 #ifndef NDEBUG
450 // Outside the WebCore namespace for ease of invocation from gdb. 453 // Outside the WebCore namespace for ease of invocation from gdb.
451 void showTree(const blink::Position&); 454 void showTree(const blink::Position&);
452 void showTree(const blink::Position*); 455 void showTree(const blink::Position*);
453 #endif 456 #endif
454 457
455 #endif // Position_h 458 #endif // Position_h
OLDNEW
« no previous file with comments | « Source/core/editing/FrameSelection.cpp ('k') | Source/core/editing/Position.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698