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

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

Issue 2733183002: Make TypingCommand::insertText() to take SelectionInDOMTree instead of VisibleSelection (Closed)
Patch Set: 2017-03-07T14:18:09 Created 3 years, 9 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
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 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after
1019 1019
1020 const VisibleSelection& selection = selectionForCommand(triggeringEvent); 1020 const VisibleSelection& selection = selectionForCommand(triggeringEvent);
1021 if (!selection.isContentEditable()) 1021 if (!selection.isContentEditable())
1022 return false; 1022 return false;
1023 1023
1024 spellChecker().updateMarkersForWordsAffectedByEditing( 1024 spellChecker().updateMarkersForWordsAffectedByEditing(
1025 isSpaceOrNewline(text[0])); 1025 isSpaceOrNewline(text[0]));
1026 1026
1027 // Insert the text 1027 // Insert the text
1028 TypingCommand::insertText( 1028 TypingCommand::insertText(
1029 *selection.start().document(), text, selection, 1029 *selection.start().document(), text, selection.asSelection(),
1030 selectInsertedText ? TypingCommand::SelectInsertedText : 0, 1030 selectInsertedText ? TypingCommand::SelectInsertedText : 0,
1031 triggeringEvent && triggeringEvent->isComposition() 1031 triggeringEvent && triggeringEvent->isComposition()
1032 ? TypingCommand::TextCompositionConfirm 1032 ? TypingCommand::TextCompositionConfirm
1033 : TypingCommand::TextCompositionNone); 1033 : TypingCommand::TextCompositionNone);
1034 1034
1035 // Reveal the current selection 1035 // Reveal the current selection
1036 if (LocalFrame* editedFrame = selection.start().document()->frame()) { 1036 if (LocalFrame* editedFrame = selection.start().document()->frame()) {
1037 if (Page* page = editedFrame->page()) { 1037 if (Page* page = editedFrame->page()) {
1038 LocalFrame* focusedOrMainFrame = 1038 LocalFrame* focusedOrMainFrame =
1039 toLocalFrame(page->focusController().focusedOrMainFrame()); 1039 toLocalFrame(page->focusController().focusedOrMainFrame());
(...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after
1759 1759
1760 DEFINE_TRACE(Editor) { 1760 DEFINE_TRACE(Editor) {
1761 visitor->trace(m_frame); 1761 visitor->trace(m_frame);
1762 visitor->trace(m_lastEditCommand); 1762 visitor->trace(m_lastEditCommand);
1763 visitor->trace(m_undoStack); 1763 visitor->trace(m_undoStack);
1764 visitor->trace(m_mark); 1764 visitor->trace(m_mark);
1765 visitor->trace(m_typingStyle); 1765 visitor->trace(m_typingStyle);
1766 } 1766 }
1767 1767
1768 } // namespace blink 1768 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698