| 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 881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 892 void Editor::reappliedEditing(EditCommandComposition* cmd) { | 892 void Editor::reappliedEditing(EditCommandComposition* cmd) { |
| 893 EventQueueScope scope; | 893 EventQueueScope scope; |
| 894 | 894 |
| 895 dispatchEditableContentChangedEvents(cmd->startingRootEditableElement(), | 895 dispatchEditableContentChangedEvents(cmd->startingRootEditableElement(), |
| 896 cmd->endingRootEditableElement()); | 896 cmd->endingRootEditableElement()); |
| 897 dispatchInputEventEditableContentChanged( | 897 dispatchInputEventEditableContentChanged( |
| 898 cmd->startingRootEditableElement(), cmd->endingRootEditableElement(), | 898 cmd->startingRootEditableElement(), cmd->endingRootEditableElement(), |
| 899 InputEvent::InputType::HistoryRedo, nullAtom, | 899 InputEvent::InputType::HistoryRedo, nullAtom, |
| 900 InputEvent::EventIsComposing::NotComposing); | 900 InputEvent::EventIsComposing::NotComposing); |
| 901 | 901 |
| 902 // TODO(yosin): Since |dispatchEditableContentChangedEvents()| and | 902 // TODO(editing-dev): The use of updateStyleAndLayoutIgnorePendingStylesheets |
| 903 // |dispatchInputEventEditableContentChanged()|, we would like to know | 903 // needs to be audited. See http://crbug.com/590369 for more details. |
| 904 // such case. Once we have a case, this |DCHECK()| should be replaced | 904 // In the long term, we should stop editing commands from storing |
| 905 // with if-statement. | 905 // VisibleSelections as starting and ending selections. |
| 906 DCHECK(frame().document()); | 906 frame().document()->updateStyleAndLayoutIgnorePendingStylesheets(); |
| 907 VisibleSelection newSelection(cmd->endingSelection()); | 907 const VisibleSelection& newSelection = |
| 908 if (newSelection.isValidFor(*frame().document())) | 908 correctedVisibleSelection(cmd->endingSelection()); |
| 909 DCHECK(newSelection.isValidFor(*frame().document())) << newSelection; |
| 910 if (!newSelection.isNone()) { |
| 909 changeSelectionAfterCommand( | 911 changeSelectionAfterCommand( |
| 910 newSelection, | 912 newSelection, |
| 911 FrameSelection::CloseTyping | FrameSelection::ClearTypingStyle); | 913 FrameSelection::CloseTyping | FrameSelection::ClearTypingStyle); |
| 914 } |
| 912 | 915 |
| 913 m_lastEditCommand = nullptr; | 916 m_lastEditCommand = nullptr; |
| 914 m_undoStack->registerUndoStep(cmd); | 917 m_undoStack->registerUndoStep(cmd); |
| 915 respondToChangedContents(newSelection); | 918 respondToChangedContents(newSelection); |
| 916 } | 919 } |
| 917 | 920 |
| 918 Editor* Editor::create(LocalFrame& frame) { | 921 Editor* Editor::create(LocalFrame& frame) { |
| 919 return new Editor(frame); | 922 return new Editor(frame); |
| 920 } | 923 } |
| 921 | 924 |
| (...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1657 } | 1660 } |
| 1658 | 1661 |
| 1659 DEFINE_TRACE(Editor) { | 1662 DEFINE_TRACE(Editor) { |
| 1660 visitor->trace(m_frame); | 1663 visitor->trace(m_frame); |
| 1661 visitor->trace(m_lastEditCommand); | 1664 visitor->trace(m_lastEditCommand); |
| 1662 visitor->trace(m_undoStack); | 1665 visitor->trace(m_undoStack); |
| 1663 visitor->trace(m_mark); | 1666 visitor->trace(m_mark); |
| 1664 } | 1667 } |
| 1665 | 1668 |
| 1666 } // namespace blink | 1669 } // namespace blink |
| OLD | NEW |