| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
| 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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 ScrollAlignment::kAlignToEdgeIfNeeded, kRevealExtent); | 179 ScrollAlignment::kAlignToEdgeIfNeeded, kRevealExtent); |
| 180 } | 180 } |
| 181 } | 181 } |
| 182 | 182 |
| 183 // When an event handler has moved the selection outside of a text control | 183 // When an event handler has moved the selection outside of a text control |
| 184 // we should use the target control's selection for this editing operation. | 184 // we should use the target control's selection for this editing operation. |
| 185 // TODO(yosin): We should make |Editor::selectionForCommand()| to return | 185 // TODO(yosin): We should make |Editor::selectionForCommand()| to return |
| 186 // |SelectionInDOMTree| instead of |VisibleSelection|. | 186 // |SelectionInDOMTree| instead of |VisibleSelection|. |
| 187 VisibleSelection Editor::SelectionForCommand(Event* event) { | 187 VisibleSelection Editor::SelectionForCommand(Event* event) { |
| 188 VisibleSelection selection = | 188 VisibleSelection selection = |
| 189 GetFrame().Selection().ComputeVisibleSelectionInDOMTreeDeprecated(); | 189 GetFrame().Selection().ComputeVisibleSelectionInDOMTree(); |
| 190 if (!event) | 190 if (!event) |
| 191 return selection; | 191 return selection; |
| 192 // If the target is a text control, and the current selection is outside of | 192 // If the target is a text control, and the current selection is outside of |
| 193 // its shadow tree, then use the saved selection for that text control. | 193 // its shadow tree, then use the saved selection for that text control. |
| 194 TextControlElement* text_control_of_selection_start = | 194 TextControlElement* text_control_of_selection_start = |
| 195 EnclosingTextControl(selection.Start()); | 195 EnclosingTextControl(selection.Start()); |
| 196 TextControlElement* text_control_of_target = | 196 TextControlElement* text_control_of_target = |
| 197 IsTextControlElement(*event->target()->ToNode()) | 197 IsTextControlElement(*event->target()->ToNode()) |
| 198 ? ToTextControlElement(event->target()->ToNode()) | 198 ? ToTextControlElement(event->target()->ToNode()) |
| 199 : nullptr; | 199 : nullptr; |
| (...skipping 1619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1819 | 1819 |
| 1820 DEFINE_TRACE(Editor) { | 1820 DEFINE_TRACE(Editor) { |
| 1821 visitor->Trace(frame_); | 1821 visitor->Trace(frame_); |
| 1822 visitor->Trace(last_edit_command_); | 1822 visitor->Trace(last_edit_command_); |
| 1823 visitor->Trace(undo_stack_); | 1823 visitor->Trace(undo_stack_); |
| 1824 visitor->Trace(mark_); | 1824 visitor->Trace(mark_); |
| 1825 visitor->Trace(typing_style_); | 1825 visitor->Trace(typing_style_); |
| 1826 } | 1826 } |
| 1827 | 1827 |
| 1828 } // namespace blink | 1828 } // namespace blink |
| OLD | NEW |