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

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

Issue 1320313002: Move makeRange() with VisiblePosition to EditingUtilities.cpp from VisiblePosition.cpp (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-31T14:11:43 Created 5 years, 3 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/EditingUtilities.cpp ('k') | Source/core/editing/VisiblePosition.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, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 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 10 matching lines...) Expand all
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25 25
26 #ifndef VisiblePosition_h 26 #ifndef VisiblePosition_h
27 #define VisiblePosition_h 27 #define VisiblePosition_h
28 28
29 #include "core/CoreExport.h" 29 #include "core/CoreExport.h"
30 #include "core/editing/EditingBoundary.h" 30 #include "core/editing/EditingBoundary.h"
31 #include "core/editing/EphemeralRange.h"
32 #include "core/editing/PositionWithAffinity.h" 31 #include "core/editing/PositionWithAffinity.h"
33 #include "core/editing/TextAffinity.h" 32 #include "core/editing/TextAffinity.h"
34 #include "platform/heap/Handle.h" 33 #include "platform/heap/Handle.h"
35 #include "platform/text/TextDirection.h" 34 #include "platform/text/TextDirection.h"
36 35
37 namespace blink { 36 namespace blink {
38 37
39 // VisiblePosition default affinity is downstream because 38 // VisiblePosition default affinity is downstream because
40 // the callers do not really care (they just want the 39 // the callers do not really care (they just want the
41 // deep position without regard to line position), and this 40 // deep position without regard to line position), and this
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 // Bounds of (possibly transformed) caret in absolute coords 120 // Bounds of (possibly transformed) caret in absolute coords
122 CORE_EXPORT IntRect absoluteCaretBoundsOf(const VisiblePosition&); 121 CORE_EXPORT IntRect absoluteCaretBoundsOf(const VisiblePosition&);
123 122
124 // Abs x/y position of the caret ignoring transforms. 123 // Abs x/y position of the caret ignoring transforms.
125 // TODO(yosin) navigation with transforms should be smarter. 124 // TODO(yosin) navigation with transforms should be smarter.
126 // TODO(yosin) We should move a glboal funciton 125 // TODO(yosin) We should move a glboal funciton
127 // |lineDirectionPointForBlockDirectionNavigationOf()| to "FrameSelection.h" 126 // |lineDirectionPointForBlockDirectionNavigationOf()| to "FrameSelection.h"
128 // as static function. 127 // as static function.
129 int lineDirectionPointForBlockDirectionNavigationOf(const VisiblePosition&); 128 int lineDirectionPointForBlockDirectionNavigationOf(const VisiblePosition&);
130 129
131 EphemeralRange makeRange(const VisiblePosition&, const VisiblePosition&);
132
133 // TODO(yosin) We should move |leftPositionOf()| and |rightPositionOf()| to 130 // TODO(yosin) We should move |leftPositionOf()| and |rightPositionOf()| to
134 // "VisibleUnits.cpp". 131 // "VisibleUnits.cpp".
135 VisiblePosition leftPositionOf(const VisiblePosition&); 132 VisiblePosition leftPositionOf(const VisiblePosition&);
136 VisiblePosition rightPositionOf(const VisiblePosition&); 133 VisiblePosition rightPositionOf(const VisiblePosition&);
137 134
138 CORE_EXPORT Position canonicalPositionOf(const Position&); 135 CORE_EXPORT Position canonicalPositionOf(const Position&);
139 CORE_EXPORT PositionInComposedTree canonicalPositionOf(const PositionInComposedT ree&); 136 CORE_EXPORT PositionInComposedTree canonicalPositionOf(const PositionInComposedT ree&);
140 // TODO(yosin) We should move |characterAfter()| and |characterBefore()| to 137 // TODO(yosin) We should move |characterAfter()| and |characterBefore()| to
141 // "VisibleUnits.cpp" 138 // "VisibleUnits.cpp"
142 UChar32 characterAfter(const VisiblePosition&); 139 UChar32 characterAfter(const VisiblePosition&);
143 UChar32 characterBefore(const VisiblePosition&); 140 UChar32 characterBefore(const VisiblePosition&);
144 PositionWithAffinity honorEditingBoundaryAtOrBeforeOf(const PositionWithAffinity &, const Position& anchor); 141 PositionWithAffinity honorEditingBoundaryAtOrBeforeOf(const PositionWithAffinity &, const Position& anchor);
145 PositionInComposedTreeWithAffinity honorEditingBoundaryAtOrBeforeOf(const Positi onInComposedTreeWithAffinity&, const PositionInComposedTree& anchor); 142 PositionInComposedTreeWithAffinity honorEditingBoundaryAtOrBeforeOf(const Positi onInComposedTreeWithAffinity&, const PositionInComposedTree& anchor);
146 143
147 // TODO(yosin) We should move |nextPositionOf()| to "VisibleUnits.cpp". 144 // TODO(yosin) We should move |nextPositionOf()| to "VisibleUnits.cpp".
148 VisiblePosition nextPositionOf(const VisiblePosition&, EditingBoundaryCrossingRu le = CanCrossEditingBoundary); 145 VisiblePosition nextPositionOf(const VisiblePosition&, EditingBoundaryCrossingRu le = CanCrossEditingBoundary);
149 // TODO(yosin) We should move |previousPositionOf()| to "VisibleUnits.cpp" 146 // TODO(yosin) We should move |previousPositionOf()| to "VisibleUnits.cpp"
150 VisiblePosition previousPositionOf(const VisiblePosition&, EditingBoundaryCrossi ngRule = CanCrossEditingBoundary); 147 VisiblePosition previousPositionOf(const VisiblePosition&, EditingBoundaryCrossi ngRule = CanCrossEditingBoundary);
151 148
152 } // namespace blink 149 } // namespace blink
153 150
154 #ifndef NDEBUG 151 #ifndef NDEBUG
155 // Outside the WebCore namespace for ease of invocation from gdb. 152 // Outside the WebCore namespace for ease of invocation from gdb.
156 void showTree(const blink::VisiblePosition*); 153 void showTree(const blink::VisiblePosition*);
157 void showTree(const blink::VisiblePosition&); 154 void showTree(const blink::VisiblePosition&);
158 #endif 155 #endif
159 156
160 #endif // VisiblePosition_h 157 #endif // VisiblePosition_h
OLDNEW
« no previous file with comments | « Source/core/editing/EditingUtilities.cpp ('k') | Source/core/editing/VisiblePosition.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698