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 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 Position end = endingSelection().end(); | 481 Position end = endingSelection().end(); |
482 if (start.containerNode() != end.containerNode() || !start.containerNode()->
isTextNode() || isTabSpanTextNode(start.containerNode())) | 482 if (start.containerNode() != end.containerNode() || !start.containerNode()->
isTextNode() || isTabSpanTextNode(start.containerNode())) |
483 return Position(); | 483 return Position(); |
484 | 484 |
485 RefPtrWillBeRawPtr<Text> textNode = start.containerText(); | 485 RefPtrWillBeRawPtr<Text> textNode = start.containerText(); |
486 replaceTextInNode(textNode, start.offsetInContainerNode(), end.offsetInConta
inerNode() - start.offsetInContainerNode(), text); | 486 replaceTextInNode(textNode, start.offsetInContainerNode(), end.offsetInConta
inerNode() - start.offsetInContainerNode(), text); |
487 | 487 |
488 return Position(textNode.release(), start.offsetInContainerNode() + text.len
gth()); | 488 return Position(textNode.release(), start.offsetInContainerNode() + text.len
gth()); |
489 } | 489 } |
490 | 490 |
491 static void copyMarkers(const Vector<DocumentMarker*>& markerPointers, Vector<Do
cumentMarker>& markers) | 491 static void copyMarkers(const WillBeHeapVector<DocumentMarker*>& markerPointers,
Vector<DocumentMarker>& markers) |
492 { | 492 { |
493 size_t arraySize = markerPointers.size(); | 493 size_t arraySize = markerPointers.size(); |
494 markers.reserveCapacity(arraySize); | 494 markers.reserveCapacity(arraySize); |
495 for (size_t i = 0; i < arraySize; ++i) | 495 for (size_t i = 0; i < arraySize; ++i) |
496 markers.append(*markerPointers[i]); | 496 markers.append(*markerPointers[i]); |
497 } | 497 } |
498 | 498 |
499 void CompositeEditCommand::replaceTextInNodePreservingMarkers(PassRefPtrWillBeRa
wPtr<Text> prpNode, unsigned offset, unsigned count, const String& replacementTe
xt) | 499 void CompositeEditCommand::replaceTextInNodePreservingMarkers(PassRefPtrWillBeRa
wPtr<Text> prpNode, unsigned offset, unsigned count, const String& replacementTe
xt) |
500 { | 500 { |
501 RefPtrWillBeRawPtr<Text> node(prpNode); | 501 RefPtrWillBeRawPtr<Text> node(prpNode); |
(...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1468 | 1468 |
1469 return node.release(); | 1469 return node.release(); |
1470 } | 1470 } |
1471 | 1471 |
1472 PassRefPtrWillBeRawPtr<Element> createBlockPlaceholderElement(Document& document
) | 1472 PassRefPtrWillBeRawPtr<Element> createBlockPlaceholderElement(Document& document
) |
1473 { | 1473 { |
1474 return document.createElement(brTag, false); | 1474 return document.createElement(brTag, false); |
1475 } | 1475 } |
1476 | 1476 |
1477 } // namespace WebCore | 1477 } // namespace WebCore |
OLD | NEW |