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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 | 86 |
87 bool isNull() const { return m_deepPosition.isNull(); } | 87 bool isNull() const { return m_deepPosition.isNull(); } |
88 bool isNotNull() const { return m_deepPosition.isNotNull(); } | 88 bool isNotNull() const { return m_deepPosition.isNotNull(); } |
89 bool isOrphan() const { return m_deepPosition.isOrphan(); } | 89 bool isOrphan() const { return m_deepPosition.isOrphan(); } |
90 | 90 |
91 Position deepEquivalent() const { return m_deepPosition; } | 91 Position deepEquivalent() const { return m_deepPosition; } |
92 Position toParentAnchoredPosition() const { return deepEquivalent().parentAn
choredEquivalent(); } | 92 Position toParentAnchoredPosition() const { return deepEquivalent().parentAn
choredEquivalent(); } |
93 PositionWithAffinity toPositionWithAffinity() const { return PositionWithAff
inity(m_deepPosition, m_affinity); } | 93 PositionWithAffinity toPositionWithAffinity() const { return PositionWithAff
inity(m_deepPosition, m_affinity); } |
94 TextAffinity affinity() const { return m_affinity; } | 94 TextAffinity affinity() const { return m_affinity; } |
95 | 95 |
96 // TODO(yosin) This does not handle [table, 0] correctly. | |
97 Element* rootEditableElement() const { return m_deepPosition.isNotNull() ? m
_deepPosition.anchorNode()->rootEditableElement() : 0; } | |
98 | |
99 DECLARE_TRACE(); | 96 DECLARE_TRACE(); |
100 | 97 |
101 #ifndef NDEBUG | 98 #ifndef NDEBUG |
102 void debugPosition(const char* msg = "") const; | 99 void debugPosition(const char* msg = "") const; |
103 void formatForDebugger(char* buffer, unsigned length) const; | 100 void formatForDebugger(char* buffer, unsigned length) const; |
104 void showTreeForThis() const; | 101 void showTreeForThis() const; |
105 #endif | 102 #endif |
106 | 103 |
107 private: | 104 private: |
108 template<typename Strategy> | 105 template<typename Strategy> |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 | 147 |
151 } // namespace blink | 148 } // namespace blink |
152 | 149 |
153 #ifndef NDEBUG | 150 #ifndef NDEBUG |
154 // Outside the WebCore namespace for ease of invocation from gdb. | 151 // Outside the WebCore namespace for ease of invocation from gdb. |
155 void showTree(const blink::VisiblePosition*); | 152 void showTree(const blink::VisiblePosition*); |
156 void showTree(const blink::VisiblePosition&); | 153 void showTree(const blink::VisiblePosition&); |
157 #endif | 154 #endif |
158 | 155 |
159 #endif // VisiblePosition_h | 156 #endif // VisiblePosition_h |
OLD | NEW |