| 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 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 } | 530 } |
| 531 } | 531 } |
| 532 } | 532 } |
| 533 } | 533 } |
| 534 } | 534 } |
| 535 | 535 |
| 536 void DeleteSelectionCommand::fixupWhitespace() | 536 void DeleteSelectionCommand::fixupWhitespace() |
| 537 { | 537 { |
| 538 updateLayout(); | 538 updateLayout(); |
| 539 // FIXME: isRenderedCharacter should be removed, and we should use VisiblePo
sition::characterAfter and VisiblePosition::characterBefore | 539 // FIXME: isRenderedCharacter should be removed, and we should use VisiblePo
sition::characterAfter and VisiblePosition::characterBefore |
| 540 if (m_leadingWhitespace.isNotNull() && !m_leadingWhitespace.isRenderedCharac
ter()) { | 540 if (m_leadingWhitespace.isNotNull() && !m_leadingWhitespace.isRenderedCharac
ter() && m_leadingWhitespace.node()->isTextNode()) { |
| 541 Text* textNode = static_cast<Text*>(m_leadingWhitespace.node()); | 541 Text* textNode = static_cast<Text*>(m_leadingWhitespace.node()); |
| 542 ASSERT(!textNode->renderer() || textNode->renderer()->style()->collapseW
hiteSpace()); | 542 ASSERT(!textNode->renderer() || textNode->renderer()->style()->collapseW
hiteSpace()); |
| 543 replaceTextInNode(textNode, m_leadingWhitespace.deprecatedEditingOffset(
), 1, nonBreakingSpaceString()); | 543 replaceTextInNode(textNode, m_leadingWhitespace.deprecatedEditingOffset(
), 1, nonBreakingSpaceString()); |
| 544 } | 544 } |
| 545 if (m_trailingWhitespace.isNotNull() && !m_trailingWhitespace.isRenderedChar
acter()) { | 545 if (m_trailingWhitespace.isNotNull() && !m_trailingWhitespace.isRenderedChar
acter() && m_trailingWhitespace.node()->isTextNode()) { |
| 546 Text* textNode = static_cast<Text*>(m_trailingWhitespace.node()); | 546 Text* textNode = static_cast<Text*>(m_trailingWhitespace.node()); |
| 547 ASSERT(!textNode->renderer() ||textNode->renderer()->style()->collapseWh
iteSpace()); | 547 ASSERT(!textNode->renderer() ||textNode->renderer()->style()->collapseWh
iteSpace()); |
| 548 replaceTextInNode(textNode, m_trailingWhitespace.deprecatedEditingOffset
(), 1, nonBreakingSpaceString()); | 548 replaceTextInNode(textNode, m_trailingWhitespace.deprecatedEditingOffset
(), 1, nonBreakingSpaceString()); |
| 549 } | 549 } |
| 550 } | 550 } |
| 551 | 551 |
| 552 // If a selection starts in one block and ends in another, we have to merge to b
ring content before the | 552 // If a selection starts in one block and ends in another, we have to merge to b
ring content before the |
| 553 // start together with content after the end. | 553 // start together with content after the end. |
| 554 void DeleteSelectionCommand::mergeParagraphs() | 554 void DeleteSelectionCommand::mergeParagraphs() |
| 555 { | 555 { |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 814 | 814 |
| 815 // Normally deletion doesn't preserve the typing style that was present before i
t. For example, | 815 // Normally deletion doesn't preserve the typing style that was present before i
t. For example, |
| 816 // type a character, Bold, then delete the character and start typing. The Bold
typing style shouldn't | 816 // type a character, Bold, then delete the character and start typing. The Bold
typing style shouldn't |
| 817 // stick around. Deletion should preserve a typing style that *it* sets, howeve
r. | 817 // stick around. Deletion should preserve a typing style that *it* sets, howeve
r. |
| 818 bool DeleteSelectionCommand::preservesTypingStyle() const | 818 bool DeleteSelectionCommand::preservesTypingStyle() const |
| 819 { | 819 { |
| 820 return m_typingStyle; | 820 return m_typingStyle; |
| 821 } | 821 } |
| 822 | 822 |
| 823 } // namespace WebCore | 823 } // namespace WebCore |
| OLD | NEW |