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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 updatePositionForTextRemoval(node.get(), offset, count, m_endingPosition); | 411 updatePositionForTextRemoval(node.get(), offset, count, m_endingPosition); |
412 updatePositionForTextRemoval(node.get(), offset, count, m_leadingWhitespace)
; | 412 updatePositionForTextRemoval(node.get(), offset, count, m_leadingWhitespace)
; |
413 updatePositionForTextRemoval(node.get(), offset, count, m_trailingWhitespace
); | 413 updatePositionForTextRemoval(node.get(), offset, count, m_trailingWhitespace
); |
414 updatePositionForTextRemoval(node.get(), offset, count, m_downstreamEnd); | 414 updatePositionForTextRemoval(node.get(), offset, count, m_downstreamEnd); |
415 | 415 |
416 CompositeEditCommand::deleteTextFromNode(node, offset, count); | 416 CompositeEditCommand::deleteTextFromNode(node, offset, count); |
417 } | 417 } |
418 | 418 |
419 void DeleteSelectionCommand::makeStylingElementsDirectChildrenOfEditableRootToPr
eventStyleLoss() | 419 void DeleteSelectionCommand::makeStylingElementsDirectChildrenOfEditableRootToPr
eventStyleLoss() |
420 { | 420 { |
421 RefPtr<Range> range = m_selectionToDelete.toNormalizedRange(); | 421 RefPtrWillBeRawPtr<Range> range = m_selectionToDelete.toNormalizedRange(); |
422 RefPtr<Node> node = range->firstNode(); | 422 RefPtr<Node> node = range->firstNode(); |
423 while (node && node != range->pastLastNode()) { | 423 while (node && node != range->pastLastNode()) { |
424 RefPtr<Node> nextNode = NodeTraversal::next(*node); | 424 RefPtr<Node> nextNode = NodeTraversal::next(*node); |
425 if ((isHTMLStyleElement(*node) && !(toElement(node)->hasAttribute(scoped
Attr))) || isHTMLLinkElement(*node)) { | 425 if ((isHTMLStyleElement(*node) && !(toElement(node)->hasAttribute(scoped
Attr))) || isHTMLLinkElement(*node)) { |
426 nextNode = NodeTraversal::nextSkippingChildren(*node); | 426 nextNode = NodeTraversal::nextSkippingChildren(*node); |
427 RefPtr<ContainerNode> rootEditableElement = node->rootEditableElemen
t(); | 427 RefPtr<ContainerNode> rootEditableElement = node->rootEditableElemen
t(); |
428 if (rootEditableElement.get()) { | 428 if (rootEditableElement.get()) { |
429 removeNode(node); | 429 removeNode(node); |
430 appendNode(node, rootEditableElement); | 430 appendNode(node, rootEditableElement); |
431 } | 431 } |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
857 | 857 |
858 // Normally deletion doesn't preserve the typing style that was present before i
t. For example, | 858 // Normally deletion doesn't preserve the typing style that was present before i
t. For example, |
859 // type a character, Bold, then delete the character and start typing. The Bold
typing style shouldn't | 859 // type a character, Bold, then delete the character and start typing. The Bold
typing style shouldn't |
860 // stick around. Deletion should preserve a typing style that *it* sets, howeve
r. | 860 // stick around. Deletion should preserve a typing style that *it* sets, howeve
r. |
861 bool DeleteSelectionCommand::preservesTypingStyle() const | 861 bool DeleteSelectionCommand::preservesTypingStyle() const |
862 { | 862 { |
863 return m_typingStyle; | 863 return m_typingStyle; |
864 } | 864 } |
865 | 865 |
866 } // namespace WebCore | 866 } // namespace WebCore |
OLD | NEW |