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

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

Issue 171773008: Rename childNodeCount() / childNode() methods for clarity (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Further renaming for consistency Created 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/editing/CompositeEditCommand.cpp ('k') | Source/core/editing/Editor.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 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 // The selection to delete spans more than one node. 494 // The selection to delete spans more than one node.
495 RefPtr<Node> node(startNode); 495 RefPtr<Node> node(startNode);
496 496
497 if (startOffset > 0) { 497 if (startOffset > 0) {
498 if (startNode->isTextNode()) { 498 if (startNode->isTextNode()) {
499 // in a text node that needs to be trimmed 499 // in a text node that needs to be trimmed
500 Text* text = toText(node); 500 Text* text = toText(node);
501 deleteTextFromNode(text, startOffset, text->length() - startOffs et); 501 deleteTextFromNode(text, startOffset, text->length() - startOffs et);
502 node = NodeTraversal::next(*node); 502 node = NodeTraversal::next(*node);
503 } else { 503 } else {
504 node = startNode->childNode(startOffset); 504 node = startNode->traverseToChildAt(startOffset);
505 } 505 }
506 } else if (startNode == m_upstreamEnd.deprecatedNode() && startNode->isT extNode()) { 506 } else if (startNode == m_upstreamEnd.deprecatedNode() && startNode->isT extNode()) {
507 Text* text = toText(m_upstreamEnd.deprecatedNode()); 507 Text* text = toText(m_upstreamEnd.deprecatedNode());
508 deleteTextFromNode(text, 0, m_upstreamEnd.deprecatedEditingOffset()) ; 508 deleteTextFromNode(text, 0, m_upstreamEnd.deprecatedEditingOffset()) ;
509 } 509 }
510 510
511 // handle deleting all nodes that are completely selected 511 // handle deleting all nodes that are completely selected
512 while (node && node != m_downstreamEnd.deprecatedNode()) { 512 while (node && node != m_downstreamEnd.deprecatedNode()) {
513 if (comparePositions(firstPositionInOrBeforeNode(node.get()), m_down streamEnd) >= 0) { 513 if (comparePositions(firstPositionInOrBeforeNode(node.get()), m_down streamEnd) >= 0) {
514 // NodeTraversal::nextSkippingChildren just blew past the end po sition, so stop deleting 514 // NodeTraversal::nextSkippingChildren just blew past the end po sition, so stop deleting
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
862 862
863 // Normally deletion doesn't preserve the typing style that was present before i t. For example, 863 // Normally deletion doesn't preserve the typing style that was present before i t. For example,
864 // type a character, Bold, then delete the character and start typing. The Bold typing style shouldn't 864 // type a character, Bold, then delete the character and start typing. The Bold typing style shouldn't
865 // stick around. Deletion should preserve a typing style that *it* sets, howeve r. 865 // stick around. Deletion should preserve a typing style that *it* sets, howeve r.
866 bool DeleteSelectionCommand::preservesTypingStyle() const 866 bool DeleteSelectionCommand::preservesTypingStyle() const
867 { 867 {
868 return m_typingStyle; 868 return m_typingStyle;
869 } 869 }
870 870
871 } // namespace WebCore 871 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/editing/CompositeEditCommand.cpp ('k') | Source/core/editing/Editor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698