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

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

Issue 667403002: Rename nodes/elements traversal function names. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rename to startsAt (and startsAfter) Created 6 years, 2 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/dom/VisitedLinkState.cpp ('k') | Source/core/editing/EditingStyle.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, 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 2007, 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 793 matching lines...) Expand 10 before | Expand all | Expand 10 after
804 804
805 void CompositeEditCommand::deleteInsignificantText(const Position& start, const Position& end) 805 void CompositeEditCommand::deleteInsignificantText(const Position& start, const Position& end)
806 { 806 {
807 if (start.isNull() || end.isNull()) 807 if (start.isNull() || end.isNull())
808 return; 808 return;
809 809
810 if (comparePositions(start, end) >= 0) 810 if (comparePositions(start, end) >= 0)
811 return; 811 return;
812 812
813 WillBeHeapVector<RefPtrWillBeMember<Text> > nodes; 813 WillBeHeapVector<RefPtrWillBeMember<Text> > nodes;
814 for (Node& node : NodeTraversal::from(start.deprecatedNode())) { 814 for (Node& node : NodeTraversal::startsAt(start.deprecatedNode())) {
815 if (node.isTextNode()) 815 if (node.isTextNode())
816 nodes.append(toText(&node)); 816 nodes.append(toText(&node));
817 if (&node == end.deprecatedNode()) 817 if (&node == end.deprecatedNode())
818 break; 818 break;
819 } 819 }
820 820
821 for (size_t i = 0; i < nodes.size(); ++i) { 821 for (size_t i = 0; i < nodes.size(); ++i) {
822 Text* textNode = nodes[i].get(); 822 Text* textNode = nodes[i].get();
823 int startOffset = textNode == start.deprecatedNode() ? start.deprecatedE ditingOffset() : 0; 823 int startOffset = textNode == start.deprecatedNode() ? start.deprecatedE ditingOffset() : 0;
824 int endOffset = textNode == end.deprecatedNode() ? end.deprecatedEditing Offset() : static_cast<int>(textNode->length()); 824 int endOffset = textNode == end.deprecatedNode() ? end.deprecatedEditing Offset() : static_cast<int>(textNode->length());
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after
1494 } 1494 }
1495 1495
1496 void CompositeEditCommand::trace(Visitor* visitor) 1496 void CompositeEditCommand::trace(Visitor* visitor)
1497 { 1497 {
1498 visitor->trace(m_commands); 1498 visitor->trace(m_commands);
1499 visitor->trace(m_composition); 1499 visitor->trace(m_composition);
1500 EditCommand::trace(visitor); 1500 EditCommand::trace(visitor);
1501 } 1501 }
1502 1502
1503 } // namespace blink 1503 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/dom/VisitedLinkState.cpp ('k') | Source/core/editing/EditingStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698