| OLD | NEW |
| 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 19 matching lines...) Expand all Loading... |
| 30 #include "core/dom/Text.h" | 30 #include "core/dom/Text.h" |
| 31 #include "core/editing/EditingUtilities.h" | 31 #include "core/editing/EditingUtilities.h" |
| 32 #include "core/editing/Editor.h" | 32 #include "core/editing/Editor.h" |
| 33 #include "core/editing/VisibleUnits.h" | 33 #include "core/editing/VisibleUnits.h" |
| 34 #include "core/frame/LocalFrame.h" | 34 #include "core/frame/LocalFrame.h" |
| 35 #include "core/html/HTMLSpanElement.h" | 35 #include "core/html/HTMLSpanElement.h" |
| 36 | 36 |
| 37 namespace blink { | 37 namespace blink { |
| 38 | 38 |
| 39 InsertTextCommand::InsertTextCommand(Document& document, | 39 InsertTextCommand::InsertTextCommand(Document& document, |
| 40 CommandSource source, |
| 40 const String& text, | 41 const String& text, |
| 41 bool selectInsertedText, | 42 bool selectInsertedText, |
| 42 RebalanceType rebalanceType) | 43 RebalanceType rebalanceType) |
| 43 : CompositeEditCommand(document), | 44 : CompositeEditCommand(document, source), |
| 44 m_text(text), | 45 m_text(text), |
| 45 m_selectInsertedText(selectInsertedText), | 46 m_selectInsertedText(selectInsertedText), |
| 46 m_rebalanceType(rebalanceType) {} | 47 m_rebalanceType(rebalanceType) {} |
| 47 | 48 |
| 48 String InsertTextCommand::textDataForInputEvent() const { | 49 String InsertTextCommand::textDataForInputEvent() const { |
| 49 return m_text; | 50 return m_text; |
| 50 } | 51 } |
| 51 | 52 |
| 52 Position InsertTextCommand::positionInsideTextNode(const Position& p, | 53 Position InsertTextCommand::positionInsideTextNode(const Position& p, |
| 53 EditingState* editingState) { | 54 EditingState* editingState) { |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 } | 326 } |
| 326 } | 327 } |
| 327 if (editingState->isAborted()) | 328 if (editingState->isAborted()) |
| 328 return Position(); | 329 return Position(); |
| 329 | 330 |
| 330 // return the position following the new tab | 331 // return the position following the new tab |
| 331 return Position::lastPositionInNode(spanElement); | 332 return Position::lastPositionInNode(spanElement); |
| 332 } | 333 } |
| 333 | 334 |
| 334 } // namespace blink | 335 } // namespace blink |
| OLD | NEW |