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

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

Issue 7446011: Merge 91270 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/782/
Patch Set: Created 9 years, 5 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
« no previous file with comments | « LayoutTests/editing/pasteboard/replacement-fragment-remove-unrendered-node-crash-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 * 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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 while (RefPtr<Node> node = holder->firstChild()) { 285 while (RefPtr<Node> node = holder->firstChild()) {
286 holder->removeChild(node.get(), ec); 286 holder->removeChild(node.get(), ec);
287 ASSERT(ec == 0); 287 ASSERT(ec == 0);
288 m_fragment->appendChild(node.get(), ec); 288 m_fragment->appendChild(node.get(), ec);
289 ASSERT(ec == 0); 289 ASSERT(ec == 0);
290 } 290 }
291 } 291 }
292 292
293 void ReplacementFragment::removeUnrenderedNodes(Node* holder) 293 void ReplacementFragment::removeUnrenderedNodes(Node* holder)
294 { 294 {
295 Vector<Node*> unrendered; 295 Vector<RefPtr<Node> > unrendered;
296 296
297 for (Node* node = holder->firstChild(); node; node = node->traverseNextNode( holder)) 297 for (Node* node = holder->firstChild(); node; node = node->traverseNextNode( holder))
298 if (!isNodeRendered(node) && !isTableStructureNode(node)) 298 if (!isNodeRendered(node) && !isTableStructureNode(node))
299 unrendered.append(node); 299 unrendered.append(node);
300 300
301 size_t n = unrendered.size(); 301 size_t n = unrendered.size();
302 for (size_t i = 0; i < n; ++i) 302 for (size_t i = 0; i < n; ++i)
303 removeNode(unrendered[i]); 303 removeNode(unrendered[i]);
304 } 304 }
305 305
(...skipping 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after
1318 end = Position(start.containerNode(), start.offsetInContainerNode() + text.l ength(), Position::PositionIsOffsetInAnchor); 1318 end = Position(start.containerNode(), start.offsetInContainerNode() + text.l ength(), Position::PositionIsOffsetInAnchor);
1319 1319
1320 VisibleSelection selectionAfterReplace(m_selectReplacement ? start : end, en d); 1320 VisibleSelection selectionAfterReplace(m_selectReplacement ? start : end, en d);
1321 1321
1322 setEndingSelection(selectionAfterReplace); 1322 setEndingSelection(selectionAfterReplace);
1323 1323
1324 return true; 1324 return true;
1325 } 1325 }
1326 1326
1327 } // namespace WebCore 1327 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/editing/pasteboard/replacement-fragment-remove-unrendered-node-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698