| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 2007, 2008 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 DCHECK(isTopLevelCommand() || !m_composition); | 183 DCHECK(isTopLevelCommand() || !m_composition); |
| 184 } | 184 } |
| 185 | 185 |
| 186 bool CompositeEditCommand::apply() | 186 bool CompositeEditCommand::apply() |
| 187 { | 187 { |
| 188 if (!endingSelection().isContentRichlyEditable()) { | 188 if (!endingSelection().isContentRichlyEditable()) { |
| 189 switch (inputType()) { | 189 switch (inputType()) { |
| 190 case InputEvent::InputType::InsertText: | 190 case InputEvent::InputType::InsertText: |
| 191 case InputEvent::InputType::InsertLineBreak: | 191 case InputEvent::InputType::InsertLineBreak: |
| 192 case InputEvent::InputType::InsertParagraph: | 192 case InputEvent::InputType::InsertParagraph: |
| 193 case InputEvent::InputType::InsertFromPaste: |
| 193 case InputEvent::InputType::DeleteComposedCharacterForward: | 194 case InputEvent::InputType::DeleteComposedCharacterForward: |
| 194 case InputEvent::InputType::DeleteComposedCharacterBackward: | 195 case InputEvent::InputType::DeleteComposedCharacterBackward: |
| 195 case InputEvent::InputType::DeleteWordBackward: | 196 case InputEvent::InputType::DeleteWordBackward: |
| 196 case InputEvent::InputType::DeleteWordForward: | 197 case InputEvent::InputType::DeleteWordForward: |
| 197 case InputEvent::InputType::DeleteLineBackward: | 198 case InputEvent::InputType::DeleteLineBackward: |
| 198 case InputEvent::InputType::DeleteLineForward: | 199 case InputEvent::InputType::DeleteLineForward: |
| 199 case InputEvent::InputType::DeleteContentBackward: | 200 case InputEvent::InputType::DeleteContentBackward: |
| 200 case InputEvent::InputType::DeleteContentForward: | 201 case InputEvent::InputType::DeleteContentForward: |
| 201 case InputEvent::InputType::Paste: | 202 case InputEvent::InputType::DeleteByCut: |
| 202 case InputEvent::InputType::Drag: | 203 case InputEvent::InputType::Drag: |
| 203 case InputEvent::InputType::SetWritingDirection: | 204 case InputEvent::InputType::SetWritingDirection: |
| 204 case InputEvent::InputType::Cut: | |
| 205 case InputEvent::InputType::None: | 205 case InputEvent::InputType::None: |
| 206 break; | 206 break; |
| 207 default: | 207 default: |
| 208 NOTREACHED(); | 208 NOTREACHED(); |
| 209 return false; | 209 return false; |
| 210 } | 210 } |
| 211 } | 211 } |
| 212 ensureComposition(); | 212 ensureComposition(); |
| 213 | 213 |
| 214 // Changes to the document may have been made since the last editing operati
on that require a layout, as in <rdar://problem/5658603>. | 214 // Changes to the document may have been made since the last editing operati
on that require a layout, as in <rdar://problem/5658603>. |
| (...skipping 1439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1654 } | 1654 } |
| 1655 | 1655 |
| 1656 DEFINE_TRACE(CompositeEditCommand) | 1656 DEFINE_TRACE(CompositeEditCommand) |
| 1657 { | 1657 { |
| 1658 visitor->trace(m_commands); | 1658 visitor->trace(m_commands); |
| 1659 visitor->trace(m_composition); | 1659 visitor->trace(m_composition); |
| 1660 EditCommand::trace(visitor); | 1660 EditCommand::trace(visitor); |
| 1661 } | 1661 } |
| 1662 | 1662 |
| 1663 } // namespace blink | 1663 } // namespace blink |
| OLD | NEW |