| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2004, 2005, 2006 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 builder.setBaseAndExtent(m_base, m_extent); | 131 builder.setBaseAndExtent(m_base, m_extent); |
| 132 return builder.setAffinity(m_affinity) | 132 return builder.setAffinity(m_affinity) |
| 133 .setGranularity(m_granularity) | 133 .setGranularity(m_granularity) |
| 134 .setIsDirectional(m_isDirectional) | 134 .setIsDirectional(m_isDirectional) |
| 135 .setHasTrailingWhitespace(m_hasTrailingWhitespace) | 135 .setHasTrailingWhitespace(m_hasTrailingWhitespace) |
| 136 .build(); | 136 .build(); |
| 137 } | 137 } |
| 138 | 138 |
| 139 template <typename Strategy> | 139 template <typename Strategy> |
| 140 void VisibleSelectionTemplate<Strategy>::setBase( | 140 void VisibleSelectionTemplate<Strategy>::setBase( |
| 141 const PositionTemplate<Strategy>& position) { | |
| 142 DCHECK(!needsLayoutTreeUpdate(position)); | |
| 143 m_base = position; | |
| 144 validate(); | |
| 145 } | |
| 146 | |
| 147 template <typename Strategy> | |
| 148 void VisibleSelectionTemplate<Strategy>::setBase( | |
| 149 const VisiblePositionTemplate<Strategy>& visiblePosition) { | 141 const VisiblePositionTemplate<Strategy>& visiblePosition) { |
| 150 DCHECK(visiblePosition.isValid()); | 142 DCHECK(visiblePosition.isValid()); |
| 151 m_base = visiblePosition.deepEquivalent(); | 143 m_base = visiblePosition.deepEquivalent(); |
| 152 validate(); | 144 validate(); |
| 153 } | 145 } |
| 154 | 146 |
| 155 template <typename Strategy> | 147 template <typename Strategy> |
| 156 void VisibleSelectionTemplate<Strategy>::setExtent( | 148 void VisibleSelectionTemplate<Strategy>::setExtent( |
| 157 const PositionTemplate<Strategy>& position) { | |
| 158 DCHECK(!needsLayoutTreeUpdate(position)); | |
| 159 m_extent = position; | |
| 160 validate(); | |
| 161 } | |
| 162 | |
| 163 template <typename Strategy> | |
| 164 void VisibleSelectionTemplate<Strategy>::setExtent( | |
| 165 const VisiblePositionTemplate<Strategy>& visiblePosition) { | 149 const VisiblePositionTemplate<Strategy>& visiblePosition) { |
| 166 DCHECK(visiblePosition.isValid()); | 150 DCHECK(visiblePosition.isValid()); |
| 167 m_extent = visiblePosition.deepEquivalent(); | 151 m_extent = visiblePosition.deepEquivalent(); |
| 168 validate(); | 152 validate(); |
| 169 } | 153 } |
| 170 | 154 |
| 171 EphemeralRange firstEphemeralRangeOf(const VisibleSelection& selection) { | 155 EphemeralRange firstEphemeralRangeOf(const VisibleSelection& selection) { |
| 172 if (selection.isNone()) | 156 if (selection.isNone()) |
| 173 return EphemeralRange(); | 157 return EphemeralRange(); |
| 174 Position start = selection.start().parentAnchoredEquivalent(); | 158 Position start = selection.start().parentAnchoredEquivalent(); |
| (...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 853 | 837 |
| 854 void showTree(const blink::VisibleSelectionInFlatTree& sel) { | 838 void showTree(const blink::VisibleSelectionInFlatTree& sel) { |
| 855 sel.showTreeForThis(); | 839 sel.showTreeForThis(); |
| 856 } | 840 } |
| 857 | 841 |
| 858 void showTree(const blink::VisibleSelectionInFlatTree* sel) { | 842 void showTree(const blink::VisibleSelectionInFlatTree* sel) { |
| 859 if (sel) | 843 if (sel) |
| 860 sel->showTreeForThis(); | 844 sel->showTreeForThis(); |
| 861 } | 845 } |
| 862 #endif | 846 #endif |
| OLD | NEW |