OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
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 | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 | 106 |
107 // Find the nearest enclosing box. | 107 // Find the nearest enclosing box. |
108 RenderBox* enclosingBox = node->renderer()->enclosingBox(); | 108 RenderBox* enclosingBox = node->renderer()->enclosingBox(); |
109 | 109 |
110 if (e.granularity() == ScrollByPageWheelEvent) { | 110 if (e.granularity() == ScrollByPageWheelEvent) { |
111 if (enclosingBox->scroll(delta < 0 ? negativeDirection : positiveDirecti
on, ScrollByPage, 1)) | 111 if (enclosingBox->scroll(delta < 0 ? negativeDirection : positiveDirecti
on, ScrollByPage, 1)) |
112 e.accept(); | 112 e.accept(); |
113 return; | 113 return; |
114 } | 114 } |
115 float pixelsToScroll = delta > 0 ? delta : -delta; | 115 float pixelsToScroll = delta > 0 ? delta : -delta; |
116 if (e.granularity() == ScrollByLineWheelEvent) | |
117 pixelsToScroll *= cMouseWheelPixelsPerLineStep; | |
118 if (enclosingBox->scroll(delta < 0 ? negativeDirection : positiveDirection,
ScrollByPixel, pixelsToScroll)) | 116 if (enclosingBox->scroll(delta < 0 ? negativeDirection : positiveDirection,
ScrollByPixel, pixelsToScroll)) |
119 e.accept(); | 117 e.accept(); |
120 } | 118 } |
121 | 119 |
122 EventHandler::EventHandler(Frame* frame) | 120 EventHandler::EventHandler(Frame* frame) |
123 : m_frame(frame) | 121 : m_frame(frame) |
124 , m_mousePressed(false) | 122 , m_mousePressed(false) |
125 , m_capturesDragging(false) | 123 , m_capturesDragging(false) |
126 , m_mouseDownMayStartSelect(false) | 124 , m_mouseDownMayStartSelect(false) |
127 , m_mouseDownMayStartDrag(false) | 125 , m_mouseDownMayStartDrag(false) |
(...skipping 2189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2317 } | 2315 } |
2318 | 2316 |
2319 bool EventHandler::passMousePressEventToScrollbar(MouseEventWithHitTestResults&
mev, Scrollbar* scrollbar) | 2317 bool EventHandler::passMousePressEventToScrollbar(MouseEventWithHitTestResults&
mev, Scrollbar* scrollbar) |
2320 { | 2318 { |
2321 if (!scrollbar || !scrollbar->enabled()) | 2319 if (!scrollbar || !scrollbar->enabled()) |
2322 return false; | 2320 return false; |
2323 return scrollbar->mouseDown(mev.event()); | 2321 return scrollbar->mouseDown(mev.event()); |
2324 } | 2322 } |
2325 | 2323 |
2326 } | 2324 } |
OLD | NEW |