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

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

Issue 2530843003: Introduce InsertIncrementalTextCommand to respect existing style for composition (Closed)
Patch Set: Address xiaochengh@'s review Created 4 years 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
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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 return page->editorClient(); 200 return page->editorClient();
201 return emptyEditorClient(); 201 return emptyEditorClient();
202 } 202 }
203 203
204 bool Editor::handleTextEvent(TextEvent* event) { 204 bool Editor::handleTextEvent(TextEvent* event) {
205 // Default event handling for Drag and Drop will be handled by DragController 205 // Default event handling for Drag and Drop will be handled by DragController
206 // so we leave the event for it. 206 // so we leave the event for it.
207 if (event->isDrop()) 207 if (event->isDrop())
208 return false; 208 return false;
209 209
210 // Default event handling for IncrementalInsertion will be handled by
211 // TypingCommand::insertText(), so we leave the event for it.
212 if (event->isIncrementalInsertion())
213 return false;
214
210 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets 215 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
211 // needs to be audited. See http://crbug.com/590369 for more details. 216 // needs to be audited. See http://crbug.com/590369 for more details.
212 m_frame->document()->updateStyleAndLayoutIgnorePendingStylesheets(); 217 m_frame->document()->updateStyleAndLayoutIgnorePendingStylesheets();
213 218
214 if (event->isPaste()) { 219 if (event->isPaste()) {
215 if (event->pastingFragment()) { 220 if (event->pastingFragment()) {
216 replaceSelectionWithFragment( 221 replaceSelectionWithFragment(
217 event->pastingFragment(), false, event->shouldSmartReplace(), 222 event->pastingFragment(), false, event->shouldSmartReplace(),
218 event->shouldMatchStyle(), InputEvent::InputType::InsertFromPaste); 223 event->shouldMatchStyle(), InputEvent::InputType::InsertFromPaste);
219 } else { 224 } else {
(...skipping 1440 matching lines...) Expand 10 before | Expand all | Expand 10 after
1660 } 1665 }
1661 1666
1662 DEFINE_TRACE(Editor) { 1667 DEFINE_TRACE(Editor) {
1663 visitor->trace(m_frame); 1668 visitor->trace(m_frame);
1664 visitor->trace(m_lastEditCommand); 1669 visitor->trace(m_lastEditCommand);
1665 visitor->trace(m_undoStack); 1670 visitor->trace(m_undoStack);
1666 visitor->trace(m_mark); 1671 visitor->trace(m_mark);
1667 } 1672 }
1668 1673
1669 } // namespace blink 1674 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/BUILD.gn ('k') | third_party/WebKit/Source/core/editing/InputMethodController.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698