| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. |
| 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
| 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) | 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. 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 1797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1808 | 1808 |
| 1809 return true; | 1809 return true; |
| 1810 } | 1810 } |
| 1811 | 1811 |
| 1812 bool EventHandler::handleGestureScrollUpdate(const PlatformGestureEvent& gesture
Event) | 1812 bool EventHandler::handleGestureScrollUpdate(const PlatformGestureEvent& gesture
Event) |
| 1813 { | 1813 { |
| 1814 FloatSize delta(gestureEvent.deltaX(), gestureEvent.deltaY()); | 1814 FloatSize delta(gestureEvent.deltaX(), gestureEvent.deltaY()); |
| 1815 if (delta.isZero()) | 1815 if (delta.isZero()) |
| 1816 return false; | 1816 return false; |
| 1817 | 1817 |
| 1818 const float scaleFactor = m_frame->pageZoomFactor(); | |
| 1819 delta.scale(1 / scaleFactor, 1 / scaleFactor); | |
| 1820 | |
| 1821 Node* node = m_scrollGestureHandlingNode.get(); | 1818 Node* node = m_scrollGestureHandlingNode.get(); |
| 1822 if (!node) | 1819 if (!node) |
| 1823 return sendScrollEventToView(gestureEvent, delta); | 1820 return sendScrollEventToView(gestureEvent, delta); |
| 1824 | 1821 |
| 1825 // Ignore this event if the targeted node does not have a valid renderer. | 1822 // Ignore this event if the targeted node does not have a valid renderer. |
| 1826 RenderObject* renderer = node->renderer(); | 1823 RenderObject* renderer = node->renderer(); |
| 1827 if (!renderer) | 1824 if (!renderer) |
| 1828 return false; | 1825 return false; |
| 1829 | 1826 |
| 1830 RefPtr<FrameView> protector(m_frame->view()); | 1827 RefPtr<FrameView> protector(m_frame->view()); |
| (...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2581 // Document so that there's some valid node here. Perhaps this | 2578 // Document so that there's some valid node here. Perhaps this |
| 2582 // should really be LocalDOMWindow, but in all other cases the targe
t of | 2579 // should really be LocalDOMWindow, but in all other cases the targe
t of |
| 2583 // a Touch is a Node so using the window could be a breaking change. | 2580 // a Touch is a Node so using the window could be a breaking change. |
| 2584 // Since we know there was no handler invoked, the specific target | 2581 // Since we know there was no handler invoked, the specific target |
| 2585 // should be completely irrelevant to the application. | 2582 // should be completely irrelevant to the application. |
| 2586 touchTarget = m_touchSequenceDocument; | 2583 touchTarget = m_touchSequenceDocument; |
| 2587 targetFrame = m_touchSequenceDocument->frame(); | 2584 targetFrame = m_touchSequenceDocument->frame(); |
| 2588 } | 2585 } |
| 2589 ASSERT(targetFrame); | 2586 ASSERT(targetFrame); |
| 2590 | 2587 |
| 2591 FloatPoint pagePoint = point.pos(); | |
| 2592 | |
| 2593 float scaleFactor = 1.0f / targetFrame->pageZoomFactor(); | |
| 2594 | |
| 2595 FloatPoint adjustedPagePoint = pagePoint.scaledBy(scaleFactor); | |
| 2596 FloatSize adjustedRadius = point.radius().scaledBy(scaleFactor); | |
| 2597 | |
| 2598 RefPtr<Touch> touch = Touch::create( | 2588 RefPtr<Touch> touch = Touch::create( |
| 2599 targetFrame, touchTarget.get(), point.id(), point.screenPos(), adjus
tedPagePoint, adjustedRadius, point.rotationAngle(), point.force()); | 2589 targetFrame, touchTarget.get(), point.id(), point.screenPos(), point
.pos(), point.radius(), point.rotationAngle(), point.force()); |
| 2600 | 2590 |
| 2601 // Ensure this target's touch list exists, even if it ends up empty, so | 2591 // Ensure this target's touch list exists, even if it ends up empty, so |
| 2602 // it can always be passed to TouchEvent::Create below. | 2592 // it can always be passed to TouchEvent::Create below. |
| 2603 TargetTouchesHeapMap::iterator targetTouchesIterator = touchesByTarget.f
ind(touchTarget.get()); | 2593 TargetTouchesHeapMap::iterator targetTouchesIterator = touchesByTarget.f
ind(touchTarget.get()); |
| 2604 if (targetTouchesIterator == touchesByTarget.end()) { | 2594 if (targetTouchesIterator == touchesByTarget.end()) { |
| 2605 touchesByTarget.set(touchTarget.get(), TouchList::create()); | 2595 touchesByTarget.set(touchTarget.get(), TouchList::create()); |
| 2606 targetTouchesIterator = touchesByTarget.find(touchTarget.get()); | 2596 targetTouchesIterator = touchesByTarget.find(touchTarget.get()); |
| 2607 } | 2597 } |
| 2608 | 2598 |
| 2609 // touches and targetTouches should only contain information about | 2599 // touches and targetTouches should only contain information about |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2733 unsigned EventHandler::accessKeyModifiers() | 2723 unsigned EventHandler::accessKeyModifiers() |
| 2734 { | 2724 { |
| 2735 #if OS(MACOSX) | 2725 #if OS(MACOSX) |
| 2736 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; | 2726 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; |
| 2737 #else | 2727 #else |
| 2738 return PlatformEvent::AltKey; | 2728 return PlatformEvent::AltKey; |
| 2739 #endif | 2729 #endif |
| 2740 } | 2730 } |
| 2741 | 2731 |
| 2742 } // namespace blink | 2732 } // namespace blink |
| OLD | NEW |