Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1542)

Side by Side Diff: Source/core/editing/CompositeEditCommand.cpp

Issue 1270023002: CANCEL Untemplatize PositionAlgorithm<Strategy>::rendersInDifferentPosition() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-03T15:43:25 Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698