Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(266)

Side by Side Diff: third_party/WebKit/Source/core/editing/Editor.cpp

Issue 2626933002: Make Editor::appliedEditing update layout before changing selection (Closed)
Patch Set: Rebased Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/editing/pasteboard/copy-paste-underlined.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/editing/pasteboard/copy-paste-underlined.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698