| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 // hitTestResultAtPoint() takes a padding rectangle. | 477 // hitTestResultAtPoint() takes a padding rectangle. |
| 478 // FIXME: We'll be off by 1 when the width or height is even. | 478 // FIXME: We'll be off by 1 when the width or height is even. |
| 479 IntRect documentRect(x() + rect.x, y() + rect.y, rect.width, rect.height); | 479 IntRect documentRect(x() + rect.x, y() + rect.y, rect.width, rect.height); |
| 480 LayoutPoint center = documentRect.center(); | 480 LayoutPoint center = documentRect.center(); |
| 481 // Make the rect we're checking (the point surrounded by padding rects) cont
ained inside the requested rect. (Note that -1/2 is 0.) | 481 // Make the rect we're checking (the point surrounded by padding rects) cont
ained inside the requested rect. (Note that -1/2 is 0.) |
| 482 LayoutSize padding((documentRect.width() - 1) / 2, (documentRect.height() -
1) / 2); | 482 LayoutSize padding((documentRect.width() - 1) / 2, (documentRect.height() -
1) / 2); |
| 483 HitTestResult result = frame->eventHandler()->hitTestResultAtPoint(center, H
itTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::DisallowShado
wContent, padding); | 483 HitTestResult result = frame->eventHandler()->hitTestResultAtPoint(center, H
itTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::DisallowShado
wContent, padding); |
| 484 const HitTestResult::NodeSet& nodes = result.rectBasedTestResult(); | 484 const HitTestResult::NodeSet& nodes = result.rectBasedTestResult(); |
| 485 if (nodes.size() != 1) | 485 if (nodes.size() != 1) |
| 486 return false; | 486 return false; |
| 487 return (nodes.first().get() == m_element); | 487 return nodes.first().get() == m_element; |
| 488 } | 488 } |
| 489 | 489 |
| 490 void WebPluginContainerImpl::requestTouchEventType(TouchEventRequestType request
Type) | 490 void WebPluginContainerImpl::requestTouchEventType(TouchEventRequestType request
Type) |
| 491 { | 491 { |
| 492 if (m_touchEventRequestType == requestType) | 492 if (m_touchEventRequestType == requestType) |
| 493 return; | 493 return; |
| 494 | 494 |
| 495 if (requestType != TouchEventRequestTypeNone && m_touchEventRequestType == T
ouchEventRequestTypeNone) | 495 if (requestType != TouchEventRequestTypeNone && m_touchEventRequestType == T
ouchEventRequestTypeNone) |
| 496 m_element->document()->didAddTouchEventHandler(m_element); | 496 m_element->document()->didAddTouchEventHandler(m_element); |
| 497 else if (requestType == TouchEventRequestTypeNone && m_touchEventRequestType
!= TouchEventRequestTypeNone) | 497 else if (requestType == TouchEventRequestTypeNone && m_touchEventRequestType
!= TouchEventRequestTypeNone) |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 886 // Take our element and get the clip rect from the enclosing layer and | 886 // Take our element and get the clip rect from the enclosing layer and |
| 887 // frame view. | 887 // frame view. |
| 888 clipRect.intersect( | 888 clipRect.intersect( |
| 889 m_element->document()->view()->windowClipRectForFrameOwner(m_element
, true)); | 889 m_element->document()->view()->windowClipRectForFrameOwner(m_element
, true)); |
| 890 } | 890 } |
| 891 | 891 |
| 892 return clipRect; | 892 return clipRect; |
| 893 } | 893 } |
| 894 | 894 |
| 895 } // namespace WebKit | 895 } // namespace WebKit |
| OLD | NEW |