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

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: 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
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 635 matching lines...) Expand 10 before | Expand all | Expand 10 after
1949 sel.showTreeForThis(); 1949 sel.showTreeForThis();
1950 } 1950 }
1951 1951
1952 void showTree(const blink::FrameSelection* sel) 1952 void showTree(const blink::FrameSelection* sel)
1953 { 1953 {
1954 if (sel) 1954 if (sel)
1955 sel->showTreeForThis(); 1955 sel->showTreeForThis();
1956 } 1956 }
1957 1957
1958 #endif 1958 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698