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 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
769 // cloning all the siblings until end.node() is reached. | 769 // cloning all the siblings until end.node() is reached. |
770 | 770 |
771 if (start.node() != end.node() && !start.node()->isDescendantOf(end.node()))
{ | 771 if (start.node() != end.node() && !start.node()->isDescendantOf(end.node()))
{ |
772 // If end is not a descendant of outerNode we need to | 772 // If end is not a descendant of outerNode we need to |
773 // find the first common ancestor and adjust the insertion | 773 // find the first common ancestor and adjust the insertion |
774 // point accordingly. | 774 // point accordingly. |
775 while (!end.node()->isDescendantOf(outerNode)) { | 775 while (!end.node()->isDescendantOf(outerNode)) { |
776 outerNode = outerNode->parentNode(); | 776 outerNode = outerNode->parentNode(); |
777 topNode = topNode->parentNode(); | 777 topNode = topNode->parentNode(); |
778 } | 778 } |
779 | 779 |
780 for (Node* n = start.node()->traverseNextSibling(outerNode); n; n = n->n
extSibling()) { | 780 for (Node* n = start.node()->traverseNextSibling(outerNode); n; n = n->t
raverseNextSibling(outerNode)) { |
781 if (n->parentNode() != start.node()->parentNode()) | 781 if (n->parentNode() != start.node()->parentNode()) |
782 lastNode = topNode->lastChild(); | 782 lastNode = topNode->lastChild(); |
783 | 783 |
784 RefPtr<Node> clonedNode = n->cloneNode(true); | 784 RefPtr<Node> clonedNode = n->cloneNode(true); |
785 insertNodeAfter(clonedNode, lastNode); | 785 insertNodeAfter(clonedNode, lastNode); |
786 lastNode = clonedNode.release(); | 786 lastNode = clonedNode.release(); |
787 if (n == end.node() || end.node()->isDescendantOf(n)) | 787 if (n == end.node() || end.node()->isDescendantOf(n)) |
788 break; | 788 break; |
789 } | 789 } |
790 } | 790 } |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1200 return node.release(); | 1200 return node.release(); |
1201 } | 1201 } |
1202 | 1202 |
1203 PassRefPtr<Element> createBlockPlaceholderElement(Document* document) | 1203 PassRefPtr<Element> createBlockPlaceholderElement(Document* document) |
1204 { | 1204 { |
1205 RefPtr<Element> breakNode = document->createElement(brTag, false); | 1205 RefPtr<Element> breakNode = document->createElement(brTag, false); |
1206 return breakNode.release(); | 1206 return breakNode.release(); |
1207 } | 1207 } |
1208 | 1208 |
1209 } // namespace WebCore | 1209 } // namespace WebCore |
OLD | NEW |