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

Side by Side Diff: Source/core/editing/InsertParagraphSeparatorCommand.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/Editor.cpp ('k') | Source/core/editing/MarkupAccumulator.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 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2005, 2006 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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 insertNodeBefore(listChildToInsert.get(), listChild); 273 insertNodeBefore(listChildToInsert.get(), listChild);
274 } else { 274 } else {
275 refNode = startBlock.get(); 275 refNode = startBlock.get();
276 } 276 }
277 } else if (isFirstInBlock && nestNewBlock) { 277 } else if (isFirstInBlock && nestNewBlock) {
278 // startBlock should always have children, otherwise isLastInBlock w ould be true and it's handled above. 278 // startBlock should always have children, otherwise isLastInBlock w ould be true and it's handled above.
279 ASSERT(startBlock->firstChild()); 279 ASSERT(startBlock->firstChild());
280 refNode = startBlock->firstChild(); 280 refNode = startBlock->firstChild();
281 } 281 }
282 else if (insertionPosition.deprecatedNode() == startBlock && nestNewBloc k) { 282 else if (insertionPosition.deprecatedNode() == startBlock && nestNewBloc k) {
283 refNode = startBlock->childNode(insertionPosition.deprecatedEditingO ffset()); 283 refNode = startBlock->traverseToChildAt(insertionPosition.deprecated EditingOffset());
284 ASSERT(refNode); // must be true or we'd be in the end of block case 284 ASSERT(refNode); // must be true or we'd be in the end of block case
285 } else 285 } else
286 refNode = insertionPosition.deprecatedNode(); 286 refNode = insertionPosition.deprecatedNode();
287 287
288 // find ending selection position easily before inserting the paragraph 288 // find ending selection position easily before inserting the paragraph
289 insertionPosition = insertionPosition.downstream(); 289 insertionPosition = insertionPosition.downstream();
290 290
291 if (refNode) 291 if (refNode)
292 insertNodeBefore(blockToInsert, refNode); 292 insertNodeBefore(blockToInsert, refNode);
293 293
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 if (positionAfterSplit.deprecatedNode()->isTextNode()) 419 if (positionAfterSplit.deprecatedNode()->isTextNode())
420 insertTextIntoNode(toText(positionAfterSplit.containerNode()), 0 , nonBreakingSpaceString()); 420 insertTextIntoNode(toText(positionAfterSplit.containerNode()), 0 , nonBreakingSpaceString());
421 } 421 }
422 } 422 }
423 423
424 setEndingSelection(VisibleSelection(firstPositionInNode(blockToInsert.get()) , DOWNSTREAM, endingSelection().isDirectional())); 424 setEndingSelection(VisibleSelection(firstPositionInNode(blockToInsert.get()) , DOWNSTREAM, endingSelection().isDirectional()));
425 applyStyleAfterInsertion(startBlock.get()); 425 applyStyleAfterInsertion(startBlock.get());
426 } 426 }
427 427
428 } // namespace WebCore 428 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/editing/Editor.cpp ('k') | Source/core/editing/MarkupAccumulator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698