OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 const PositionInFlatTree& position1 = toPositionInFlatTree(selection.start()
); | 164 const PositionInFlatTree& position1 = toPositionInFlatTree(selection.start()
); |
165 const PositionInFlatTree& position2 = toPositionInFlatTree(selection.end()); | 165 const PositionInFlatTree& position2 = toPositionInFlatTree(selection.end()); |
166 position1.anchorNode()->updateDistribution(); | 166 position1.anchorNode()->updateDistribution(); |
167 position2.anchorNode()->updateDistribution(); | 167 position2.anchorNode()->updateDistribution(); |
168 selectionInFlatTree->m_base = base; | 168 selectionInFlatTree->m_base = base; |
169 selectionInFlatTree->m_extent = extent; | 169 selectionInFlatTree->m_extent = extent; |
170 selectionInFlatTree->m_affinity = selection.m_affinity; | 170 selectionInFlatTree->m_affinity = selection.m_affinity; |
171 selectionInFlatTree->m_isDirectional = selection.m_isDirectional; | 171 selectionInFlatTree->m_isDirectional = selection.m_isDirectional; |
172 selectionInFlatTree->m_granularity = selection.m_granularity; | 172 selectionInFlatTree->m_granularity = selection.m_granularity; |
173 selectionInFlatTree->m_hasTrailingWhitespace = selection.m_hasTrailingWhites
pace; | 173 selectionInFlatTree->m_hasTrailingWhitespace = selection.m_hasTrailingWhites
pace; |
| 174 selectionInFlatTree->m_isHandleVisible = selection.m_isHandleVisible; |
174 selectionInFlatTree->m_baseIsFirst = base.isNull() || base.compareTo(extent)
<= 0; | 175 selectionInFlatTree->m_baseIsFirst = base.isNull() || base.compareTo(extent)
<= 0; |
175 if (position1.compareTo(position2) <= 0) { | 176 if (position1.compareTo(position2) <= 0) { |
176 selectionInFlatTree->m_start = position1; | 177 selectionInFlatTree->m_start = position1; |
177 selectionInFlatTree->m_end = position2; | 178 selectionInFlatTree->m_end = position2; |
178 } else { | 179 } else { |
179 selectionInFlatTree->m_start = position2; | 180 selectionInFlatTree->m_start = position2; |
180 selectionInFlatTree->m_end = position1; | 181 selectionInFlatTree->m_end = position1; |
181 } | 182 } |
182 selectionInFlatTree->updateSelectionType(); | 183 selectionInFlatTree->updateSelectionType(); |
183 } | 184 } |
(...skipping 24 matching lines...) Expand all Loading... |
208 } | 209 } |
209 | 210 |
210 const Position& position1 = toPositionInDOMTree(selectionInFlatTree.start())
; | 211 const Position& position1 = toPositionInDOMTree(selectionInFlatTree.start())
; |
211 const Position& position2 = toPositionInDOMTree(selectionInFlatTree.end()); | 212 const Position& position2 = toPositionInDOMTree(selectionInFlatTree.end()); |
212 selection->m_base = base; | 213 selection->m_base = base; |
213 selection->m_extent = extent; | 214 selection->m_extent = extent; |
214 selection->m_affinity = selectionInFlatTree.m_affinity; | 215 selection->m_affinity = selectionInFlatTree.m_affinity; |
215 selection->m_isDirectional = selectionInFlatTree.m_isDirectional; | 216 selection->m_isDirectional = selectionInFlatTree.m_isDirectional; |
216 selection->m_granularity = selectionInFlatTree.m_granularity; | 217 selection->m_granularity = selectionInFlatTree.m_granularity; |
217 selection->m_hasTrailingWhitespace = selectionInFlatTree.m_hasTrailingWhites
pace; | 218 selection->m_hasTrailingWhitespace = selectionInFlatTree.m_hasTrailingWhites
pace; |
| 219 selection->m_isHandleVisible = selectionInFlatTree.m_isHandleVisible; |
218 selection->m_baseIsFirst = base.isNull() || base.compareTo(extent) <= 0; | 220 selection->m_baseIsFirst = base.isNull() || base.compareTo(extent) <= 0; |
219 if (position1.compareTo(position2) <= 0) { | 221 if (position1.compareTo(position2) <= 0) { |
220 selection->m_start = position1; | 222 selection->m_start = position1; |
221 selection->m_end = position2; | 223 selection->m_end = position2; |
222 } else { | 224 } else { |
223 selection->m_start = position2; | 225 selection->m_start = position2; |
224 selection->m_end = position1; | 226 selection->m_end = position1; |
225 } | 227 } |
226 selection->updateSelectionType(); | 228 selection->updateSelectionType(); |
227 } | 229 } |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 selection->m_end = newEnd; | 270 selection->m_end = newEnd; |
269 return; | 271 return; |
270 } | 272 } |
271 Node* const shadowHost = shadowHostEnd ? shadowHostEnd : shadowHostStart; | 273 Node* const shadowHost = shadowHostEnd ? shadowHostEnd : shadowHostStart; |
272 const PositionInFlatTree& newStart = adjustPositionInFlatTreeForStart(select
ion->start(), shadowHost); | 274 const PositionInFlatTree& newStart = adjustPositionInFlatTreeForStart(select
ion->start(), shadowHost); |
273 selection->m_extent = newStart; | 275 selection->m_extent = newStart; |
274 selection->m_start = newStart; | 276 selection->m_start = newStart; |
275 } | 277 } |
276 | 278 |
277 } // namespace blink | 279 } // namespace blink |
OLD | NEW |