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

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

Issue 1301643003: Move a member function inRenderedText() out from PositionAlgorithm template class (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-20T14:30:47 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 bool atLastEditingPositionForNode() const; 183 bool atLastEditingPositionForNode() const;
184 184
185 bool atStartOfTree() const; 185 bool atStartOfTree() const;
186 bool atEndOfTree() const; 186 bool atEndOfTree() const;
187 187
188 // These return useful visually equivalent positions. 188 // These return useful visually equivalent positions.
189 PositionAlgorithm<Strategy> upstream(EditingBoundaryCrossingRule = CannotCro ssEditingBoundary) const; 189 PositionAlgorithm<Strategy> upstream(EditingBoundaryCrossingRule = CannotCro ssEditingBoundary) const;
190 PositionAlgorithm<Strategy> downstream(EditingBoundaryCrossingRule = CannotC rossEditingBoundary) const; 190 PositionAlgorithm<Strategy> downstream(EditingBoundaryCrossingRule = CannotC rossEditingBoundary) const;
191 191
192 bool isCandidate() const; 192 bool isCandidate() const;
193 bool inRenderedText() const;
194 193
195 InlineBoxPosition computeInlineBoxPosition(TextAffinity) const; 194 InlineBoxPosition computeInlineBoxPosition(TextAffinity) const;
196 InlineBoxPosition computeInlineBoxPosition(TextAffinity, TextDirection prima ryDirection) const; 195 InlineBoxPosition computeInlineBoxPosition(TextAffinity, TextDirection prima ryDirection) const;
197 196
198 static bool nodeIsUserSelectAll(const Node*); 197 static bool nodeIsUserSelectAll(const Node*);
199 static Node* rootUserSelectAllForNode(Node*); 198 static Node* rootUserSelectAllForNode(Node*);
200 static PositionAlgorithm<Strategy> beforeNode(Node* anchorNode); 199 static PositionAlgorithm<Strategy> beforeNode(Node* anchorNode);
201 static PositionAlgorithm<Strategy> afterNode(Node* anchorNode); 200 static PositionAlgorithm<Strategy> afterNode(Node* anchorNode);
202 static PositionAlgorithm<Strategy> inParentBeforeNode(const Node& anchorNode ); 201 static PositionAlgorithm<Strategy> inParentBeforeNode(const Node& anchorNode );
203 static PositionAlgorithm<Strategy> inParentAfterNode(const Node& anchorNode) ; 202 static PositionAlgorithm<Strategy> inParentAfterNode(const Node& anchorNode) ;
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 template <> 440 template <>
442 inline PositionInComposedTree fromPositionInDOMTree<EditingInComposedTreeStrateg y>(const Position& position) 441 inline PositionInComposedTree fromPositionInDOMTree<EditingInComposedTreeStrateg y>(const Position& position)
443 { 442 {
444 return toPositionInComposedTree(position); 443 return toPositionInComposedTree(position);
445 } 444 }
446 445
447 // TODO(yosin) We should move |hasRenderedNonAnonymousDescendantsWithHeight| 446 // TODO(yosin) We should move |hasRenderedNonAnonymousDescendantsWithHeight|
448 // to "VisibleUnits.cpp" to reduce |LayoutObject| dependency in "Position.cpp" 447 // to "VisibleUnits.cpp" to reduce |LayoutObject| dependency in "Position.cpp"
449 bool hasRenderedNonAnonymousDescendantsWithHeight(LayoutObject*); 448 bool hasRenderedNonAnonymousDescendantsWithHeight(LayoutObject*);
450 449
450 // TODO(yosin) We should move |inRenderedText()| to "VisibleUnits.h" for
451 // reduce dependency of |LayoutObject| in |Position| class.
452 CORE_EXPORT bool inRenderedText(const Position&);
453 CORE_EXPORT bool inRenderedText(const PositionInComposedTree&);
454
451 } // namespace blink 455 } // namespace blink
452 456
453 #ifndef NDEBUG 457 #ifndef NDEBUG
454 // Outside the WebCore namespace for ease of invocation from gdb. 458 // Outside the WebCore namespace for ease of invocation from gdb.
455 void showTree(const blink::Position&); 459 void showTree(const blink::Position&);
456 void showTree(const blink::Position*); 460 void showTree(const blink::Position*);
457 #endif 461 #endif
458 462
459 #endif // Position_h 463 #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