| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 bool isNotNull() const { return m_deepPosition.isNotNull(); } | 89 bool isNotNull() const { return m_deepPosition.isNotNull(); } |
| 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 next(EditingBoundaryCrossingRule = CanCrossEditingBoundary)
const; | 98 VisiblePosition next(EditingBoundaryCrossingRule = CanCrossEditingBoundary)
const; |
| 99 VisiblePosition previous(EditingBoundaryCrossingRule = CanCrossEditingBounda
ry) const; | |
| 100 VisiblePosition honorEditingBoundaryAtOrBefore(const VisiblePosition&) const
; | 99 VisiblePosition honorEditingBoundaryAtOrBefore(const VisiblePosition&) const
; |
| 101 VisiblePosition honorEditingBoundaryAtOrAfter(const VisiblePosition&) const; | 100 VisiblePosition honorEditingBoundaryAtOrAfter(const VisiblePosition&) const; |
| 102 VisiblePosition skipToStartOfEditingBoundary(const VisiblePosition&) const; | 101 VisiblePosition skipToStartOfEditingBoundary(const VisiblePosition&) const; |
| 103 VisiblePosition skipToEndOfEditingBoundary(const VisiblePosition&) const; | 102 VisiblePosition skipToEndOfEditingBoundary(const VisiblePosition&) const; |
| 104 | 103 |
| 105 VisiblePosition left() const; | 104 VisiblePosition left() const; |
| 106 VisiblePosition right() const; | 105 VisiblePosition right() const; |
| 107 | 106 |
| 108 UChar32 characterAfter() const; | 107 UChar32 characterAfter() const; |
| 109 UChar32 characterBefore() const { return previous().characterAfter(); } | 108 UChar32 characterBefore() const; |
| 110 | 109 |
| 111 // FIXME: This does not handle [table, 0] correctly. | 110 // FIXME: This does not handle [table, 0] correctly. |
| 112 Element* rootEditableElement() const { return m_deepPosition.isNotNull() ? m
_deepPosition.anchorNode()->rootEditableElement() : 0; } | 111 Element* rootEditableElement() const { return m_deepPosition.isNotNull() ? m
_deepPosition.anchorNode()->rootEditableElement() : 0; } |
| 113 | 112 |
| 114 // Rect is local to the returned layoutObject | 113 // Rect is local to the returned layoutObject |
| 115 LayoutRect localCaretRect(LayoutObject*&) const; | 114 LayoutRect localCaretRect(LayoutObject*&) const; |
| 116 // Bounds of (possibly transformed) caret in absolute coords | 115 // Bounds of (possibly transformed) caret in absolute coords |
| 117 IntRect absoluteCaretBounds() const; | 116 IntRect absoluteCaretBounds() const; |
| 118 // Abs x/y position of the caret ignoring transforms. | 117 // Abs x/y position of the caret ignoring transforms. |
| 119 // FIXME: navigation with transforms should be smarter. | 118 // FIXME: navigation with transforms should be smarter. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 138 TextAffinity m_affinity; | 137 TextAffinity m_affinity; |
| 139 }; | 138 }; |
| 140 | 139 |
| 141 EphemeralRange makeRange(const VisiblePosition&, const VisiblePosition&); | 140 EphemeralRange makeRange(const VisiblePosition&, const VisiblePosition&); |
| 142 | 141 |
| 143 CORE_EXPORT Position canonicalPositionOf(const Position&); | 142 CORE_EXPORT Position canonicalPositionOf(const Position&); |
| 144 CORE_EXPORT PositionInComposedTree canonicalPositionOf(const PositionInComposedT
ree&); | 143 CORE_EXPORT PositionInComposedTree canonicalPositionOf(const PositionInComposedT
ree&); |
| 145 PositionWithAffinity honorEditingBoundaryAtOrBeforeOf(const PositionWithAffinity
&, const Position& anchor); | 144 PositionWithAffinity honorEditingBoundaryAtOrBeforeOf(const PositionWithAffinity
&, const Position& anchor); |
| 146 PositionInComposedTreeWithAffinity honorEditingBoundaryAtOrBeforeOf(const Positi
onInComposedTreeWithAffinity&, const PositionInComposedTree& anchor); | 145 PositionInComposedTreeWithAffinity honorEditingBoundaryAtOrBeforeOf(const Positi
onInComposedTreeWithAffinity&, const PositionInComposedTree& anchor); |
| 147 | 146 |
| 147 // TODO(yosin) We should move |previousPositionOf()| to "VisibleUnits.cpp" |
| 148 VisiblePosition previousPositionOf(const VisiblePosition&, EditingBoundaryCrossi
ngRule = CanCrossEditingBoundary); |
| 149 |
| 148 } // namespace blink | 150 } // namespace blink |
| 149 | 151 |
| 150 #ifndef NDEBUG | 152 #ifndef NDEBUG |
| 151 // Outside the WebCore namespace for ease of invocation from gdb. | 153 // Outside the WebCore namespace for ease of invocation from gdb. |
| 152 void showTree(const blink::VisiblePosition*); | 154 void showTree(const blink::VisiblePosition*); |
| 153 void showTree(const blink::VisiblePosition&); | 155 void showTree(const blink::VisiblePosition&); |
| 154 #endif | 156 #endif |
| 155 | 157 |
| 156 #endif // VisiblePosition_h | 158 #endif // VisiblePosition_h |
| OLD | NEW |