| 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 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1110 // Add a br if pruning an empty block level element caused a collapse. For
example: | 1110 // Add a br if pruning an empty block level element caused a collapse. For
example: |
| 1111 // foo^ | 1111 // foo^ |
| 1112 // <div>bar</div> | 1112 // <div>bar</div> |
| 1113 // baz | 1113 // baz |
| 1114 // Imagine moving 'bar' to ^. 'bar' will be deleted and its div pruned. Th
at would | 1114 // Imagine moving 'bar' to ^. 'bar' will be deleted and its div pruned. Th
at would |
| 1115 // cause 'baz' to collapse onto the line with 'foobar' unless we insert a br
. | 1115 // cause 'baz' to collapse onto the line with 'foobar' unless we insert a br
. |
| 1116 // Must recononicalize these two VisiblePositions after the pruning above. | 1116 // Must recononicalize these two VisiblePositions after the pruning above. |
| 1117 beforeParagraph = VisiblePosition(beforeParagraph.deepEquivalent()); | 1117 beforeParagraph = VisiblePosition(beforeParagraph.deepEquivalent()); |
| 1118 afterParagraph = VisiblePosition(afterParagraph.deepEquivalent()); | 1118 afterParagraph = VisiblePosition(afterParagraph.deepEquivalent()); |
| 1119 | 1119 |
| 1120 if (beforeParagraph.isNotNull() && !isTableElement(beforeParagraph.deepEquiv
alent().deprecatedNode()) | 1120 if (beforeParagraph.isNotNull() && !isRenderedTable(beforeParagraph.deepEqui
valent().deprecatedNode()) |
| 1121 && ((!isEndOfParagraph(beforeParagraph) && !isStartOfParagraph(beforePar
agraph)) || beforeParagraph == afterParagraph)) { | 1121 && ((!isEndOfParagraph(beforeParagraph) && !isStartOfParagraph(beforePar
agraph)) || beforeParagraph == afterParagraph)) { |
| 1122 // FIXME: Trim text between beforeParagraph and afterParagraph if they a
ren't equal. | 1122 // FIXME: Trim text between beforeParagraph and afterParagraph if they a
ren't equal. |
| 1123 insertNodeAt(createBreakElement(document()), beforeParagraph.deepEquival
ent()); | 1123 insertNodeAt(createBreakElement(document()), beforeParagraph.deepEquival
ent()); |
| 1124 } | 1124 } |
| 1125 } | 1125 } |
| 1126 | 1126 |
| 1127 void CompositeEditCommand::moveParagraph(const VisiblePosition& startOfParagraph
ToMove, const VisiblePosition& endOfParagraphToMove, const VisiblePosition& dest
ination, bool preserveSelection, bool preserveStyle, Node* constrainingAncestor) | 1127 void CompositeEditCommand::moveParagraph(const VisiblePosition& startOfParagraph
ToMove, const VisiblePosition& endOfParagraphToMove, const VisiblePosition& dest
ination, bool preserveSelection, bool preserveStyle, Node* constrainingAncestor) |
| 1128 { | 1128 { |
| 1129 ASSERT(isStartOfParagraph(startOfParagraphToMove)); | 1129 ASSERT(isStartOfParagraph(startOfParagraphToMove)); |
| 1130 ASSERT(isEndOfParagraph(endOfParagraphToMove)); | 1130 ASSERT(isEndOfParagraph(endOfParagraphToMove)); |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1458 return node.release(); | 1458 return node.release(); |
| 1459 } | 1459 } |
| 1460 | 1460 |
| 1461 PassRefPtr<Element> createBlockPlaceholderElement(Document& document) | 1461 PassRefPtr<Element> createBlockPlaceholderElement(Document& document) |
| 1462 { | 1462 { |
| 1463 RefPtr<Element> breakNode = document.createElement(brTag, false); | 1463 RefPtr<Element> breakNode = document.createElement(brTag, false); |
| 1464 return breakNode.release(); | 1464 return breakNode.release(); |
| 1465 } | 1465 } |
| 1466 | 1466 |
| 1467 } // namespace WebCore | 1467 } // namespace WebCore |
| OLD | NEW |