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 2160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2171 return false; | 2171 return false; |
2172 } | 2172 } |
2173 | 2173 |
2174 VisiblePosition visiblePositionForContentsPoint(const IntPoint& contentsPoint, L
ocalFrame* frame) | 2174 VisiblePosition visiblePositionForContentsPoint(const IntPoint& contentsPoint, L
ocalFrame* frame) |
2175 { | 2175 { |
2176 HitTestRequest request = HitTestRequest::Move | HitTestRequest::ReadOnly | H
itTestRequest::Active | HitTestRequest::IgnoreClipping; | 2176 HitTestRequest request = HitTestRequest::Move | HitTestRequest::ReadOnly | H
itTestRequest::Active | HitTestRequest::IgnoreClipping; |
2177 HitTestResult result(request, contentsPoint); | 2177 HitTestResult result(request, contentsPoint); |
2178 frame->document()->layoutViewItem().hitTest(result); | 2178 frame->document()->layoutViewItem().hitTest(result); |
2179 | 2179 |
2180 if (Node* node = result.innerNode()) | 2180 if (Node* node = result.innerNode()) |
2181 return frame->selection().selection().visiblePositionRespectingEditingBo
undary(result.localPoint(), node); | 2181 return createVisiblePosition(positionRespectingEditingBoundary(frame->se
lection().selection().start(), result.localPoint(), node)); |
2182 return VisiblePosition(); | 2182 return VisiblePosition(); |
2183 } | 2183 } |
2184 | 2184 |
2185 // TODO(yosin): We should use |associatedLayoutObjectOf()| in "VisibleUnits.cpp" | 2185 // TODO(yosin): We should use |associatedLayoutObjectOf()| in "VisibleUnits.cpp" |
2186 // where it takes |LayoutObject| from |Position|. | 2186 // where it takes |LayoutObject| from |Position|. |
2187 // Note about ::first-letter pseudo-element: | 2187 // Note about ::first-letter pseudo-element: |
2188 // When an element has ::first-letter pseudo-element, first letter characters | 2188 // When an element has ::first-letter pseudo-element, first letter characters |
2189 // are taken from |Text| node and first letter characters are considered | 2189 // are taken from |Text| node and first letter characters are considered |
2190 // as content of <pseudo:first-letter>. | 2190 // as content of <pseudo:first-letter>. |
2191 // For following HTML, | 2191 // For following HTML, |
(...skipping 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3251 { | 3251 { |
3252 return previousPositionOfAlgorithm<EditingStrategy>(visiblePosition, rule); | 3252 return previousPositionOfAlgorithm<EditingStrategy>(visiblePosition, rule); |
3253 } | 3253 } |
3254 | 3254 |
3255 VisiblePositionInFlatTree previousPositionOf(const VisiblePositionInFlatTree& vi
siblePosition, EditingBoundaryCrossingRule rule) | 3255 VisiblePositionInFlatTree previousPositionOf(const VisiblePositionInFlatTree& vi
siblePosition, EditingBoundaryCrossingRule rule) |
3256 { | 3256 { |
3257 return previousPositionOfAlgorithm<EditingInFlatTreeStrategy>(visiblePositio
n, rule); | 3257 return previousPositionOfAlgorithm<EditingInFlatTreeStrategy>(visiblePositio
n, rule); |
3258 } | 3258 } |
3259 | 3259 |
3260 } // namespace blink | 3260 } // namespace blink |
OLD | NEW |