|
Lines 281-287
static inline ScrollGranularity wheelGranularityToScrollGranularity(unsigned del
a/Source/WebCore/page/EventHandler.cpp_sec1
|
| 281 |
} |
281 |
} |
| 282 |
} |
282 |
} |
| 283 |
|
283 |
|
| 284 |
static inline bool scrollNode(float delta, ScrollGranularity granularity, ScrollDirection positiveDirection, ScrollDirection negativeDirection, Node* node, Element** stopElement) |
284 |
static inline bool scrollNode(float delta, ScrollGranularity granularity, ScrollDirection positiveDirection, ScrollDirection negativeDirection, Node* node, Element** stopElement, IntPoint absolutePoint) |
| 285 |
{ |
285 |
{ |
| 286 |
if (!delta) |
286 |
if (!delta) |
| 287 |
return false; |
287 |
return false; |
|
Lines 289-295
static inline bool scrollNode(float delta, ScrollGranularity granularity, Scroll
a/Source/WebCore/page/EventHandler.cpp_sec2
|
| 289 |
return false; |
289 |
return false; |
| 290 |
RenderBox* enclosingBox = node->renderer()->enclosingBox(); |
290 |
RenderBox* enclosingBox = node->renderer()->enclosingBox(); |
| 291 |
float absDelta = delta > 0 ? delta : -delta; |
291 |
float absDelta = delta > 0 ? delta : -delta; |
| 292 |
return enclosingBox->scroll(delta < 0 ? negativeDirection : positiveDirection, granularity, absDelta, stopElement); |
292 |
|
|
|
293 |
return enclosingBox->scrollWithWheelEventLocation(delta < 0 ? negativeDirection : positiveDirection, granularity, absDelta, node, stopElement, absolutePoint); |
| 293 |
} |
294 |
} |
| 294 |
|
295 |
|
| 295 |
#if (ENABLE(TOUCH_EVENTS) && !PLATFORM(IOS)) |
296 |
#if (ENABLE(TOUCH_EVENTS) && !PLATFORM(IOS)) |
|
Lines 2612-2621
void EventHandler::defaultWheelEventHandler(Node* startNode, WheelEvent* wheelEv
a/Source/WebCore/page/EventHandler.cpp_sec3
|
| 2612 |
|
2613 |
|
| 2613 |
// Break up into two scrolls if we need to. Diagonal movement on |
2614 |
// Break up into two scrolls if we need to. Diagonal movement on |
| 2614 |
// a MacBook pro is an example of a 2-dimensional mouse wheel event (where both deltaX and deltaY can be set). |
2615 |
// a MacBook pro is an example of a 2-dimensional mouse wheel event (where both deltaX and deltaY can be set). |
| 2615 |
if (dominantDirection != DominantScrollDirectionVertical && scrollNode(wheelEvent->deltaX(), granularity, ScrollRight, ScrollLeft, startNode, &stopElement)) |
2616 |
if (dominantDirection != DominantScrollDirectionVertical && scrollNode(wheelEvent->deltaX(), granularity, ScrollRight, ScrollLeft, startNode, &stopElement, roundedIntPoint(wheelEvent->absoluteLocation()))) |
| 2616 |
wheelEvent->setDefaultHandled(); |
2617 |
wheelEvent->setDefaultHandled(); |
| 2617 |
|
2618 |
|
| 2618 |
if (dominantDirection != DominantScrollDirectionHorizontal && scrollNode(wheelEvent->deltaY(), granularity, ScrollDown, ScrollUp, startNode, &stopElement)) |
2619 |
if (dominantDirection != DominantScrollDirectionHorizontal && scrollNode(wheelEvent->deltaY(), granularity, ScrollDown, ScrollUp, startNode, &stopElement, roundedIntPoint(wheelEvent->absoluteLocation()))) |
| 2619 |
wheelEvent->setDefaultHandled(); |
2620 |
wheelEvent->setDefaultHandled(); |
| 2620 |
|
2621 |
|
| 2621 |
if (!m_latchedWheelEventElement) |
2622 |
if (!m_latchedWheelEventElement) |