Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: Source/core/editing/FrameSelection.cpp

Issue 1032823003: Refactor HitTestResult to store the HitTestRequest (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated as per review comments Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/dom/TreeScope.cpp ('k') | Source/core/frame/LocalFrame.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « Source/core/dom/TreeScope.cpp ('k') | Source/core/frame/LocalFrame.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698