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

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

Issue 220233013: Don't return null from ReplaceSelectionCommand::insertAsListItems() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2014-04-03T01:25:13 Created 6 years, 8 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/execCommand/crash-replacing-list-by-list-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 * 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 1429 matching lines...) Expand 10 before | Expand all | Expand 10 after
1440 if (isStart || isMiddle) { 1440 if (isStart || isMiddle) {
1441 insertNodeBefore(listItem, lastNode); 1441 insertNodeBefore(listItem, lastNode);
1442 insertedNodes.respondToNodeInsertion(*listItem); 1442 insertedNodes.respondToNodeInsertion(*listItem);
1443 } else if (isEnd) { 1443 } else if (isEnd) {
1444 insertNodeAfter(listItem, lastNode); 1444 insertNodeAfter(listItem, lastNode);
1445 insertedNodes.respondToNodeInsertion(*listItem); 1445 insertedNodes.respondToNodeInsertion(*listItem);
1446 lastNode = listItem.get(); 1446 lastNode = listItem.get();
1447 } else 1447 } else
1448 ASSERT_NOT_REACHED(); 1448 ASSERT_NOT_REACHED();
1449 } 1449 }
1450 if (isStart || isMiddle) 1450 if (isStart || isMiddle) {
1451 lastNode = lastNode->previousSibling(); 1451 if (Node* node = lastNode->previousSibling())
1452 return node;
1453 }
1452 return lastNode; 1454 return lastNode;
1453 } 1455 }
1454 1456
1455 void ReplaceSelectionCommand::updateNodesInserted(Node *node) 1457 void ReplaceSelectionCommand::updateNodesInserted(Node *node)
1456 { 1458 {
1457 if (!node) 1459 if (!node)
1458 return; 1460 return;
1459 1461
1460 if (m_startOfInsertedContent.isNull()) 1462 if (m_startOfInsertedContent.isNull())
1461 m_startOfInsertedContent = firstPositionInOrBeforeNode(node); 1463 m_startOfInsertedContent = firstPositionInOrBeforeNode(node);
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
1494 removeNodeAndPruneAncestors(nodeAfterInsertionPos.get()); 1496 removeNodeAndPruneAncestors(nodeAfterInsertionPos.get());
1495 1497
1496 VisibleSelection selectionAfterReplace(m_selectReplacement ? start : end, en d); 1498 VisibleSelection selectionAfterReplace(m_selectReplacement ? start : end, en d);
1497 1499
1498 setEndingSelection(selectionAfterReplace); 1500 setEndingSelection(selectionAfterReplace);
1499 1501
1500 return true; 1502 return true;
1501 } 1503 }
1502 1504
1503 } // namespace WebCore 1505 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/editing/execCommand/crash-replacing-list-by-list-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698