OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 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 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 // Always clear the x position used for vertical arrow navigation. | 307 // Always clear the x position used for vertical arrow navigation. |
308 // It will be restored by the vertical arrow navigation code if necessary. | 308 // It will be restored by the vertical arrow navigation code if necessary. |
309 m_xPosForVerticalArrowNavigation = NoXPosForVerticalArrowNavigation(); | 309 m_xPosForVerticalArrowNavigation = NoXPosForVerticalArrowNavigation(); |
310 selectFrameElementInParentIfFullySelected(); | 310 selectFrameElementInParentIfFullySelected(); |
311 notifyLayoutObjectOfSelectionChange(userTriggered); | 311 notifyLayoutObjectOfSelectionChange(userTriggered); |
312 // If the selections are same in the DOM tree but not in the composed tree, | 312 // If the selections are same in the DOM tree but not in the composed tree, |
313 // don't fire events. For example, if the selection crosses shadow tree | 313 // don't fire events. For example, if the selection crosses shadow tree |
314 // boundary, selection for the DOM tree is shrunk while that for the | 314 // boundary, selection for the DOM tree is shrunk while that for the |
315 // composed tree is not. Additionally, this case occurs in some edge cases. | 315 // composed tree is not. Additionally, this case occurs in some edge cases. |
316 // See also: editing/pasteboard/4076267-3.html | 316 // See also: editing/pasteboard/4076267-3.html |
317 if (VisibleSelection::InDOMTree::equalSelections(oldSelection, m_selection)) | 317 if (VisibleSelection::InDOMTree::equalSelections(oldSelection, m_selection))
{ |
| 318 m_frame->inputMethodController().cancelCompositionIfSelectionIsInvalid()
; |
318 return; | 319 return; |
| 320 } |
319 m_frame->editor().respondToChangedSelection(oldSelection, options); | 321 m_frame->editor().respondToChangedSelection(oldSelection, options); |
320 if (userTriggered == UserTriggered) { | 322 if (userTriggered == UserTriggered) { |
321 ScrollAlignment alignment; | 323 ScrollAlignment alignment; |
322 | 324 |
323 if (m_frame->editor().behavior().shouldCenterAlignWhenSelectionIsReveale
d()) | 325 if (m_frame->editor().behavior().shouldCenterAlignWhenSelectionIsReveale
d()) |
324 alignment = (align == AlignCursorOnScrollAlways) ? ScrollAlignment::
alignCenterAlways : ScrollAlignment::alignCenterIfNeeded; | 326 alignment = (align == AlignCursorOnScrollAlways) ? ScrollAlignment::
alignCenterAlways : ScrollAlignment::alignCenterIfNeeded; |
325 else | 327 else |
326 alignment = (align == AlignCursorOnScrollAlways) ? ScrollAlignment::
alignTopAlways : ScrollAlignment::alignToEdgeIfNeeded; | 328 alignment = (align == AlignCursorOnScrollAlways) ? ScrollAlignment::
alignTopAlways : ScrollAlignment::alignToEdgeIfNeeded; |
327 | 329 |
328 revealSelection(alignment, RevealExtent); | 330 revealSelection(alignment, RevealExtent); |
(...skipping 1762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2091 | 2093 |
2092 void showTree(const blink::FrameSelection* sel) | 2094 void showTree(const blink::FrameSelection* sel) |
2093 { | 2095 { |
2094 if (sel) | 2096 if (sel) |
2095 sel->showTreeForThis(); | 2097 sel->showTreeForThis(); |
2096 else | 2098 else |
2097 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n"); | 2099 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n"); |
2098 } | 2100 } |
2099 | 2101 |
2100 #endif | 2102 #endif |
OLD | NEW |