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 984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
995 if (box) { | 995 if (box) { |
996 root = box->root()->nextRootBox(); | 996 root = box->root()->nextRootBox(); |
997 // We want to skip zero height boxes. | 997 // We want to skip zero height boxes. |
998 // This could happen in case it is a TrailingFloatsRootInlineBox. | 998 // This could happen in case it is a TrailingFloatsRootInlineBox. |
999 if (!root || !root->logicalHeight() || !root->firstLeafChild()) | 999 if (!root || !root->logicalHeight() || !root->firstLeafChild()) |
1000 root = 0; | 1000 root = 0; |
1001 } | 1001 } |
1002 | 1002 |
1003 if (!root) { | 1003 if (!root) { |
1004 // FIXME: We need do the same in previousLinePosition. | 1004 // FIXME: We need do the same in previousLinePosition. |
1005 Node* child = node->childNode(p.deprecatedEditingOffset()); | 1005 Node* child = node->traverseToChildAt(p.deprecatedEditingOffset()); |
1006 node = child ? child : &node->lastDescendant(); | 1006 node = child ? child : &node->lastDescendant(); |
1007 Position position = nextRootInlineBoxCandidatePosition(node, visiblePosi
tion, editableType); | 1007 Position position = nextRootInlineBoxCandidatePosition(node, visiblePosi
tion, editableType); |
1008 if (position.isNotNull()) { | 1008 if (position.isNotNull()) { |
1009 RenderedPosition renderedPosition(position); | 1009 RenderedPosition renderedPosition(position); |
1010 root = renderedPosition.rootBox(); | 1010 root = renderedPosition.rootBox(); |
1011 if (!root) | 1011 if (!root) |
1012 return position; | 1012 return position; |
1013 } | 1013 } |
1014 } | 1014 } |
1015 | 1015 |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1393 { | 1393 { |
1394 return direction == LTR ? logicalStartOfLine(c) : logicalEndOfLine(c); | 1394 return direction == LTR ? logicalStartOfLine(c) : logicalEndOfLine(c); |
1395 } | 1395 } |
1396 | 1396 |
1397 VisiblePosition rightBoundaryOfLine(const VisiblePosition& c, TextDirection dire
ction) | 1397 VisiblePosition rightBoundaryOfLine(const VisiblePosition& c, TextDirection dire
ction) |
1398 { | 1398 { |
1399 return direction == LTR ? logicalEndOfLine(c) : logicalStartOfLine(c); | 1399 return direction == LTR ? logicalEndOfLine(c) : logicalStartOfLine(c); |
1400 } | 1400 } |
1401 | 1401 |
1402 } | 1402 } |
OLD | NEW |