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 1174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1185 // The moved paragraph should assume the block style of the destination. | 1185 // The moved paragraph should assume the block style of the destination. |
1186 styleInEmptyParagraph->removeBlockProperties(); | 1186 styleInEmptyParagraph->removeBlockProperties(); |
1187 } | 1187 } |
1188 | 1188 |
1189 // FIXME (5098931): We should add a new insert action "WebViewInsertActionMo
ved" and call shouldInsertFragment here. | 1189 // FIXME (5098931): We should add a new insert action "WebViewInsertActionMo
ved" and call shouldInsertFragment here. |
1190 | 1190 |
1191 setEndingSelection(VisibleSelection(start, end, DOWNSTREAM)); | 1191 setEndingSelection(VisibleSelection(start, end, DOWNSTREAM)); |
1192 document().frame()->editor().clearMisspellingsAndBadGrammar(endingSelection(
)); | 1192 document().frame()->editor().clearMisspellingsAndBadGrammar(endingSelection(
)); |
1193 deleteSelection(false, false, false, false); | 1193 deleteSelection(false, false, false, false); |
1194 | 1194 |
1195 ASSERT(destination.deepEquivalent().anchorNode()->inDocument()); | 1195 ASSERT(destination.deepEquivalent().inDocument()); |
1196 cleanupAfterDeletion(destination); | 1196 cleanupAfterDeletion(destination); |
1197 ASSERT(destination.deepEquivalent().anchorNode()->inDocument()); | 1197 ASSERT(destination.deepEquivalent().inDocument()); |
1198 | 1198 |
1199 // Add a br if pruning an empty block level element caused a collapse. For e
xample: | 1199 // Add a br if pruning an empty block level element caused a collapse. For e
xample: |
1200 // foo^ | 1200 // foo^ |
1201 // <div>bar</div> | 1201 // <div>bar</div> |
1202 // baz | 1202 // baz |
1203 // Imagine moving 'bar' to ^. 'bar' will be deleted and its div pruned. That
would | 1203 // Imagine moving 'bar' to ^. 'bar' will be deleted and its div pruned. That
would |
1204 // cause 'baz' to collapse onto the line with 'foobar' unless we insert a br
. | 1204 // cause 'baz' to collapse onto the line with 'foobar' unless we insert a br
. |
1205 // Must recononicalize these two VisiblePositions after the pruning above. | 1205 // Must recononicalize these two VisiblePositions after the pruning above. |
1206 beforeParagraph = VisiblePosition(beforeParagraph.deepEquivalent()); | 1206 beforeParagraph = VisiblePosition(beforeParagraph.deepEquivalent()); |
1207 afterParagraph = VisiblePosition(afterParagraph.deepEquivalent()); | 1207 afterParagraph = VisiblePosition(afterParagraph.deepEquivalent()); |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1450 return node.release(); | 1450 return node.release(); |
1451 } | 1451 } |
1452 | 1452 |
1453 PassRefPtr<Element> createBlockPlaceholderElement(Document& document) | 1453 PassRefPtr<Element> createBlockPlaceholderElement(Document& document) |
1454 { | 1454 { |
1455 RefPtr<Element> breakNode = document.createElement(brTag, false); | 1455 RefPtr<Element> breakNode = document.createElement(brTag, false); |
1456 return breakNode.release(); | 1456 return breakNode.release(); |
1457 } | 1457 } |
1458 | 1458 |
1459 } // namespace WebCore | 1459 } // namespace WebCore |
OLD | NEW |