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

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

Issue 1301023003: Move static member functions next{Previous,Next}Offset() and uncheckedPreviousOffsetForBackwardDelet (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-20T14:28:12 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 | « no previous file | 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 163
164 bool isNull() const { return !m_anchorNode; } 164 bool isNull() const { return !m_anchorNode; }
165 bool isNotNull() const { return m_anchorNode; } 165 bool isNotNull() const { return m_anchorNode; }
166 bool isOrphan() const { return m_anchorNode && !m_anchorNode->inDocument(); } 166 bool isOrphan() const { return m_anchorNode && !m_anchorNode->inDocument(); }
167 167
168 // Move up or down the DOM by one position. 168 // Move up or down the DOM by one position.
169 // Offsets are computed using layout text for nodes that have layoutObjects - but note that even when 169 // Offsets are computed using layout text for nodes that have layoutObjects - but note that even when
170 // using composed characters, the result may be inside a single user-visible character if a ligature is formed. 170 // using composed characters, the result may be inside a single user-visible character if a ligature is formed.
171 PositionAlgorithm<Strategy> previous(PositionMoveType = CodePoint) const; 171 PositionAlgorithm<Strategy> previous(PositionMoveType = CodePoint) const;
172 PositionAlgorithm<Strategy> next(PositionMoveType = CodePoint) const; 172 PositionAlgorithm<Strategy> next(PositionMoveType = CodePoint) const;
173 static int uncheckedPreviousOffset(const Node*, int current);
174 static int uncheckedPreviousOffsetForBackwardDeletion(const Node*, int curre nt);
175 static int uncheckedNextOffset(const Node*, int current);
176 173
177 int compareTo(const PositionAlgorithm<Strategy>&) const; 174 int compareTo(const PositionAlgorithm<Strategy>&) const;
178 175
179 // These can be either inside or just before/after the node, depending on 176 // These can be either inside or just before/after the node, depending on
180 // if the node is ignored by editing or not. 177 // if the node is ignored by editing or not.
181 // FIXME: These should go away. They only make sense for legacy positions. 178 // FIXME: These should go away. They only make sense for legacy positions.
182 bool atFirstEditingPositionForNode() const; 179 bool atFirstEditingPositionForNode() const;
183 bool atLastEditingPositionForNode() const; 180 bool atLastEditingPositionForNode() const;
184 181
185 bool atStartOfTree() const; 182 bool atStartOfTree() const;
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 template <> 438 template <>
442 inline PositionInComposedTree fromPositionInDOMTree<EditingInComposedTreeStrateg y>(const Position& position) 439 inline PositionInComposedTree fromPositionInDOMTree<EditingInComposedTreeStrateg y>(const Position& position)
443 { 440 {
444 return toPositionInComposedTree(position); 441 return toPositionInComposedTree(position);
445 } 442 }
446 443
447 // TODO(yosin) We should move |hasRenderedNonAnonymousDescendantsWithHeight| 444 // TODO(yosin) We should move |hasRenderedNonAnonymousDescendantsWithHeight|
448 // to "VisibleUnits.cpp" to reduce |LayoutObject| dependency in "Position.cpp" 445 // to "VisibleUnits.cpp" to reduce |LayoutObject| dependency in "Position.cpp"
449 bool hasRenderedNonAnonymousDescendantsWithHeight(LayoutObject*); 446 bool hasRenderedNonAnonymousDescendantsWithHeight(LayoutObject*);
450 447
448 CORE_EXPORT int uncheckedPreviousOffset(const Node*, int current);
449 CORE_EXPORT int uncheckedNextOffset(const Node*, int current);
450
451 } // namespace blink 451 } // namespace blink
452 452
453 #ifndef NDEBUG 453 #ifndef NDEBUG
454 // Outside the WebCore namespace for ease of invocation from gdb. 454 // Outside the WebCore namespace for ease of invocation from gdb.
455 void showTree(const blink::Position&); 455 void showTree(const blink::Position&);
456 void showTree(const blink::Position*); 456 void showTree(const blink::Position*);
457 #endif 457 #endif
458 458
459 #endif // Position_h 459 #endif // Position_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/editing/Position.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698