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 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1128 if (!startNode) | 1128 if (!startNode) |
1129 return VisiblePosition(); | 1129 return VisiblePosition(); |
1130 | 1130 |
1131 if (isRenderedAsNonInlineTableImageOrHR(startNode)) | 1131 if (isRenderedAsNonInlineTableImageOrHR(startNode)) |
1132 return VisiblePosition(positionBeforeNode(startNode)); | 1132 return VisiblePosition(positionBeforeNode(startNode)); |
1133 | 1133 |
1134 Element* startBlock = enclosingBlock(startNode); | 1134 Element* startBlock = enclosingBlock(startNode); |
1135 | 1135 |
1136 Node* node = startNode; | 1136 Node* node = startNode; |
1137 ContainerNode* highestRoot = highestEditableRoot(p); | 1137 ContainerNode* highestRoot = highestEditableRoot(p); |
1138 int offset = p.deprecatedEditingOffset(); | 1138 int offset = p.computeEditingOffset(); |
1139 PositionAnchorType type = p.anchorType(); | 1139 PositionAnchorType type = p.anchorType(); |
1140 | 1140 |
1141 Node* n = startNode; | 1141 Node* n = startNode; |
1142 bool startNodeIsEditable = startNode->hasEditableStyle(); | 1142 bool startNodeIsEditable = startNode->hasEditableStyle(); |
1143 while (n) { | 1143 while (n) { |
1144 if (boundaryCrossingRule == CannotCrossEditingBoundary && !Position::nod
eIsUserSelectAll(n) && n->hasEditableStyle() != startNodeIsEditable) | 1144 if (boundaryCrossingRule == CannotCrossEditingBoundary && !Position::nod
eIsUserSelectAll(n) && n->hasEditableStyle() != startNodeIsEditable) |
1145 break; | 1145 break; |
1146 if (boundaryCrossingRule == CanSkipOverEditingBoundary) { | 1146 if (boundaryCrossingRule == CanSkipOverEditingBoundary) { |
1147 while (n && n->hasEditableStyle() != startNodeIsEditable) | 1147 while (n && n->hasEditableStyle() != startNodeIsEditable) |
1148 n = NodeTraversal::previousPostOrder(*n, startBlock); | 1148 n = NodeTraversal::previousPostOrder(*n, startBlock); |
(...skipping 303 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 |