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 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1109 } | 1109 } |
1110 } | 1110 } |
1111 } | 1111 } |
1112 | 1112 |
1113 // This is a version of moveParagraph that preserves style by keeping the origin
al markup | 1113 // This is a version of moveParagraph that preserves style by keeping the origin
al markup |
1114 // It is currently used only by IndentOutdentCommand but it is meant to be used
in the | 1114 // It is currently used only by IndentOutdentCommand but it is meant to be used
in the |
1115 // future by several other commands such as InsertList and the align commands. | 1115 // future by several other commands such as InsertList and the align commands. |
1116 // The blockElement parameter is the element to move the paragraph to, | 1116 // The blockElement parameter is the element to move the paragraph to, |
1117 // outerNode is the top element of the paragraph hierarchy. | 1117 // outerNode is the top element of the paragraph hierarchy. |
1118 | 1118 |
1119 void CompositeEditCommand::moveParagraphWithClones(const VisiblePosition& startO
fParagraphToMove, const VisiblePosition& endOfParagraphToMove, Element* blockEle
ment, Node* outerNode) | 1119 void CompositeEditCommand::moveParagraphWithClones(const VisiblePosition& startO
fParagraphToMove, const VisiblePosition& endOfParagraphToMove, HTMLElement* bloc
kElement, Node* outerNode) |
1120 { | 1120 { |
1121 ASSERT(outerNode); | 1121 ASSERT(outerNode); |
1122 ASSERT(blockElement); | 1122 ASSERT(blockElement); |
1123 | 1123 |
1124 VisiblePosition beforeParagraph = startOfParagraphToMove.previous(); | 1124 VisiblePosition beforeParagraph = startOfParagraphToMove.previous(); |
1125 VisiblePosition afterParagraph(endOfParagraphToMove.next()); | 1125 VisiblePosition afterParagraph(endOfParagraphToMove.next()); |
1126 | 1126 |
1127 // We upstream() the end and downstream() the start so that we don't include
collapsed whitespace in the move. | 1127 // We upstream() the end and downstream() the start so that we don't include
collapsed whitespace in the move. |
1128 // When we paste a fragment, spaces after the end and before the start are t
reated as though they were rendered. | 1128 // When we paste a fragment, spaces after the end and before the start are t
reated as though they were rendered. |
1129 Position start = startOfParagraphToMove.deepEquivalent().downstream(); | 1129 Position start = startOfParagraphToMove.deepEquivalent().downstream(); |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1499 } | 1499 } |
1500 | 1500 |
1501 void CompositeEditCommand::trace(Visitor* visitor) | 1501 void CompositeEditCommand::trace(Visitor* visitor) |
1502 { | 1502 { |
1503 visitor->trace(m_commands); | 1503 visitor->trace(m_commands); |
1504 visitor->trace(m_composition); | 1504 visitor->trace(m_composition); |
1505 EditCommand::trace(visitor); | 1505 EditCommand::trace(visitor); |
1506 } | 1506 } |
1507 | 1507 |
1508 } // namespace blink | 1508 } // namespace blink |
OLD | NEW |