| OLD | NEW |
| 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 bool isOrphan() const { return m_deepPosition.isOrphan(); } | 90 bool isOrphan() const { return m_deepPosition.isOrphan(); } |
| 91 | 91 |
| 92 Position deepEquivalent() const { return m_deepPosition; } | 92 Position deepEquivalent() const { return m_deepPosition; } |
| 93 Position toParentAnchoredPosition() const { return deepEquivalent().parentAn
choredEquivalent(); } | 93 Position toParentAnchoredPosition() const { return deepEquivalent().parentAn
choredEquivalent(); } |
| 94 PositionWithAffinity toPositionWithAffinity() const { return PositionWithAff
inity(m_deepPosition, m_affinity); } | 94 PositionWithAffinity toPositionWithAffinity() const { return PositionWithAff
inity(m_deepPosition, m_affinity); } |
| 95 TextAffinity affinity() const { return m_affinity; } | 95 TextAffinity affinity() const { return m_affinity; } |
| 96 | 96 |
| 97 // next() and previous() will increment/decrement by a character cluster. | 97 // next() and previous() will increment/decrement by a character cluster. |
| 98 VisiblePosition honorEditingBoundaryAtOrBefore(const VisiblePosition&) const
; | 98 VisiblePosition honorEditingBoundaryAtOrBefore(const VisiblePosition&) const
; |
| 99 VisiblePosition honorEditingBoundaryAtOrAfter(const VisiblePosition&) const; | 99 VisiblePosition honorEditingBoundaryAtOrAfter(const VisiblePosition&) const; |
| 100 VisiblePosition skipToStartOfEditingBoundary(const VisiblePosition&) const; | |
| 101 VisiblePosition skipToEndOfEditingBoundary(const VisiblePosition&) const; | |
| 102 | 100 |
| 103 // TODO(yosin) This does not handle [table, 0] correctly. | 101 // TODO(yosin) This does not handle [table, 0] correctly. |
| 104 Element* rootEditableElement() const { return m_deepPosition.isNotNull() ? m
_deepPosition.anchorNode()->rootEditableElement() : 0; } | 102 Element* rootEditableElement() const { return m_deepPosition.isNotNull() ? m
_deepPosition.anchorNode()->rootEditableElement() : 0; } |
| 105 | 103 |
| 106 DECLARE_TRACE(); | 104 DECLARE_TRACE(); |
| 107 | 105 |
| 108 #ifndef NDEBUG | 106 #ifndef NDEBUG |
| 109 void debugPosition(const char* msg = "") const; | 107 void debugPosition(const char* msg = "") const; |
| 110 void formatForDebugger(char* buffer, unsigned length) const; | 108 void formatForDebugger(char* buffer, unsigned length) const; |
| 111 void showTreeForThis() const; | 109 void showTreeForThis() const; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 | 151 |
| 154 } // namespace blink | 152 } // namespace blink |
| 155 | 153 |
| 156 #ifndef NDEBUG | 154 #ifndef NDEBUG |
| 157 // Outside the WebCore namespace for ease of invocation from gdb. | 155 // Outside the WebCore namespace for ease of invocation from gdb. |
| 158 void showTree(const blink::VisiblePosition*); | 156 void showTree(const blink::VisiblePosition*); |
| 159 void showTree(const blink::VisiblePosition&); | 157 void showTree(const blink::VisiblePosition&); |
| 160 #endif | 158 #endif |
| 161 | 159 |
| 162 #endif // VisiblePosition_h | 160 #endif // VisiblePosition_h |
| OLD | NEW |