OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved. |
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 1346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1357 if (!document->layoutView()) | 1357 if (!document->layoutView()) |
1358 return false; | 1358 return false; |
1359 | 1359 |
1360 HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active); | 1360 HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active); |
1361 HitTestResult result(request, point); | 1361 HitTestResult result(request, point); |
1362 document->layoutView()->hitTest(result); | 1362 document->layoutView()->hitTest(result); |
1363 Node* innerNode = result.innerNode(); | 1363 Node* innerNode = result.innerNode(); |
1364 if (!innerNode || !innerNode->layoutObject()) | 1364 if (!innerNode || !innerNode->layoutObject()) |
1365 return false; | 1365 return false; |
1366 | 1366 |
1367 VisiblePosition visiblePos(innerNode->layoutObject()->positionForPoint(resul
t.localPoint())); | 1367 VisiblePosition visiblePos = visiblePositionOf(innerNode->layoutObject()->po
sitionForPoint(result.localPoint())); |
1368 if (visiblePos.isNull()) | 1368 if (visiblePos.isNull()) |
1369 return false; | 1369 return false; |
1370 | 1370 |
1371 VisiblePosition visibleStart = Strategy::selectionVisibleStart(m_selection); | 1371 VisiblePosition visibleStart = Strategy::selectionVisibleStart(m_selection); |
1372 VisiblePosition visibleEnd = Strategy::selectionVisibleEnd(m_selection); | 1372 VisiblePosition visibleEnd = Strategy::selectionVisibleEnd(m_selection); |
1373 if (visibleStart.isNull() || visibleEnd.isNull()) | 1373 if (visibleStart.isNull() || visibleEnd.isNull()) |
1374 return false; | 1374 return false; |
1375 | 1375 |
1376 PositionType start(Strategy::toPositionType(visibleStart.deepEquivalent())); | 1376 PositionType start(Strategy::toPositionType(visibleStart.deepEquivalent())); |
1377 PositionType end(Strategy::toPositionType(visibleEnd.deepEquivalent())); | 1377 PositionType end(Strategy::toPositionType(visibleEnd.deepEquivalent())); |
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2069 | 2069 |
2070 void showTree(const blink::FrameSelection* sel) | 2070 void showTree(const blink::FrameSelection* sel) |
2071 { | 2071 { |
2072 if (sel) | 2072 if (sel) |
2073 sel->showTreeForThis(); | 2073 sel->showTreeForThis(); |
2074 else | 2074 else |
2075 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n"); | 2075 fprintf(stderr, "Cannot showTree for (nil) FrameSelection.\n"); |
2076 } | 2076 } |
2077 | 2077 |
2078 #endif | 2078 #endif |
OLD | NEW |