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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 const double fakeMouseMoveShortInterval = 0.1; | 122 const double fakeMouseMoveShortInterval = 0.1; |
123 const double fakeMouseMoveLongInterval = 0.250; | 123 const double fakeMouseMoveLongInterval = 0.250; |
124 | 124 |
125 const int maximumCursorSize = 128; | 125 const int maximumCursorSize = 128; |
126 | 126 |
127 // It's pretty unlikely that a scale of less than one would ever be used. But al
l we really | 127 // It's pretty unlikely that a scale of less than one would ever be used. But al
l we really |
128 // need to ensure here is that the scale isn't so small that integer overflow ca
n occur when | 128 // need to ensure here is that the scale isn't so small that integer overflow ca
n occur when |
129 // dividing cursor sizes (limited above) by the scale. | 129 // dividing cursor sizes (limited above) by the scale. |
130 const double minimumCursorScale = 0.001; | 130 const double minimumCursorScale = 0.001; |
131 | 131 |
132 #if OS(DARWIN) | 132 #if OS(MACOSX) |
133 const double EventHandler::TextDragDelay = 0.15; | 133 const double EventHandler::TextDragDelay = 0.15; |
134 #else | 134 #else |
135 const double EventHandler::TextDragDelay = 0.0; | 135 const double EventHandler::TextDragDelay = 0.0; |
136 #endif | 136 #endif |
137 | 137 |
138 | 138 |
139 enum NoCursorChangeType { NoCursorChange }; | 139 enum NoCursorChangeType { NoCursorChange }; |
140 | 140 |
141 class OptionalCursor { | 141 class OptionalCursor { |
142 public: | 142 public: |
(...skipping 1503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1646 MouseEventWithHitTestResults mev = prepareMouseEvent(request, mouseEvent); | 1646 MouseEventWithHitTestResults mev = prepareMouseEvent(request, mouseEvent); |
1647 Frame* subframe = m_capturingMouseEventsNode.get() ? subframeForTargetNode(m
_capturingMouseEventsNode.get()) : subframeForHitTestResult(mev); | 1647 Frame* subframe = m_capturingMouseEventsNode.get() ? subframeForTargetNode(m
_capturingMouseEventsNode.get()) : subframeForHitTestResult(mev); |
1648 if (m_eventHandlerWillResetCapturingMouseEventsNode) | 1648 if (m_eventHandlerWillResetCapturingMouseEventsNode) |
1649 m_capturingMouseEventsNode = 0; | 1649 m_capturingMouseEventsNode = 0; |
1650 if (subframe && passMouseReleaseEventToSubframe(mev, subframe)) | 1650 if (subframe && passMouseReleaseEventToSubframe(mev, subframe)) |
1651 return true; | 1651 return true; |
1652 | 1652 |
1653 bool swallowMouseUpEvent = !dispatchMouseEvent(eventNames().mouseupEvent, me
v.targetNode(), true, m_clickCount, mouseEvent, false); | 1653 bool swallowMouseUpEvent = !dispatchMouseEvent(eventNames().mouseupEvent, me
v.targetNode(), true, m_clickCount, mouseEvent, false); |
1654 | 1654 |
1655 bool contextMenuEvent = mouseEvent.button() == RightButton; | 1655 bool contextMenuEvent = mouseEvent.button() == RightButton; |
1656 #if OS(DARWIN) | 1656 #if OS(MACOSX) |
1657 // FIXME: The Mac port achieves the same behavior by checking whether the co
ntext menu is currently open in WebPage::mouseEvent(). Consider merging the impl
ementations. | 1657 // FIXME: The Mac port achieves the same behavior by checking whether the co
ntext menu is currently open in WebPage::mouseEvent(). Consider merging the impl
ementations. |
1658 if (mouseEvent.button() == LeftButton && mouseEvent.modifiers() & PlatformEv
ent::CtrlKey) | 1658 if (mouseEvent.button() == LeftButton && mouseEvent.modifiers() & PlatformEv
ent::CtrlKey) |
1659 contextMenuEvent = true; | 1659 contextMenuEvent = true; |
1660 #endif | 1660 #endif |
1661 | 1661 |
1662 bool swallowClickEvent = m_clickCount > 0 && !contextMenuEvent && mouseIsRel
easedOnPressedElement(mev.targetNode(), m_clickNode.get()) && !dispatchMouseEven
t(eventNames().clickEvent, mev.targetNode(), true, m_clickCount, mouseEvent, tru
e); | 1662 bool swallowClickEvent = m_clickCount > 0 && !contextMenuEvent && mouseIsRel
easedOnPressedElement(mev.targetNode(), m_clickNode.get()) && !dispatchMouseEven
t(eventNames().clickEvent, mev.targetNode(), true, m_clickCount, mouseEvent, tru
e); |
1663 | 1663 |
1664 if (m_resizeLayer) { | 1664 if (m_resizeLayer) { |
1665 m_resizeLayer->setInResizeMode(false); | 1665 m_resizeLayer->setInResizeMode(false); |
1666 m_resizeLayer = 0; | 1666 m_resizeLayer = 0; |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2085 HitTestResult result(windowPoint); | 2085 HitTestResult result(windowPoint); |
2086 renderView->hitTest(request, result); | 2086 renderView->hitTest(request, result); |
2087 return result.scrollbar(); | 2087 return result.scrollbar(); |
2088 } | 2088 } |
2089 | 2089 |
2090 return false; | 2090 return false; |
2091 } | 2091 } |
2092 | 2092 |
2093 bool EventHandler::shouldTurnVerticalTicksIntoHorizontal(const HitTestResult& re
sult, const PlatformWheelEvent& event) const | 2093 bool EventHandler::shouldTurnVerticalTicksIntoHorizontal(const HitTestResult& re
sult, const PlatformWheelEvent& event) const |
2094 { | 2094 { |
2095 #if OS(UNIX) && !OS(DARWIN) | 2095 #if OS(UNIX) && !OS(MACOSX) |
2096 // GTK+ must scroll horizontally if the mouse pointer is on top of the | 2096 // GTK+ must scroll horizontally if the mouse pointer is on top of the |
2097 // horizontal scrollbar while scrolling with the wheel. | 2097 // horizontal scrollbar while scrolling with the wheel. |
2098 // This code comes from gtk/EventHandlerGtk.cpp. | 2098 // This code comes from gtk/EventHandlerGtk.cpp. |
2099 return !event.hasPreciseScrollingDeltas() && result.scrollbar() && result.sc
rollbar()->orientation() == HorizontalScrollbar; | 2099 return !event.hasPreciseScrollingDeltas() && result.scrollbar() && result.sc
rollbar()->orientation() == HorizontalScrollbar; |
2100 #else | 2100 #else |
2101 UNUSED_PARAM(result); | 2101 UNUSED_PARAM(result); |
2102 UNUSED_PARAM(event); | 2102 UNUSED_PARAM(event); |
2103 return false; | 2103 return false; |
2104 #endif | 2104 #endif |
2105 } | 2105 } |
(...skipping 1733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3839 void EventHandler::focusDocumentView() | 3839 void EventHandler::focusDocumentView() |
3840 { | 3840 { |
3841 Page* page = m_frame->page(); | 3841 Page* page = m_frame->page(); |
3842 if (!page) | 3842 if (!page) |
3843 return; | 3843 return; |
3844 page->focusController().setFocusedFrame(m_frame); | 3844 page->focusController().setFocusedFrame(m_frame); |
3845 } | 3845 } |
3846 | 3846 |
3847 unsigned EventHandler::accessKeyModifiers() | 3847 unsigned EventHandler::accessKeyModifiers() |
3848 { | 3848 { |
3849 #if OS(DARWIN) | 3849 #if OS(MACOSX) |
3850 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; | 3850 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; |
3851 #else | 3851 #else |
3852 return PlatformEvent::AltKey; | 3852 return PlatformEvent::AltKey; |
3853 #endif | 3853 #endif |
3854 } | 3854 } |
3855 | 3855 |
3856 } // namespace WebCore | 3856 } // namespace WebCore |
OLD | NEW |