| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2012 Apple 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 22 matching lines...) Expand all Loading... |
| 33 namespace blink { | 33 namespace blink { |
| 34 | 34 |
| 35 class Document; | 35 class Document; |
| 36 | 36 |
| 37 class TextInsertionBaseCommand : public CompositeEditCommand { | 37 class TextInsertionBaseCommand : public CompositeEditCommand { |
| 38 public: | 38 public: |
| 39 ~TextInsertionBaseCommand() override { } | 39 ~TextInsertionBaseCommand() override { } |
| 40 | 40 |
| 41 protected: | 41 protected: |
| 42 explicit TextInsertionBaseCommand(Document&); | 42 explicit TextInsertionBaseCommand(Document&); |
| 43 static void applyTextInsertionCommand(LocalFrame*, PassRefPtrWillBeRawPtr<Te
xtInsertionBaseCommand>, const VisibleSelection& selectionForInsertion, const Vi
sibleSelection& endingSelection); | |
| 44 }; | 43 }; |
| 45 | 44 |
| 46 String dispatchBeforeTextInsertedEvent(const String& text, const VisibleSelectio
n& selectionForInsertion, bool insertionIsForUpdatingComposition); | 45 String dispatchBeforeTextInsertedEvent(const String& text, const VisibleSelectio
n& selectionForInsertion, bool insertionIsForUpdatingComposition); |
| 47 bool canAppendNewLineFeedToSelection(const VisibleSelection&); | 46 bool canAppendNewLineFeedToSelection(const VisibleSelection&); |
| 48 | 47 |
| 49 // LineOperation should define member function "opeartor (size_t lineOffset, siz
e_t lineLength, bool isLastLine)". | 48 // LineOperation should define member function "opeartor (size_t lineOffset, siz
e_t lineLength, bool isLastLine)". |
| 50 // lienLength doesn't include the newline character. So the value of lineLength
could be 0. | 49 // lienLength doesn't include the newline character. So the value of lineLength
could be 0. |
| 51 template <class LineOperation> | 50 template <class LineOperation> |
| 52 void forEachLineInString(const String& string, const LineOperation& operation, E
ditingState* editingState) | 51 void forEachLineInString(const String& string, const LineOperation& operation, E
ditingState* editingState) |
| 53 { | 52 { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 64 } else { | 63 } else { |
| 65 unsigned length = string.length(); | 64 unsigned length = string.length(); |
| 66 if (length != offset) | 65 if (length != offset) |
| 67 operation(offset, length - offset, true, editingState); | 66 operation(offset, length - offset, true, editingState); |
| 68 } | 67 } |
| 69 } | 68 } |
| 70 | 69 |
| 71 } // namespace blink | 70 } // namespace blink |
| 72 | 71 |
| 73 #endif | 72 #endif |
| OLD | NEW |