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

Side by Side Diff: third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp

Issue 2432173005: Get rid of VisibleSelection::selectionFromContentsOfNode() (Closed)
Patch Set: 2016-10-20T17:14:18 Created 4 years, 2 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 1224 matching lines...) Expand 10 before | Expand all | Expand 10 after
1235 return newBlock; 1235 return newBlock;
1236 } 1236 }
1237 1237
1238 void CompositeEditCommand::pushAnchorElementDown(Element* anchorNode, 1238 void CompositeEditCommand::pushAnchorElementDown(Element* anchorNode,
1239 EditingState* editingState) { 1239 EditingState* editingState) {
1240 if (!anchorNode) 1240 if (!anchorNode)
1241 return; 1241 return;
1242 1242
1243 DCHECK(anchorNode->isLink()) << anchorNode; 1243 DCHECK(anchorNode->isLink()) << anchorNode;
1244 1244
1245 setEndingSelection(VisibleSelection::selectionFromContentsOfNode(anchorNode)); 1245 setEndingSelection(createVisibleSelection(
1246 SelectionInDOMTree::Builder().selectAllChildren(*anchorNode).build()));
1246 applyStyledElement(anchorNode, editingState); 1247 applyStyledElement(anchorNode, editingState);
1247 if (editingState->isAborted()) 1248 if (editingState->isAborted())
1248 return; 1249 return;
1249 // Clones of anchorNode have been pushed down, now remove it. 1250 // Clones of anchorNode have been pushed down, now remove it.
1250 if (anchorNode->isConnected()) 1251 if (anchorNode->isConnected())
1251 removeNodePreservingChildren(anchorNode, editingState); 1252 removeNodePreservingChildren(anchorNode, editingState);
1252 } 1253 }
1253 1254
1254 // Clone the paragraph between start and end under blockElement, 1255 // Clone the paragraph between start and end under blockElement,
1255 // preserving the hierarchy up to outerNode. 1256 // preserving the hierarchy up to outerNode.
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after
2018 return node; 2019 return node;
2019 } 2020 }
2020 2021
2021 DEFINE_TRACE(CompositeEditCommand) { 2022 DEFINE_TRACE(CompositeEditCommand) {
2022 visitor->trace(m_commands); 2023 visitor->trace(m_commands);
2023 visitor->trace(m_composition); 2024 visitor->trace(m_composition);
2024 EditCommand::trace(visitor); 2025 EditCommand::trace(visitor);
2025 } 2026 }
2026 2027
2027 } // namespace blink 2028 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698