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 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1029 if (box) { | 1029 if (box) { |
1030 root = box->root().nextRootBox(); | 1030 root = box->root().nextRootBox(); |
1031 // We want to skip zero height boxes. | 1031 // We want to skip zero height boxes. |
1032 // This could happen in case it is a TrailingFloatsRootInlineBox. | 1032 // This could happen in case it is a TrailingFloatsRootInlineBox. |
1033 if (!root || !root->logicalHeight() || !root->firstLeafChild()) | 1033 if (!root || !root->logicalHeight() || !root->firstLeafChild()) |
1034 root = 0; | 1034 root = 0; |
1035 } | 1035 } |
1036 | 1036 |
1037 if (!root) { | 1037 if (!root) { |
1038 // FIXME: We need do the same in previousLinePosition. | 1038 // FIXME: We need do the same in previousLinePosition. |
1039 Node* child = NodeTraversal::childAt(*node, p.deprecatedEditingOffset())
; | 1039 Node* child = NodeTraversal::childAt(*node, p.computeEditingOffset()); |
1040 node = child ? child : &NodeTraversal::lastWithinOrSelf(*node); | 1040 node = child ? child : &NodeTraversal::lastWithinOrSelf(*node); |
1041 Position position = nextRootInlineBoxCandidatePosition(node, visiblePosi
tion, editableType); | 1041 Position position = nextRootInlineBoxCandidatePosition(node, visiblePosi
tion, editableType); |
1042 if (position.isNotNull()) { | 1042 if (position.isNotNull()) { |
1043 RenderedPosition renderedPosition((VisiblePosition(position))); | 1043 RenderedPosition renderedPosition((VisiblePosition(position))); |
1044 root = renderedPosition.rootBox(); | 1044 root = renderedPosition.rootBox(); |
1045 if (!root) | 1045 if (!root) |
1046 return VisiblePosition(position); | 1046 return VisiblePosition(position); |
1047 } | 1047 } |
1048 } | 1048 } |
1049 | 1049 |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1452 HitTestRequest request = HitTestRequest::Move | HitTestRequest::ReadOnly | H
itTestRequest::Active | HitTestRequest::IgnoreClipping; | 1452 HitTestRequest request = HitTestRequest::Move | HitTestRequest::ReadOnly | H
itTestRequest::Active | HitTestRequest::IgnoreClipping; |
1453 HitTestResult result(request, contentsPoint); | 1453 HitTestResult result(request, contentsPoint); |
1454 frame->document()->layoutView()->hitTest(result); | 1454 frame->document()->layoutView()->hitTest(result); |
1455 | 1455 |
1456 if (Node* node = result.innerNode()) | 1456 if (Node* node = result.innerNode()) |
1457 return frame->selection().selection().visiblePositionRespectingEditingBo
undary(result.localPoint(), node); | 1457 return frame->selection().selection().visiblePositionRespectingEditingBo
undary(result.localPoint(), node); |
1458 return VisiblePosition(); | 1458 return VisiblePosition(); |
1459 } | 1459 } |
1460 | 1460 |
1461 } | 1461 } |
OLD | NEW |