| 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 1399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1410 | 1410 |
| 1411 void CompositeEditCommand::moveParagraphWithClones( | 1411 void CompositeEditCommand::moveParagraphWithClones( |
| 1412 const VisiblePosition& startOfParagraphToMove, | 1412 const VisiblePosition& startOfParagraphToMove, |
| 1413 const VisiblePosition& endOfParagraphToMove, | 1413 const VisiblePosition& endOfParagraphToMove, |
| 1414 HTMLElement* blockElement, | 1414 HTMLElement* blockElement, |
| 1415 Node* outerNode, | 1415 Node* outerNode, |
| 1416 EditingState* editingState) { | 1416 EditingState* editingState) { |
| 1417 DCHECK(outerNode); | 1417 DCHECK(outerNode); |
| 1418 DCHECK(blockElement); | 1418 DCHECK(blockElement); |
| 1419 | 1419 |
| 1420 VisiblePosition beforeParagraph = previousPositionOf(startOfParagraphToMove); | 1420 VisiblePosition beforeParagraph = |
| 1421 VisiblePosition afterParagraph = nextPositionOf(endOfParagraphToMove); | 1421 previousPositionOf(startOfParagraphToMove, CannotCrossEditingBoundary); |
| 1422 VisiblePosition afterParagraph = |
| 1423 nextPositionOf(endOfParagraphToMove, CannotCrossEditingBoundary); |
| 1422 | 1424 |
| 1423 // We upstream() the end and downstream() the start so that we don't include | 1425 // We upstream() the end and downstream() the start so that we don't include |
| 1424 // collapsed whitespace in the move. When we paste a fragment, spaces after | 1426 // collapsed whitespace in the move. When we paste a fragment, spaces after |
| 1425 // the end and before the start are treated as though they were rendered. | 1427 // the end and before the start are treated as though they were rendered. |
| 1426 Position start = | 1428 Position start = |
| 1427 mostForwardCaretPosition(startOfParagraphToMove.deepEquivalent()); | 1429 mostForwardCaretPosition(startOfParagraphToMove.deepEquivalent()); |
| 1428 Position end = | 1430 Position end = |
| 1429 startOfParagraphToMove.deepEquivalent() == | 1431 startOfParagraphToMove.deepEquivalent() == |
| 1430 endOfParagraphToMove.deepEquivalent() | 1432 endOfParagraphToMove.deepEquivalent() |
| 1431 ? start | 1433 ? start |
| (...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2021 return node; | 2023 return node; |
| 2022 } | 2024 } |
| 2023 | 2025 |
| 2024 DEFINE_TRACE(CompositeEditCommand) { | 2026 DEFINE_TRACE(CompositeEditCommand) { |
| 2025 visitor->trace(m_commands); | 2027 visitor->trace(m_commands); |
| 2026 visitor->trace(m_composition); | 2028 visitor->trace(m_composition); |
| 2027 EditCommand::trace(visitor); | 2029 EditCommand::trace(visitor); |
| 2028 } | 2030 } |
| 2029 | 2031 |
| 2030 } // namespace blink | 2032 } // namespace blink |
| OLD | NEW |