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

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

Issue 2117543003: [InputEvent] Fill |data| field for 'input' event InsertText (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed |dataFromCommand()| helper function Created 4 years, 5 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) 2005 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2005 Apple Computer, Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 26 matching lines...) Expand all
37 namespace blink { 37 namespace blink {
38 38
39 InsertTextCommand::InsertTextCommand(Document& document, const String& text, boo l selectInsertedText, RebalanceType rebalanceType) 39 InsertTextCommand::InsertTextCommand(Document& document, const String& text, boo l selectInsertedText, RebalanceType rebalanceType)
40 : CompositeEditCommand(document) 40 : CompositeEditCommand(document)
41 , m_text(text) 41 , m_text(text)
42 , m_selectInsertedText(selectInsertedText) 42 , m_selectInsertedText(selectInsertedText)
43 , m_rebalanceType(rebalanceType) 43 , m_rebalanceType(rebalanceType)
44 { 44 {
45 } 45 }
46 46
47 String InsertTextCommand::textDataForInputEvent() const
48 {
49 return m_text;
50 }
51
47 Position InsertTextCommand::positionInsideTextNode(const Position& p, EditingSta te* editingState) 52 Position InsertTextCommand::positionInsideTextNode(const Position& p, EditingSta te* editingState)
48 { 53 {
49 Position pos = p; 54 Position pos = p;
50 if (isTabHTMLSpanElementTextNode(pos.anchorNode())) { 55 if (isTabHTMLSpanElementTextNode(pos.anchorNode())) {
51 Text* textNode = document().createEditingTextNode(""); 56 Text* textNode = document().createEditingTextNode("");
52 insertNodeAtTabSpanPosition(textNode, pos, editingState); 57 insertNodeAtTabSpanPosition(textNode, pos, editingState);
53 if (editingState->isAborted()) 58 if (editingState->isAborted())
54 return Position(); 59 return Position();
55 return Position::firstPositionInNode(textNode); 60 return Position::firstPositionInNode(textNode);
56 } 61 }
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 } 285 }
281 } 286 }
282 if (editingState->isAborted()) 287 if (editingState->isAborted())
283 return Position(); 288 return Position();
284 289
285 // return the position following the new tab 290 // return the position following the new tab
286 return Position::lastPositionInNode(spanElement); 291 return Position::lastPositionInNode(spanElement);
287 } 292 }
288 293
289 } // namespace blink 294 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698