OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights |
3 * reserved. | 3 * reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 const PositionInFlatTree& position2 = toPositionInFlatTree(selection.end()); | 168 const PositionInFlatTree& position2 = toPositionInFlatTree(selection.end()); |
169 position1.anchorNode()->updateDistribution(); | 169 position1.anchorNode()->updateDistribution(); |
170 position2.anchorNode()->updateDistribution(); | 170 position2.anchorNode()->updateDistribution(); |
171 selectionInFlatTree->m_base = base; | 171 selectionInFlatTree->m_base = base; |
172 selectionInFlatTree->m_extent = extent; | 172 selectionInFlatTree->m_extent = extent; |
173 selectionInFlatTree->m_affinity = selection.m_affinity; | 173 selectionInFlatTree->m_affinity = selection.m_affinity; |
174 selectionInFlatTree->m_isDirectional = selection.m_isDirectional; | 174 selectionInFlatTree->m_isDirectional = selection.m_isDirectional; |
175 selectionInFlatTree->m_granularity = selection.m_granularity; | 175 selectionInFlatTree->m_granularity = selection.m_granularity; |
176 selectionInFlatTree->m_hasTrailingWhitespace = | 176 selectionInFlatTree->m_hasTrailingWhitespace = |
177 selection.m_hasTrailingWhitespace; | 177 selection.m_hasTrailingWhitespace; |
| 178 selectionInFlatTree->m_isHandleVisible = selection.m_isHandleVisible; |
178 selectionInFlatTree->m_baseIsFirst = | 179 selectionInFlatTree->m_baseIsFirst = |
179 base.isNull() || base.compareTo(extent) <= 0; | 180 base.isNull() || base.compareTo(extent) <= 0; |
180 if (position1.compareTo(position2) <= 0) { | 181 if (position1.compareTo(position2) <= 0) { |
181 selectionInFlatTree->m_start = position1; | 182 selectionInFlatTree->m_start = position1; |
182 selectionInFlatTree->m_end = position2; | 183 selectionInFlatTree->m_end = position2; |
183 } else { | 184 } else { |
184 selectionInFlatTree->m_start = position2; | 185 selectionInFlatTree->m_start = position2; |
185 selectionInFlatTree->m_end = position1; | 186 selectionInFlatTree->m_end = position1; |
186 } | 187 } |
187 selectionInFlatTree->updateSelectionType(); | 188 selectionInFlatTree->updateSelectionType(); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 | 226 |
226 const Position& position1 = toPositionInDOMTree(selectionInFlatTree.start()); | 227 const Position& position1 = toPositionInDOMTree(selectionInFlatTree.start()); |
227 const Position& position2 = toPositionInDOMTree(selectionInFlatTree.end()); | 228 const Position& position2 = toPositionInDOMTree(selectionInFlatTree.end()); |
228 selection->m_base = base; | 229 selection->m_base = base; |
229 selection->m_extent = extent; | 230 selection->m_extent = extent; |
230 selection->m_affinity = selectionInFlatTree.m_affinity; | 231 selection->m_affinity = selectionInFlatTree.m_affinity; |
231 selection->m_isDirectional = selectionInFlatTree.m_isDirectional; | 232 selection->m_isDirectional = selectionInFlatTree.m_isDirectional; |
232 selection->m_granularity = selectionInFlatTree.m_granularity; | 233 selection->m_granularity = selectionInFlatTree.m_granularity; |
233 selection->m_hasTrailingWhitespace = | 234 selection->m_hasTrailingWhitespace = |
234 selectionInFlatTree.m_hasTrailingWhitespace; | 235 selectionInFlatTree.m_hasTrailingWhitespace; |
| 236 selection->m_isHandleVisible = selectionInFlatTree.m_isHandleVisible; |
235 selection->m_baseIsFirst = base.isNull() || base.compareTo(extent) <= 0; | 237 selection->m_baseIsFirst = base.isNull() || base.compareTo(extent) <= 0; |
236 if (position1.compareTo(position2) <= 0) { | 238 if (position1.compareTo(position2) <= 0) { |
237 selection->m_start = position1; | 239 selection->m_start = position1; |
238 selection->m_end = position2; | 240 selection->m_end = position2; |
239 } else { | 241 } else { |
240 selection->m_start = position2; | 242 selection->m_start = position2; |
241 selection->m_end = position1; | 243 selection->m_end = position1; |
242 } | 244 } |
243 selection->updateSelectionType(); | 245 selection->updateSelectionType(); |
244 } | 246 } |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 return; | 292 return; |
291 } | 293 } |
292 Node* const shadowHost = shadowHostEnd ? shadowHostEnd : shadowHostStart; | 294 Node* const shadowHost = shadowHostEnd ? shadowHostEnd : shadowHostStart; |
293 const PositionInFlatTree& newStart = | 295 const PositionInFlatTree& newStart = |
294 adjustPositionInFlatTreeForStart(selection->start(), shadowHost); | 296 adjustPositionInFlatTreeForStart(selection->start(), shadowHost); |
295 selection->m_extent = newStart; | 297 selection->m_extent = newStart; |
296 selection->m_start = newStart; | 298 selection->m_start = newStart; |
297 } | 299 } |
298 | 300 |
299 } // namespace blink | 301 } // namespace blink |
OLD | NEW |