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 840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
851 EditCommandComposition* composition = cmd->composition(); | 851 EditCommandComposition* composition = cmd->composition(); |
852 DCHECK(composition); | 852 DCHECK(composition); |
853 dispatchEditableContentChangedEvents( | 853 dispatchEditableContentChangedEvents( |
854 composition->startingRootEditableElement(), | 854 composition->startingRootEditableElement(), |
855 composition->endingRootEditableElement()); | 855 composition->endingRootEditableElement()); |
856 // TODO(chongz): Filter empty InputType after spec is finalized. | 856 // TODO(chongz): Filter empty InputType after spec is finalized. |
857 dispatchInputEventEditableContentChanged( | 857 dispatchInputEventEditableContentChanged( |
858 composition->startingRootEditableElement(), | 858 composition->startingRootEditableElement(), |
859 composition->endingRootEditableElement(), cmd->inputType(), | 859 composition->endingRootEditableElement(), cmd->inputType(), |
860 cmd->textDataForInputEvent(), isComposingFromCommand(cmd)); | 860 cmd->textDataForInputEvent(), isComposingFromCommand(cmd)); |
| 861 |
| 862 // TODO(editing-dev): The use of updateStyleAndLayoutIgnorePendingStylesheets |
| 863 // needs to be audited. See http://crbug.com/590369 for more details. |
| 864 // The clean layout is consumed by |mostBackwardCaretPosition|, called through |
| 865 // |changeSelectionAfterCommand|. In the long term, we should postpone visible |
| 866 // selection canonicalization so that selection update does not need layout. |
| 867 frame().document()->updateStyleAndLayoutIgnorePendingStylesheets(); |
| 868 |
861 VisibleSelection newSelection(cmd->endingSelection()); | 869 VisibleSelection newSelection(cmd->endingSelection()); |
862 | 870 |
863 // Don't clear the typing style with this selection change. We do those things | 871 // Don't clear the typing style with this selection change. We do those things |
864 // elsewhere if necessary. | 872 // elsewhere if necessary. |
865 changeSelectionAfterCommand(newSelection, 0); | 873 changeSelectionAfterCommand(newSelection, 0); |
866 | 874 |
867 if (!cmd->preservesTypingStyle()) | 875 if (!cmd->preservesTypingStyle()) |
868 frame().selection().clearTypingStyle(); | 876 frame().selection().clearTypingStyle(); |
869 | 877 |
870 // Command will be equal to last edit command only in the case of typing | 878 // Command will be equal to last edit command only in the case of typing |
(...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1728 } | 1736 } |
1729 | 1737 |
1730 DEFINE_TRACE(Editor) { | 1738 DEFINE_TRACE(Editor) { |
1731 visitor->trace(m_frame); | 1739 visitor->trace(m_frame); |
1732 visitor->trace(m_lastEditCommand); | 1740 visitor->trace(m_lastEditCommand); |
1733 visitor->trace(m_undoStack); | 1741 visitor->trace(m_undoStack); |
1734 visitor->trace(m_mark); | 1742 visitor->trace(m_mark); |
1735 } | 1743 } |
1736 | 1744 |
1737 } // namespace blink | 1745 } // namespace blink |
OLD | NEW |