OLD | NEW |
---|---|
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 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
752 static_cast<WebDragOperationsMask>(dataTransfer->sourceOperation()); | 752 static_cast<WebDragOperationsMask>(dataTransfer->sourceOperation()); |
753 WebPoint dragScreenLocation(event->screenX(), event->screenY()); | 753 WebPoint dragScreenLocation(event->screenX(), event->screenY()); |
754 WebPoint dragLocation(event->absoluteLocation().x() - location().x(), | 754 WebPoint dragLocation(event->absoluteLocation().x() - location().x(), |
755 event->absoluteLocation().y() - location().y()); | 755 event->absoluteLocation().y() - location().y()); |
756 | 756 |
757 m_webPlugin->handleDragStatusUpdate(dragStatus, dragData, dragOperationMask, | 757 m_webPlugin->handleDragStatusUpdate(dragStatus, dragData, dragOperationMask, |
758 dragLocation, dragScreenLocation); | 758 dragLocation, dragScreenLocation); |
759 } | 759 } |
760 | 760 |
761 void WebPluginContainerImpl::handleWheelEvent(WheelEvent* event) { | 761 void WebPluginContainerImpl::handleWheelEvent(WheelEvent* event) { |
762 WebMouseWheelEventBuilder webEvent( | 762 WebMouseWheelEvent translatedEvent = event->nativeEvent(); |
763 this, LayoutItem(m_element->layoutObject()), *event); | 763 WebFloatPoint absoluteRootFrameLocation = |
764 if (webEvent.type == WebInputEvent::Undefined) | 764 event->nativeEvent().positionInRootFrame(); |
765 return; | 765 IntPoint localPoint = |
766 roundedIntPoint(m_element->layoutObject()->absoluteToLocal( | |
majidvp
2016/12/20 17:30:15
can |m_element->layoutObject()| be nil? Should we
dtapuska
2017/01/03 20:19:14
Other places use it unconditionally. I can add a D
| |
767 absoluteRootFrameLocation, UseTransforms)); | |
768 translatedEvent.flattenTransform(); | |
769 translatedEvent.x = localPoint.x(); | |
770 translatedEvent.y = localPoint.y(); | |
majidvp
2016/12/20 17:30:15
he fact that we are doing a flatten but then overr
dtapuska
2017/01/03 20:19:14
Ya I don't know what the best answer here is. But
majidvp
2017/01/04 17:32:46
Fair enough. I filed https://crbug.com/678291 to t
| |
766 | 771 |
767 WebCursorInfo cursorInfo; | 772 WebCursorInfo cursorInfo; |
768 if (m_webPlugin->handleInputEvent(webEvent, cursorInfo) != | 773 if (m_webPlugin->handleInputEvent(translatedEvent, cursorInfo) != |
769 WebInputEventResult::NotHandled) | 774 WebInputEventResult::NotHandled) |
770 event->setDefaultHandled(); | 775 event->setDefaultHandled(); |
771 } | 776 } |
772 | 777 |
773 void WebPluginContainerImpl::handleKeyboardEvent(KeyboardEvent* event) { | 778 void WebPluginContainerImpl::handleKeyboardEvent(KeyboardEvent* event) { |
774 WebKeyboardEventBuilder webEvent(*event); | 779 WebKeyboardEventBuilder webEvent(*event); |
775 if (webEvent.type == WebInputEvent::Undefined) | 780 if (webEvent.type == WebInputEvent::Undefined) |
776 return; | 781 return; |
777 | 782 |
778 if (webEvent.type == WebInputEvent::KeyDown) { | 783 if (webEvent.type == WebInputEvent::KeyDown) { |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
970 // frame view. | 975 // frame view. |
971 computeClipRectsForPlugin(m_element, windowRect, clipRect, unobscuredRect); | 976 computeClipRectsForPlugin(m_element, windowRect, clipRect, unobscuredRect); |
972 } | 977 } |
973 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects); | 978 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects); |
974 // Convert to the plugin position. | 979 // Convert to the plugin position. |
975 for (size_t i = 0; i < cutOutRects.size(); i++) | 980 for (size_t i = 0; i < cutOutRects.size(); i++) |
976 cutOutRects[i].move(-frameRect().x(), -frameRect().y()); | 981 cutOutRects[i].move(-frameRect().x(), -frameRect().y()); |
977 } | 982 } |
978 | 983 |
979 } // namespace blink | 984 } // namespace blink |
OLD | NEW |