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

Side by Side Diff: sky/engine/core/editing/DeleteSelectionCommand.cpp

Issue 772743004: Remove more Node API. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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 | « sky/engine/core/dom/Range.cpp ('k') | sky/engine/core/editing/htmlediting.cpp » ('j') | 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 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 if (m_upstreamStart.isNull()) 351 if (m_upstreamStart.isNull())
352 return; 352 return;
353 353
354 int startOffset = m_upstreamStart.deprecatedEditingOffset(); 354 int startOffset = m_upstreamStart.deprecatedEditingOffset();
355 Node* startNode = m_upstreamStart.deprecatedNode(); 355 Node* startNode = m_upstreamStart.deprecatedNode();
356 ASSERT(startNode); 356 ASSERT(startNode);
357 357
358 makeStylingElementsDirectChildrenOfEditableRootToPreventStyleLoss(); 358 makeStylingElementsDirectChildrenOfEditableRootToPreventStyleLoss();
359 359
360 // Never remove the start block unless it's a table, in which case we won't merge content in. 360 // Never remove the start block unless it's a table, in which case we won't merge content in.
361 if (startNode->isSameNode(m_startBlock.get()) && !startOffset && canHaveChil drenForEditing(startNode)) { 361 if (startNode == m_startBlock && !startOffset && canHaveChildrenForEditing(s tartNode)) {
362 startOffset = 0; 362 startOffset = 0;
363 startNode = NodeTraversal::next(*startNode); 363 startNode = NodeTraversal::next(*startNode);
364 if (!startNode) 364 if (!startNode)
365 return; 365 return;
366 } 366 }
367 367
368 if (startOffset >= caretMaxOffset(startNode) && startNode->isTextNode()) { 368 if (startOffset >= caretMaxOffset(startNode) && startNode->isTextNode()) {
369 Text* text = toText(startNode); 369 Text* text = toText(startNode);
370 if (text->length() > (unsigned)caretMaxOffset(startNode)) 370 if (text->length() > (unsigned)caretMaxOffset(startNode))
371 deleteTextFromNode(text, caretMaxOffset(startNode), text->length() - caretMaxOffset(startNode)); 371 deleteTextFromNode(text, caretMaxOffset(startNode), text->length() - caretMaxOffset(startNode));
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 667
668 // Normally deletion doesn't preserve the typing style that was present before i t. For example, 668 // Normally deletion doesn't preserve the typing style that was present before i t. For example,
669 // type a character, Bold, then delete the character and start typing. The Bold typing style shouldn't 669 // type a character, Bold, then delete the character and start typing. The Bold typing style shouldn't
670 // stick around. Deletion should preserve a typing style that *it* sets, howeve r. 670 // stick around. Deletion should preserve a typing style that *it* sets, howeve r.
671 bool DeleteSelectionCommand::preservesTypingStyle() const 671 bool DeleteSelectionCommand::preservesTypingStyle() const
672 { 672 {
673 return false; 673 return false;
674 } 674 }
675 675
676 } // namespace blink 676 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/dom/Range.cpp ('k') | sky/engine/core/editing/htmlediting.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698