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

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

Issue 239703007: Rename Node::lastDescendant() / Node::highestAncestor() for clarity (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rename highestAncestor() as well Created 6 years, 8 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
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 978 matching lines...) Expand 10 before | Expand all | Expand 10 after
989 root = box->root().nextRootBox(); 989 root = box->root().nextRootBox();
990 // We want to skip zero height boxes. 990 // We want to skip zero height boxes.
991 // This could happen in case it is a TrailingFloatsRootInlineBox. 991 // This could happen in case it is a TrailingFloatsRootInlineBox.
992 if (!root || !root->logicalHeight() || !root->firstLeafChild()) 992 if (!root || !root->logicalHeight() || !root->firstLeafChild())
993 root = 0; 993 root = 0;
994 } 994 }
995 995
996 if (!root) { 996 if (!root) {
997 // FIXME: We need do the same in previousLinePosition. 997 // FIXME: We need do the same in previousLinePosition.
998 Node* child = node->traverseToChildAt(p.deprecatedEditingOffset()); 998 Node* child = node->traverseToChildAt(p.deprecatedEditingOffset());
999 node = child ? child : &node->lastDescendant(); 999 node = child ? child : &node->lastDescendantOrSelf();
1000 Position position = nextRootInlineBoxCandidatePosition(node, visiblePosi tion, editableType); 1000 Position position = nextRootInlineBoxCandidatePosition(node, visiblePosi tion, editableType);
1001 if (position.isNotNull()) { 1001 if (position.isNotNull()) {
1002 RenderedPosition renderedPosition((VisiblePosition(position))); 1002 RenderedPosition renderedPosition((VisiblePosition(position)));
1003 root = renderedPosition.rootBox(); 1003 root = renderedPosition.rootBox();
1004 if (!root) 1004 if (!root)
1005 return VisiblePosition(position); 1005 return VisiblePosition(position);
1006 } 1006 }
1007 } 1007 }
1008 1008
1009 if (root) { 1009 if (root) {
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
1386 { 1386 {
1387 return direction == LTR ? logicalStartOfLine(c) : logicalEndOfLine(c); 1387 return direction == LTR ? logicalStartOfLine(c) : logicalEndOfLine(c);
1388 } 1388 }
1389 1389
1390 VisiblePosition rightBoundaryOfLine(const VisiblePosition& c, TextDirection dire ction) 1390 VisiblePosition rightBoundaryOfLine(const VisiblePosition& c, TextDirection dire ction)
1391 { 1391 {
1392 return direction == LTR ? logicalEndOfLine(c) : logicalStartOfLine(c); 1392 return direction == LTR ? logicalEndOfLine(c) : logicalStartOfLine(c);
1393 } 1393 }
1394 1394
1395 } 1395 }
OLDNEW
« no previous file with comments | « Source/core/editing/ReplaceSelectionCommand.cpp ('k') | Source/core/html/FormAssociatedElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698