| 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 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 if (m_upstreamStart.isNull()) | 351 if (m_upstreamStart.isNull()) |
| 352 return; | 352 return; |
| 353 | 353 |
| 354 int startOffset = m_upstreamStart.deprecatedEditingOffset(); | 354 int startOffset = m_upstreamStart.deprecatedEditingOffset(); |
| 355 Node* startNode = m_upstreamStart.deprecatedNode(); | 355 Node* startNode = m_upstreamStart.deprecatedNode(); |
| 356 ASSERT(startNode); | 356 ASSERT(startNode); |
| 357 | 357 |
| 358 makeStylingElementsDirectChildrenOfEditableRootToPreventStyleLoss(); | 358 makeStylingElementsDirectChildrenOfEditableRootToPreventStyleLoss(); |
| 359 | 359 |
| 360 // Never remove the start block unless it's a table, in which case we won't
merge content in. | 360 // Never remove the start block unless it's a table, in which case we won't
merge content in. |
| 361 if (startNode->isSameNode(m_startBlock.get()) && !startOffset && canHaveChil
drenForEditing(startNode)) { | 361 if (startNode == m_startBlock && !startOffset && canHaveChildrenForEditing(s
tartNode)) { |
| 362 startOffset = 0; | 362 startOffset = 0; |
| 363 startNode = NodeTraversal::next(*startNode); | 363 startNode = NodeTraversal::next(*startNode); |
| 364 if (!startNode) | 364 if (!startNode) |
| 365 return; | 365 return; |
| 366 } | 366 } |
| 367 | 367 |
| 368 if (startOffset >= caretMaxOffset(startNode) && startNode->isTextNode()) { | 368 if (startOffset >= caretMaxOffset(startNode) && startNode->isTextNode()) { |
| 369 Text* text = toText(startNode); | 369 Text* text = toText(startNode); |
| 370 if (text->length() > (unsigned)caretMaxOffset(startNode)) | 370 if (text->length() > (unsigned)caretMaxOffset(startNode)) |
| 371 deleteTextFromNode(text, caretMaxOffset(startNode), text->length() -
caretMaxOffset(startNode)); | 371 deleteTextFromNode(text, caretMaxOffset(startNode), text->length() -
caretMaxOffset(startNode)); |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 667 | 667 |
| 668 // Normally deletion doesn't preserve the typing style that was present before i
t. For example, | 668 // Normally deletion doesn't preserve the typing style that was present before i
t. For example, |
| 669 // type a character, Bold, then delete the character and start typing. The Bold
typing style shouldn't | 669 // type a character, Bold, then delete the character and start typing. The Bold
typing style shouldn't |
| 670 // stick around. Deletion should preserve a typing style that *it* sets, howeve
r. | 670 // stick around. Deletion should preserve a typing style that *it* sets, howeve
r. |
| 671 bool DeleteSelectionCommand::preservesTypingStyle() const | 671 bool DeleteSelectionCommand::preservesTypingStyle() const |
| 672 { | 672 { |
| 673 return false; | 673 return false; |
| 674 } | 674 } |
| 675 | 675 |
| 676 } // namespace blink | 676 } // namespace blink |
| OLD | NEW |