OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |