| 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 975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 986 if (box) { | 986 if (box) { |
| 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 = NodeTraversal::childAt(*node, p.deprecatedEditingOffset())
; |
| 997 node = child ? child : &NodeTraversal::lastWithinOrSelf(*node); | 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 |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1402 int caretOffset; | 1402 int caretOffset; |
| 1403 position.position().getInlineBoxAndOffset(position.affinity(), inlineBox, ca
retOffset); | 1403 position.position().getInlineBoxAndOffset(position.affinity(), inlineBox, ca
retOffset); |
| 1404 | 1404 |
| 1405 if (inlineBox) | 1405 if (inlineBox) |
| 1406 renderer = &inlineBox->renderer(); | 1406 renderer = &inlineBox->renderer(); |
| 1407 | 1407 |
| 1408 return renderer->localCaretRect(inlineBox, caretOffset); | 1408 return renderer->localCaretRect(inlineBox, caretOffset); |
| 1409 } | 1409 } |
| 1410 | 1410 |
| 1411 } | 1411 } |
| OLD | NEW |