| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 void setExtent(const PositionTemplate<Strategy>&); | 73 void setExtent(const PositionTemplate<Strategy>&); |
| 74 void setExtent(const VisiblePositionTemplate<Strategy>&); | 74 void setExtent(const VisiblePositionTemplate<Strategy>&); |
| 75 | 75 |
| 76 PositionTemplate<Strategy> base() const { return m_base; } | 76 PositionTemplate<Strategy> base() const { return m_base; } |
| 77 PositionTemplate<Strategy> extent() const { return m_extent; } | 77 PositionTemplate<Strategy> extent() const { return m_extent; } |
| 78 PositionTemplate<Strategy> start() const { return m_start; } | 78 PositionTemplate<Strategy> start() const { return m_start; } |
| 79 PositionTemplate<Strategy> end() const { return m_end; } | 79 PositionTemplate<Strategy> end() const { return m_end; } |
| 80 | 80 |
| 81 VisiblePositionTemplate<Strategy> visibleStart() const { return createVisibl
ePositionDeprecated(m_start, isRange() ? TextAffinity::Downstream : affinity());
} | 81 VisiblePositionTemplate<Strategy> visibleStart() const { return createVisibl
ePositionDeprecated(m_start, isRange() ? TextAffinity::Downstream : affinity());
} |
| 82 VisiblePositionTemplate<Strategy> visibleEnd() const { return createVisibleP
ositionDeprecated(m_end, isRange() ? TextAffinity::Upstream : affinity()); } | 82 VisiblePositionTemplate<Strategy> visibleEnd() const { return createVisibleP
ositionDeprecated(m_end, isRange() ? TextAffinity::Upstream : affinity()); } |
| 83 VisiblePositionTemplate<Strategy> visibleBase() const { return createVisible
PositionDeprecated(m_base, isRange() ? (isBaseFirst() ? TextAffinity::Upstream :
TextAffinity::Downstream) : affinity()); } | 83 VisiblePositionTemplate<Strategy> visibleBase() const { return createVisible
Position(m_base, isRange() ? (isBaseFirst() ? TextAffinity::Upstream : TextAffin
ity::Downstream) : affinity()); } |
| 84 VisiblePositionTemplate<Strategy> visibleExtent() const { return createVisib
lePositionDeprecated(m_extent, isRange() ? (isBaseFirst() ? TextAffinity::Downst
ream : TextAffinity::Upstream) : affinity()); } | 84 VisiblePositionTemplate<Strategy> visibleExtent() const { return createVisib
lePosition(m_extent, isRange() ? (isBaseFirst() ? TextAffinity::Downstream : Tex
tAffinity::Upstream) : affinity()); } |
| 85 | 85 |
| 86 bool operator==(const VisibleSelectionTemplate&) const; | 86 bool operator==(const VisibleSelectionTemplate&) const; |
| 87 bool operator!=(const VisibleSelectionTemplate& other) const { return !opera
tor==(other); } | 87 bool operator!=(const VisibleSelectionTemplate& other) const { return !opera
tor==(other); } |
| 88 | 88 |
| 89 bool isNone() const { return getSelectionType() == NoSelection; } | 89 bool isNone() const { return getSelectionType() == NoSelection; } |
| 90 bool isCaret() const { return getSelectionType() == CaretSelection; } | 90 bool isCaret() const { return getSelectionType() == CaretSelection; } |
| 91 bool isRange() const { return getSelectionType() == RangeSelection; } | 91 bool isRange() const { return getSelectionType() == RangeSelection; } |
| 92 bool isNonOrphanedRange() const { return isRange() && !start().isOrphan() &&
!end().isOrphan(); } | 92 bool isNonOrphanedRange() const { return isRange() && !start().isOrphan() &&
!end().isOrphan(); } |
| 93 bool isNonOrphanedCaretOrRange() const { return !isNone() && !start().isOrph
an() && !end().isOrphan(); } | 93 bool isNonOrphanedCaretOrRange() const { return !isNone() && !start().isOrph
an() && !end().isOrphan(); } |
| 94 | 94 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 | 192 |
| 193 #ifndef NDEBUG | 193 #ifndef NDEBUG |
| 194 // Outside the WebCore namespace for ease of invocation from gdb. | 194 // Outside the WebCore namespace for ease of invocation from gdb. |
| 195 void showTree(const blink::VisibleSelection&); | 195 void showTree(const blink::VisibleSelection&); |
| 196 void showTree(const blink::VisibleSelection*); | 196 void showTree(const blink::VisibleSelection*); |
| 197 void showTree(const blink::VisibleSelectionInFlatTree&); | 197 void showTree(const blink::VisibleSelectionInFlatTree&); |
| 198 void showTree(const blink::VisibleSelectionInFlatTree*); | 198 void showTree(const blink::VisibleSelectionInFlatTree*); |
| 199 #endif | 199 #endif |
| 200 | 200 |
| 201 #endif // VisibleSelection_h | 201 #endif // VisibleSelection_h |
| OLD | NEW |