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 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1091 if (isHTMLBRElement(*node)) { | 1091 if (isHTMLBRElement(*node)) { |
1092 removeNodeAndPruneAncestors(node, destinationNode); | 1092 removeNodeAndPruneAncestors(node, destinationNode); |
1093 | 1093 |
1094 // If the selection to move was empty and in an empty block that | 1094 // If the selection to move was empty and in an empty block that |
1095 // doesn't require a placeholder to prop itself open (like a bordere
d | 1095 // doesn't require a placeholder to prop itself open (like a bordere
d |
1096 // div or an li), remove it during the move (the list removal code | 1096 // div or an li), remove it during the move (the list removal code |
1097 // expects this behavior). | 1097 // expects this behavior). |
1098 } else if (isBlock(node)) { | 1098 } else if (isBlock(node)) { |
1099 // If caret position after deletion and destination position coincid
es, | 1099 // If caret position after deletion and destination position coincid
es, |
1100 // node should not be removed. | 1100 // node should not be removed. |
1101 if (!position.rendersInDifferentPosition(destination.deepEquivalent(
))) { | 1101 if (!rendersInDifferentPosition(position, destination.deepEquivalent
())) { |
1102 prune(node, destinationNode); | 1102 prune(node, destinationNode); |
1103 return; | 1103 return; |
1104 } | 1104 } |
1105 removeNodeAndPruneAncestors(node, destinationNode); | 1105 removeNodeAndPruneAncestors(node, destinationNode); |
1106 } | 1106 } |
1107 else if (lineBreakExistsAtPosition(position)) { | 1107 else if (lineBreakExistsAtPosition(position)) { |
1108 // There is a preserved '\n' at caretAfterDelete. | 1108 // There is a preserved '\n' at caretAfterDelete. |
1109 // We can safely assume this is a text node. | 1109 // We can safely assume this is a text node. |
1110 Text* textNode = toText(node); | 1110 Text* textNode = toText(node); |
1111 if (textNode->length() == 1) | 1111 if (textNode->length() == 1) |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1499 } | 1499 } |
1500 | 1500 |
1501 DEFINE_TRACE(CompositeEditCommand) | 1501 DEFINE_TRACE(CompositeEditCommand) |
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 |