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 908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
919 | 919 |
920 respondToChangedContents(newSelection); | 920 respondToChangedContents(newSelection); |
921 } | 921 } |
922 | 922 |
923 static VisibleSelection correctedVisibleSelection( | 923 static VisibleSelection correctedVisibleSelection( |
924 const VisibleSelection& passedSelection) { | 924 const VisibleSelection& passedSelection) { |
925 if (!passedSelection.base().isConnected() || | 925 if (!passedSelection.base().isConnected() || |
926 !passedSelection.extent().isConnected()) | 926 !passedSelection.extent().isConnected()) |
927 return VisibleSelection(); | 927 return VisibleSelection(); |
928 DCHECK(!passedSelection.base().document()->needsLayoutTreeUpdate()); | 928 DCHECK(!passedSelection.base().document()->needsLayoutTreeUpdate()); |
929 VisibleSelection correctedSelection = passedSelection; | 929 return createVisibleSelection(passedSelection.asSelection()); |
930 correctedSelection.updateIfNeeded(); | |
931 return correctedSelection; | |
932 } | 930 } |
933 | 931 |
934 void Editor::unappliedEditing(UndoStep* cmd) { | 932 void Editor::unappliedEditing(UndoStep* cmd) { |
935 EventQueueScope scope; | 933 EventQueueScope scope; |
936 | 934 |
937 dispatchEditableContentChangedEvents(cmd->startingRootEditableElement(), | 935 dispatchEditableContentChangedEvents(cmd->startingRootEditableElement(), |
938 cmd->endingRootEditableElement()); | 936 cmd->endingRootEditableElement()); |
939 dispatchInputEventEditableContentChanged( | 937 dispatchInputEventEditableContentChanged( |
940 cmd->startingRootEditableElement(), cmd->endingRootEditableElement(), | 938 cmd->startingRootEditableElement(), cmd->endingRootEditableElement(), |
941 InputEvent::InputType::HistoryUndo, nullAtom, | 939 InputEvent::InputType::HistoryUndo, nullAtom, |
(...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1766 | 1764 |
1767 DEFINE_TRACE(Editor) { | 1765 DEFINE_TRACE(Editor) { |
1768 visitor->trace(m_frame); | 1766 visitor->trace(m_frame); |
1769 visitor->trace(m_lastEditCommand); | 1767 visitor->trace(m_lastEditCommand); |
1770 visitor->trace(m_undoStack); | 1768 visitor->trace(m_undoStack); |
1771 visitor->trace(m_mark); | 1769 visitor->trace(m_mark); |
1772 visitor->trace(m_typingStyle); | 1770 visitor->trace(m_typingStyle); |
1773 } | 1771 } |
1774 | 1772 |
1775 } // namespace blink | 1773 } // namespace blink |
OLD | NEW |