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

Side by Side Diff: Source/web/WebPluginContainerImpl.cpp

Issue 869813003: Implement elementsFromPoint (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix typeo Created 5 years, 11 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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * Copyright (C) 2014 Opera Software ASA. All rights reserved. 3 * Copyright (C) 2014 Opera Software ASA. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 LocalFrame* frame = m_element->document().frame(); 501 LocalFrame* frame = m_element->document().frame();
502 if (!frame) 502 if (!frame)
503 return false; 503 return false;
504 504
505 // hitTestResultAtPoint() takes a padding rectangle. 505 // hitTestResultAtPoint() takes a padding rectangle.
506 // FIXME: We'll be off by 1 when the width or height is even. 506 // FIXME: We'll be off by 1 when the width or height is even.
507 IntRect documentRect(x() + rect.x, y() + rect.y, rect.width, rect.height); 507 IntRect documentRect(x() + rect.x, y() + rect.y, rect.width, rect.height);
508 LayoutPoint center = documentRect.center(); 508 LayoutPoint center = documentRect.center();
509 // Make the rect we're checking (the point surrounded by padding rects) cont ained inside the requested rect. (Note that -1/2 is 0.) 509 // Make the rect we're checking (the point surrounded by padding rects) cont ained inside the requested rect. (Note that -1/2 is 0.)
510 LayoutSize padding((documentRect.width() - 1) / 2, (documentRect.height() - 1) / 2); 510 LayoutSize padding((documentRect.width() - 1) / 2, (documentRect.height() - 1) / 2);
511 HitTestResult result = frame->eventHandler().hitTestResultAtPoint(center, Hi tTestRequest::ReadOnly | HitTestRequest::Active, padding); 511 HitTestResult result = frame->eventHandler().hitTestResultAtPoint(center, Hi tTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::ListBased, pad ding);
512 const HitTestResult::NodeSet& nodes = result.rectBasedTestResult(); 512 const HitTestResult::NodeSet& nodes = result.listBasedTestResult();
513 if (nodes.size() != 1) 513 if (nodes.size() != 1)
514 return false; 514 return false;
515 return nodes.first().get() == m_element; 515 return nodes.first().get() == m_element;
516 } 516 }
517 517
518 void WebPluginContainerImpl::requestTouchEventType(TouchEventRequestType request Type) 518 void WebPluginContainerImpl::requestTouchEventType(TouchEventRequestType request Type)
519 { 519 {
520 if (m_touchEventRequestType == requestType) 520 if (m_touchEventRequestType == requestType)
521 return; 521 return;
522 522
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
982 982
983 return clipRect; 983 return clipRect;
984 } 984 }
985 985
986 bool WebPluginContainerImpl::pluginShouldPersist() const 986 bool WebPluginContainerImpl::pluginShouldPersist() const
987 { 987 {
988 return m_webPlugin->shouldPersist(); 988 return m_webPlugin->shouldPersist();
989 } 989 }
990 990
991 } // namespace blink 991 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698