OLD | NEW |
1 /* | 1 /* |
2 * (C) 1999 Lars Knoll (knoll@kde.org) | 2 * (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 2000 Gunnstein Lye (gunnstein@netcom.no) | 3 * (C) 2000 Gunnstein Lye (gunnstein@netcom.no) |
4 * (C) 2000 Frederik Holljen (frederik.holljen@hig.no) | 4 * (C) 2000 Frederik Holljen (frederik.holljen@hig.no) |
5 * (C) 2001 Peter Kelly (pmk@post.com) | 5 * (C) 2001 Peter Kelly (pmk@post.com) |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
661 n = n->nextSibling(); | 661 n = n->nextSibling(); |
662 int endOffset = m_end.offset(); | 662 int endOffset = m_end.offset(); |
663 RefPtr<Node> next; | 663 RefPtr<Node> next; |
664 for (; n && i < endOffset; n = next, i++) { // delete until end offs
et | 664 for (; n && i < endOffset; n = next, i++) { // delete until end offs
et |
665 next = n->nextSibling(); | 665 next = n->nextSibling(); |
666 if (action == EXTRACT_CONTENTS) | 666 if (action == EXTRACT_CONTENTS) |
667 fragment->appendChild(n, ec); // will remove n from its pare
nt | 667 fragment->appendChild(n, ec); // will remove n from its pare
nt |
668 else if (action == CLONE_CONTENTS) | 668 else if (action == CLONE_CONTENTS) |
669 fragment->appendChild(n->cloneNode(true), ec); | 669 fragment->appendChild(n->cloneNode(true), ec); |
670 else | 670 else |
671 toContainerNode(m_start.container())->removeChild(n.get(), e
c); | 671 m_start.container()->removeChild(n.get(), ec); |
672 } | 672 } |
673 } | 673 } |
674 return fragment.release(); | 674 return fragment.release(); |
675 } | 675 } |
676 | 676 |
677 // Complex case: Start and end containers are different. | 677 // Complex case: Start and end containers are different. |
678 // There are three possibilities here: | 678 // There are three possibilities here: |
679 // 1. Start container == commonRoot (End container must be a descendant) | 679 // 1. Start container == commonRoot (End container must be a descendant) |
680 // 2. End container == commonRoot (Start container must be a descendant) | 680 // 2. End container == commonRoot (Start container must be a descendant) |
681 // 3. Neither is commonRoot, they are both descendants | 681 // 3. Neither is commonRoot, they are both descendants |
(...skipping 1306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1988 { | 1988 { |
1989 if (range && range->boundaryPointsValid()) { | 1989 if (range && range->boundaryPointsValid()) { |
1990 WebCore::Position start = range->startPosition(); | 1990 WebCore::Position start = range->startPosition(); |
1991 WebCore::Position end = range->endPosition(); | 1991 WebCore::Position end = range->endPosition(); |
1992 start.node()->showTreeAndMark(start.node(), "S", end.node(), "E"); | 1992 start.node()->showTreeAndMark(start.node(), "S", end.node(), "E"); |
1993 fprintf(stderr, "start offset: %d, end offset: %d\n", start.deprecatedEd
itingOffset(), end.deprecatedEditingOffset()); | 1993 fprintf(stderr, "start offset: %d, end offset: %d\n", start.deprecatedEd
itingOffset(), end.deprecatedEditingOffset()); |
1994 } | 1994 } |
1995 } | 1995 } |
1996 | 1996 |
1997 #endif | 1997 #endif |
OLD | NEW |