| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2004 Apple Computer, 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 | 123 |
| 124 Position base() const { return m_base; } | 124 Position base() const { return m_base; } |
| 125 Position extent() const { return m_extent; } | 125 Position extent() const { return m_extent; } |
| 126 Position start() const { return m_start; } | 126 Position start() const { return m_start; } |
| 127 Position end() const { return m_end; } | 127 Position end() const { return m_end; } |
| 128 PositionInComposedTree baseInComposedTree() const; | 128 PositionInComposedTree baseInComposedTree() const; |
| 129 PositionInComposedTree extentInComposedTree() const; | 129 PositionInComposedTree extentInComposedTree() const; |
| 130 PositionInComposedTree startInComposedTree() const; | 130 PositionInComposedTree startInComposedTree() const; |
| 131 PositionInComposedTree endInComposedTree() const; | 131 PositionInComposedTree endInComposedTree() const; |
| 132 | 132 |
| 133 VisiblePosition visibleStart() const { return VisiblePosition(m_start, isRan
ge() ? TextAffinity::Downstream : affinity()); } | 133 VisiblePosition visibleStart() const { return createVisiblePosition(m_start,
isRange() ? TextAffinity::Downstream : affinity()); } |
| 134 VisiblePosition visibleEnd() const { return VisiblePosition(m_end, isRange()
? TextAffinity::Upstream : affinity()); } | 134 VisiblePosition visibleEnd() const { return createVisiblePosition(m_end, isR
ange() ? TextAffinity::Upstream : affinity()); } |
| 135 VisiblePosition visibleBase() const { return VisiblePosition(m_base, isRange
() ? (isBaseFirst() ? TextAffinity::Upstream : TextAffinity::Downstream) : affin
ity()); } | 135 VisiblePosition visibleBase() const { return createVisiblePosition(m_base, i
sRange() ? (isBaseFirst() ? TextAffinity::Upstream : TextAffinity::Downstream) :
affinity()); } |
| 136 VisiblePosition visibleExtent() const { return VisiblePosition(m_extent, isR
ange() ? (isBaseFirst() ? TextAffinity::Downstream : TextAffinity::Upstream) : a
ffinity()); } | 136 VisiblePosition visibleExtent() const { return createVisiblePosition(m_exten
t, isRange() ? (isBaseFirst() ? TextAffinity::Downstream : TextAffinity::Upstrea
m) : affinity()); } |
| 137 | 137 |
| 138 bool isNone() const { return selectionType() == NoSelection; } | 138 bool isNone() const { return selectionType() == NoSelection; } |
| 139 bool isCaret() const { return selectionType() == CaretSelection; } | 139 bool isCaret() const { return selectionType() == CaretSelection; } |
| 140 bool isRange() const { return selectionType() == RangeSelection; } | 140 bool isRange() const { return selectionType() == RangeSelection; } |
| 141 bool isCaretOrRange() const { return selectionType() != NoSelection; } | 141 bool isCaretOrRange() const { return selectionType() != NoSelection; } |
| 142 bool isNonOrphanedRange() const { return isRange() && !start().isOrphan() &&
!end().isOrphan(); } | 142 bool isNonOrphanedRange() const { return isRange() && !start().isOrphan() &&
!end().isOrphan(); } |
| 143 bool isNonOrphanedCaretOrRange() const { return isCaretOrRange() && !start()
.isOrphan() && !end().isOrphan(); } | 143 bool isNonOrphanedCaretOrRange() const { return isCaretOrRange() && !start()
.isOrphan() && !end().isOrphan(); } |
| 144 static SelectionType selectionType(const Position& start, const Position& en
d); | 144 static SelectionType selectionType(const Position& start, const Position& en
d); |
| 145 static SelectionType selectionType(const PositionInComposedTree& start, cons
t PositionInComposedTree& end); | 145 static SelectionType selectionType(const PositionInComposedTree& start, cons
t PositionInComposedTree& end); |
| 146 | 146 |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 | 256 |
| 257 } // namespace blink | 257 } // namespace blink |
| 258 | 258 |
| 259 #ifndef NDEBUG | 259 #ifndef NDEBUG |
| 260 // Outside the WebCore namespace for ease of invocation from gdb. | 260 // Outside the WebCore namespace for ease of invocation from gdb. |
| 261 void showTree(const blink::VisibleSelection&); | 261 void showTree(const blink::VisibleSelection&); |
| 262 void showTree(const blink::VisibleSelection*); | 262 void showTree(const blink::VisibleSelection*); |
| 263 #endif | 263 #endif |
| 264 | 264 |
| 265 #endif // VisibleSelection_h | 265 #endif // VisibleSelection_h |
| OLD | NEW |