| OLD | NEW |
| 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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 | 196 |
| 197 bool atStartOfTree() const; | 197 bool atStartOfTree() const; |
| 198 bool atEndOfTree() const; | 198 bool atEndOfTree() const; |
| 199 | 199 |
| 200 // These return useful visually equivalent positions. | 200 // These return useful visually equivalent positions. |
| 201 PositionAlgorithm<Strategy> upstream(EditingBoundaryCrossingRule = CannotCro
ssEditingBoundary) const; | 201 PositionAlgorithm<Strategy> upstream(EditingBoundaryCrossingRule = CannotCro
ssEditingBoundary) const; |
| 202 PositionAlgorithm<Strategy> downstream(EditingBoundaryCrossingRule = CannotC
rossEditingBoundary) const; | 202 PositionAlgorithm<Strategy> downstream(EditingBoundaryCrossingRule = CannotC
rossEditingBoundary) const; |
| 203 | 203 |
| 204 bool isCandidate() const; | 204 bool isCandidate() const; |
| 205 bool inRenderedText() const; | 205 bool inRenderedText() const; |
| 206 bool isRenderedCharacter() const; | |
| 207 | 206 |
| 208 InlineBoxPosition computeInlineBoxPosition(EAffinity) const; | 207 InlineBoxPosition computeInlineBoxPosition(EAffinity) const; |
| 209 InlineBoxPosition computeInlineBoxPosition(EAffinity, TextDirection primaryD
irection) const; | 208 InlineBoxPosition computeInlineBoxPosition(EAffinity, TextDirection primaryD
irection) const; |
| 210 | 209 |
| 211 static bool hasRenderedNonAnonymousDescendantsWithHeight(LayoutObject*); | 210 static bool hasRenderedNonAnonymousDescendantsWithHeight(LayoutObject*); |
| 212 static bool nodeIsUserSelectNone(Node*); | 211 static bool nodeIsUserSelectNone(Node*); |
| 213 static bool nodeIsUserSelectAll(const Node*); | 212 static bool nodeIsUserSelectAll(const Node*); |
| 214 static Node* rootUserSelectAllForNode(Node*); | 213 static Node* rootUserSelectAllForNode(Node*); |
| 215 static PositionAlgorithm<Strategy> beforeNode(Node* anchorNode); | 214 static PositionAlgorithm<Strategy> beforeNode(Node* anchorNode); |
| 216 static PositionAlgorithm<Strategy> afterNode(Node* anchorNode); | 215 static PositionAlgorithm<Strategy> afterNode(Node* anchorNode); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 int m_offset; | 250 int m_offset; |
| 252 PositionAnchorType m_anchorType; | 251 PositionAnchorType m_anchorType; |
| 253 }; | 252 }; |
| 254 | 253 |
| 255 extern template class CORE_EXTERN_TEMPLATE_EXPORT PositionAlgorithm<EditingStrat
egy>; | 254 extern template class CORE_EXTERN_TEMPLATE_EXPORT PositionAlgorithm<EditingStrat
egy>; |
| 256 extern template class CORE_EXTERN_TEMPLATE_EXPORT PositionAlgorithm<EditingInCom
posedTreeStrategy>; | 255 extern template class CORE_EXTERN_TEMPLATE_EXPORT PositionAlgorithm<EditingInCom
posedTreeStrategy>; |
| 257 | 256 |
| 258 using Position = PositionAlgorithm<EditingStrategy>; | 257 using Position = PositionAlgorithm<EditingStrategy>; |
| 259 using PositionInComposedTree = PositionAlgorithm<EditingInComposedTreeStrategy>; | 258 using PositionInComposedTree = PositionAlgorithm<EditingInComposedTreeStrategy>; |
| 260 | 259 |
| 260 // TODO(yosin) |isRenderedCharacter()| should be removed, and we should use |
| 261 // |VisiblePosition::characterAfter()| and |VisiblePosition::characterBefore()|. |
| 262 // TODO(yosin) We should move |isRenderedCharacter()| to "VisibleUnits.cpp", |
| 263 // since it is used only in "editing/commands/" |
| 264 CORE_EXPORT bool isRenderedCharacter(const Position&); |
| 265 |
| 261 template <typename Strategy> | 266 template <typename Strategy> |
| 262 bool operator==(const PositionAlgorithm<Strategy>& a, const PositionAlgorithm<St
rategy>& b) | 267 bool operator==(const PositionAlgorithm<Strategy>& a, const PositionAlgorithm<St
rategy>& b) |
| 263 { | 268 { |
| 264 if (a.isNull()) | 269 if (a.isNull()) |
| 265 return b.isNull(); | 270 return b.isNull(); |
| 266 | 271 |
| 267 if (a.anchorNode() != b.anchorNode() || a.anchorType() != b.anchorType()) | 272 if (a.anchorNode() != b.anchorNode() || a.anchorType() != b.anchorType()) |
| 268 return false; | 273 return false; |
| 269 | 274 |
| 270 if (!a.isOffsetInAnchor()) { | 275 if (!a.isOffsetInAnchor()) { |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 | 455 |
| 451 } // namespace blink | 456 } // namespace blink |
| 452 | 457 |
| 453 #ifndef NDEBUG | 458 #ifndef NDEBUG |
| 454 // Outside the WebCore namespace for ease of invocation from gdb. | 459 // Outside the WebCore namespace for ease of invocation from gdb. |
| 455 void showTree(const blink::Position&); | 460 void showTree(const blink::Position&); |
| 456 void showTree(const blink::Position*); | 461 void showTree(const blink::Position*); |
| 457 #endif | 462 #endif |
| 458 | 463 |
| 459 #endif // Position_h | 464 #endif // Position_h |
| OLD | NEW |