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 1281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1292 { | 1292 { |
1293 Document* document = m_frame->document(); | 1293 Document* document = m_frame->document(); |
1294 | 1294 |
1295 // Treat a collapsed selection like no selection. | 1295 // Treat a collapsed selection like no selection. |
1296 if (!isRange()) | 1296 if (!isRange()) |
1297 return false; | 1297 return false; |
1298 if (!document->layoutView()) | 1298 if (!document->layoutView()) |
1299 return false; | 1299 return false; |
1300 | 1300 |
1301 HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active); | 1301 HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active); |
1302 HitTestResult result(point); | 1302 HitTestResult result(request, point); |
1303 document->layoutView()->hitTest(request, result); | 1303 document->layoutView()->hitTest(result); |
1304 Node* innerNode = result.innerNode(); | 1304 Node* innerNode = result.innerNode(); |
1305 if (!innerNode || !innerNode->layoutObject()) | 1305 if (!innerNode || !innerNode->layoutObject()) |
1306 return false; | 1306 return false; |
1307 | 1307 |
1308 VisiblePosition visiblePos(innerNode->layoutObject()->positionForPoint(resul
t.localPoint())); | 1308 VisiblePosition visiblePos(innerNode->layoutObject()->positionForPoint(resul
t.localPoint())); |
1309 if (visiblePos.isNull()) | 1309 if (visiblePos.isNull()) |
1310 return false; | 1310 return false; |
1311 | 1311 |
1312 if (m_selection.visibleStart().isNull() || m_selection.visibleEnd().isNull()
) | 1312 if (m_selection.visibleStart().isNull() || m_selection.visibleEnd().isNull()
) |
1313 return false; | 1313 return false; |
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1950 sel.showTreeForThis(); | 1950 sel.showTreeForThis(); |
1951 } | 1951 } |
1952 | 1952 |
1953 void showTree(const blink::FrameSelection* sel) | 1953 void showTree(const blink::FrameSelection* sel) |
1954 { | 1954 { |
1955 if (sel) | 1955 if (sel) |
1956 sel->showTreeForThis(); | 1956 sel->showTreeForThis(); |
1957 } | 1957 } |
1958 | 1958 |
1959 #endif | 1959 #endif |
OLD | NEW |