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 1297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1308 startIndex = 0; | 1308 startIndex = 0; |
1309 if (startInParagraph) | 1309 if (startInParagraph) |
1310 startIndex = TextIterator::rangeLength(startOfParagraphToMove.to
ParentAnchoredPosition(), visibleStart.toParentAnchoredPosition(), true); | 1310 startIndex = TextIterator::rangeLength(startOfParagraphToMove.to
ParentAnchoredPosition(), visibleStart.toParentAnchoredPosition(), true); |
1311 | 1311 |
1312 endIndex = 0; | 1312 endIndex = 0; |
1313 if (endInParagraph) | 1313 if (endInParagraph) |
1314 endIndex = TextIterator::rangeLength(startOfParagraphToMove.toPa
rentAnchoredPosition(), visibleEnd.toParentAnchoredPosition(), true); | 1314 endIndex = TextIterator::rangeLength(startOfParagraphToMove.toPa
rentAnchoredPosition(), visibleEnd.toParentAnchoredPosition(), true); |
1315 } | 1315 } |
1316 } | 1316 } |
1317 | 1317 |
1318 RelocatablePosition beforeParagraphPosition(previousPositionOf(startOfParagr
aphToMove, CannotCrossEditingBoundary).deepEquivalent()); | 1318 RelocatablePosition beforeParagraphPosition(previousPositionOfDeprecated(sta
rtOfParagraphToMove, CannotCrossEditingBoundary).deepEquivalent()); |
1319 RelocatablePosition afterParagraphPosition(nextPositionOf(endOfParagraphToMo
ve, CannotCrossEditingBoundary).deepEquivalent()); | 1319 RelocatablePosition afterParagraphPosition(nextPositionOfDeprecated(endOfPar
agraphToMove, CannotCrossEditingBoundary).deepEquivalent()); |
1320 | 1320 |
1321 // We upstream() the end and downstream() the start so that we don't include
collapsed whitespace in the move. | 1321 // We upstream() the end and downstream() the start so that we don't include
collapsed whitespace in the move. |
1322 // When we paste a fragment, spaces after the end and before the start are t
reated as though they were rendered. | 1322 // When we paste a fragment, spaces after the end and before the start are t
reated as though they were rendered. |
1323 Position start = mostForwardCaretPosition(startOfParagraphToMove.deepEquival
ent()); | 1323 Position start = mostForwardCaretPosition(startOfParagraphToMove.deepEquival
ent()); |
1324 Position end = mostBackwardCaretPosition(endOfParagraphToMove.deepEquivalent
()); | 1324 Position end = mostBackwardCaretPosition(endOfParagraphToMove.deepEquivalent
()); |
1325 | 1325 |
1326 // FIXME: This is an inefficient way to preserve style on nodes in the parag
raph to move. It | 1326 // FIXME: This is an inefficient way to preserve style on nodes in the parag
raph to move. It |
1327 // shouldn't matter though, since moved paragraphs will usually be quite sma
ll. | 1327 // shouldn't matter though, since moved paragraphs will usually be quite sma
ll. |
1328 DocumentFragment* fragment = startOfParagraphToMove.deepEquivalent() != endO
fParagraphToMove.deepEquivalent() ? | 1328 DocumentFragment* fragment = startOfParagraphToMove.deepEquivalent() != endO
fParagraphToMove.deepEquivalent() ? |
1329 createFragmentFromMarkup(document(), createMarkup(start.parentAnchoredEq
uivalent(), end.parentAnchoredEquivalent(), DoNotAnnotateForInterchange, Convert
BlocksToInlines::Convert, DoNotResolveURLs, constrainingAncestor), "") : nullptr
; | 1329 createFragmentFromMarkup(document(), createMarkup(start.parentAnchoredEq
uivalent(), end.parentAnchoredEquivalent(), DoNotAnnotateForInterchange, Convert
BlocksToInlines::Convert, DoNotResolveURLs, constrainingAncestor), "") : nullptr
; |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1660 } | 1660 } |
1661 | 1661 |
1662 DEFINE_TRACE(CompositeEditCommand) | 1662 DEFINE_TRACE(CompositeEditCommand) |
1663 { | 1663 { |
1664 visitor->trace(m_commands); | 1664 visitor->trace(m_commands); |
1665 visitor->trace(m_composition); | 1665 visitor->trace(m_composition); |
1666 EditCommand::trace(visitor); | 1666 EditCommand::trace(visitor); |
1667 } | 1667 } |
1668 | 1668 |
1669 } // namespace blink | 1669 } // namespace blink |
OLD | NEW |