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

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

Issue 22880029: Make AttachBehavior a required argument. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2009, 2010, 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2009, 2010, 2011 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 234
235 void ReplacementFragment::insertNodeBefore(PassRefPtr<Node> node, Node* refNode) 235 void ReplacementFragment::insertNodeBefore(PassRefPtr<Node> node, Node* refNode)
236 { 236 {
237 if (!node || !refNode) 237 if (!node || !refNode)
238 return; 238 return;
239 239
240 ContainerNode* parent = refNode->nonShadowBoundaryParentNode(); 240 ContainerNode* parent = refNode->nonShadowBoundaryParentNode();
241 if (!parent) 241 if (!parent)
242 return; 242 return;
243 243
244 parent->insertBefore(node, refNode, ASSERT_NO_EXCEPTION); 244 parent->insertBefore(node, refNode, ASSERT_NO_EXCEPTION, DeprecatedAttachNow );
245 } 245 }
246 246
247 PassRefPtr<Element> ReplacementFragment::insertFragmentForTestRendering(Node* ro otEditableElement) 247 PassRefPtr<Element> ReplacementFragment::insertFragmentForTestRendering(Node* ro otEditableElement)
248 { 248 {
249 RefPtr<Element> holder = createDefaultParagraphElement(m_document.get()); 249 RefPtr<Element> holder = createDefaultParagraphElement(m_document.get());
250 250
251 holder->appendChild(m_fragment, ASSERT_NO_EXCEPTION); 251 holder->appendChild(m_fragment, ASSERT_NO_EXCEPTION, DeprecatedAttachNow);
252 rootEditableElement->appendChild(holder.get(), ASSERT_NO_EXCEPTION); 252 rootEditableElement->appendChild(holder.get(), ASSERT_NO_EXCEPTION, Deprecat edAttachNow);
253 m_document->updateLayoutIgnorePendingStylesheets(); 253 m_document->updateLayoutIgnorePendingStylesheets();
254 254
255 return holder.release(); 255 return holder.release();
256 } 256 }
257 257
258 void ReplacementFragment::restoreAndRemoveTestRenderingNodesToFragment(Element* holder) 258 void ReplacementFragment::restoreAndRemoveTestRenderingNodesToFragment(Element* holder)
259 { 259 {
260 if (!holder) 260 if (!holder)
261 return; 261 return;
262 262
263 while (RefPtr<Node> node = holder->firstChild()) { 263 while (RefPtr<Node> node = holder->firstChild()) {
264 holder->removeChild(node.get(), ASSERT_NO_EXCEPTION); 264 holder->removeChild(node.get(), ASSERT_NO_EXCEPTION);
265 m_fragment->appendChild(node.get(), ASSERT_NO_EXCEPTION); 265 m_fragment->appendChild(node.get(), ASSERT_NO_EXCEPTION, DeprecatedAttac hNow);
266 } 266 }
267 267
268 removeNode(holder); 268 removeNode(holder);
269 } 269 }
270 270
271 void ReplacementFragment::removeUnrenderedNodes(Node* holder) 271 void ReplacementFragment::removeUnrenderedNodes(Node* holder)
272 { 272 {
273 Vector<RefPtr<Node> > unrendered; 273 Vector<RefPtr<Node> > unrendered;
274 274
275 for (Node* node = holder->firstChild(); node; node = NodeTraversal::next(nod e, holder)) 275 for (Node* node = holder->firstChild(); node; node = NodeTraversal::next(nod e, holder))
(...skipping 1211 matching lines...) Expand 10 before | Expand all | Expand 10 after
1487 removeNodeAndPruneAncestors(nodeAfterInsertionPos.get()); 1487 removeNodeAndPruneAncestors(nodeAfterInsertionPos.get());
1488 1488
1489 VisibleSelection selectionAfterReplace(m_selectReplacement ? start : end, en d); 1489 VisibleSelection selectionAfterReplace(m_selectReplacement ? start : end, en d);
1490 1490
1491 setEndingSelection(selectionAfterReplace); 1491 setEndingSelection(selectionAfterReplace);
1492 1492
1493 return true; 1493 return true;
1494 } 1494 }
1495 1495
1496 } // namespace WebCore 1496 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/editing/ReplaceNodeWithSpanCommand.cpp ('k') | Source/core/editing/SplitElementCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698