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

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

Issue 9331006: Merge 106380 - Source/WebCore: Crash in DeleteSelectionCommand::handleGeneralDelete when attempti... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1025/
Patch Set: Created 8 years, 10 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/deleting/delete-start-block-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 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2005 Apple Computer, 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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 if (m_upstreamStart.isNull()) 411 if (m_upstreamStart.isNull())
412 return; 412 return;
413 413
414 int startOffset = m_upstreamStart.deprecatedEditingOffset(); 414 int startOffset = m_upstreamStart.deprecatedEditingOffset();
415 Node* startNode = m_upstreamStart.deprecatedNode(); 415 Node* startNode = m_upstreamStart.deprecatedNode();
416 416
417 // Never remove the start block unless it's a table, in which case we won't merge content in. 417 // Never remove the start block unless it's a table, in which case we won't merge content in.
418 if (startNode == m_startBlock && startOffset == 0 && canHaveChildrenForEditi ng(startNode) && !startNode->hasTagName(tableTag)) { 418 if (startNode == m_startBlock && startOffset == 0 && canHaveChildrenForEditi ng(startNode) && !startNode->hasTagName(tableTag)) {
419 startOffset = 0; 419 startOffset = 0;
420 startNode = startNode->traverseNextNode(); 420 startNode = startNode->traverseNextNode();
421 if (!startNode)
422 return;
421 } 423 }
422 424
423 if (startOffset >= caretMaxOffset(startNode) && startNode->isTextNode()) { 425 if (startOffset >= caretMaxOffset(startNode) && startNode->isTextNode()) {
424 Text *text = static_cast<Text *>(startNode); 426 Text *text = static_cast<Text *>(startNode);
425 if (text->length() > (unsigned)caretMaxOffset(startNode)) 427 if (text->length() > (unsigned)caretMaxOffset(startNode))
426 deleteTextFromNode(text, caretMaxOffset(startNode), text->length() - caretMaxOffset(startNode)); 428 deleteTextFromNode(text, caretMaxOffset(startNode), text->length() - caretMaxOffset(startNode));
427 } 429 }
428 430
429 if (startOffset >= lastOffsetForEditing(startNode)) { 431 if (startOffset >= lastOffsetForEditing(startNode)) {
430 startNode = startNode->traverseNextSibling(); 432 startNode = startNode->traverseNextSibling();
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 858
857 // Normally deletion doesn't preserve the typing style that was present before i t. For example, 859 // Normally deletion doesn't preserve the typing style that was present before i t. For example,
858 // type a character, Bold, then delete the character and start typing. The Bold typing style shouldn't 860 // type a character, Bold, then delete the character and start typing. The Bold typing style shouldn't
859 // stick around. Deletion should preserve a typing style that *it* sets, howeve r. 861 // stick around. Deletion should preserve a typing style that *it* sets, howeve r.
860 bool DeleteSelectionCommand::preservesTypingStyle() const 862 bool DeleteSelectionCommand::preservesTypingStyle() const
861 { 863 {
862 return m_typingStyle; 864 return m_typingStyle;
863 } 865 }
864 866
865 } // namespace WebCore 867 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/editing/deleting/delete-start-block-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698