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

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

Issue 420323002: Move Node::lastDescendantOrSelf() to NodeTraversal and rename to lastWithinOrSelf() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 4 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/ReplaceSelectionCommand.cpp ('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) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed.
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 976 matching lines...) Expand 10 before | Expand all | Expand 10 after
987 root = box->root().nextRootBox(); 987 root = box->root().nextRootBox();
988 // We want to skip zero height boxes. 988 // We want to skip zero height boxes.
989 // This could happen in case it is a TrailingFloatsRootInlineBox. 989 // This could happen in case it is a TrailingFloatsRootInlineBox.
990 if (!root || !root->logicalHeight() || !root->firstLeafChild()) 990 if (!root || !root->logicalHeight() || !root->firstLeafChild())
991 root = 0; 991 root = 0;
992 } 992 }
993 993
994 if (!root) { 994 if (!root) {
995 // FIXME: We need do the same in previousLinePosition. 995 // FIXME: We need do the same in previousLinePosition.
996 Node* child = node->traverseToChildAt(p.deprecatedEditingOffset()); 996 Node* child = node->traverseToChildAt(p.deprecatedEditingOffset());
997 node = child ? child : &node->lastDescendantOrSelf(); 997 node = child ? child : &NodeTraversal::lastWithinOrSelf(*node);
998 Position position = nextRootInlineBoxCandidatePosition(node, visiblePosi tion, editableType); 998 Position position = nextRootInlineBoxCandidatePosition(node, visiblePosi tion, editableType);
999 if (position.isNotNull()) { 999 if (position.isNotNull()) {
1000 RenderedPosition renderedPosition((VisiblePosition(position))); 1000 RenderedPosition renderedPosition((VisiblePosition(position)));
1001 root = renderedPosition.rootBox(); 1001 root = renderedPosition.rootBox();
1002 if (!root) 1002 if (!root)
1003 return VisiblePosition(position); 1003 return VisiblePosition(position);
1004 } 1004 }
1005 } 1005 }
1006 1006
1007 if (root) { 1007 if (root) {
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
1380 { 1380 {
1381 return direction == LTR ? logicalStartOfLine(c) : logicalEndOfLine(c); 1381 return direction == LTR ? logicalStartOfLine(c) : logicalEndOfLine(c);
1382 } 1382 }
1383 1383
1384 VisiblePosition rightBoundaryOfLine(const VisiblePosition& c, TextDirection dire ction) 1384 VisiblePosition rightBoundaryOfLine(const VisiblePosition& c, TextDirection dire ction)
1385 { 1385 {
1386 return direction == LTR ? logicalEndOfLine(c) : logicalStartOfLine(c); 1386 return direction == LTR ? logicalEndOfLine(c) : logicalStartOfLine(c);
1387 } 1387 }
1388 1388
1389 } 1389 }
OLDNEW
« no previous file with comments | « Source/core/editing/ReplaceSelectionCommand.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698