diff options
author | Ben Murdoch <benm@google.com> | 2011-05-24 11:24:40 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2011-06-02 09:53:15 +0100 |
commit | 81bc750723a18f21cd17d1b173cd2a4dda9cea6e (patch) | |
tree | 7a9e5ed86ff429fd347a25153107221543909b19 /Source/WebKit2/Shared/mac/WebEventFactory.mm | |
parent | 94088a6d336c1dd80a1e734af51e96abcbb689a7 (diff) | |
download | external_webkit-81bc750723a18f21cd17d1b173cd2a4dda9cea6e.zip external_webkit-81bc750723a18f21cd17d1b173cd2a4dda9cea6e.tar.gz external_webkit-81bc750723a18f21cd17d1b173cd2a4dda9cea6e.tar.bz2 |
Merge WebKit at r80534: Intial merge by Git
Change-Id: Ia7a83357124c9e1cdb1debf55d9661ec0bd09a61
Diffstat (limited to 'Source/WebKit2/Shared/mac/WebEventFactory.mm')
-rw-r--r-- | Source/WebKit2/Shared/mac/WebEventFactory.mm | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/Source/WebKit2/Shared/mac/WebEventFactory.mm b/Source/WebKit2/Shared/mac/WebEventFactory.mm index e31c62e..8f02f6b 100644 --- a/Source/WebKit2/Shared/mac/WebEventFactory.mm +++ b/Source/WebKit2/Shared/mac/WebEventFactory.mm @@ -174,6 +174,26 @@ static WebWheelEvent::Phase phaseForEvent(NSEvent *event) { #if !defined(BUILDING_ON_SNOW_LEOPARD) uint32_t phase = WebWheelEvent::PhaseNone; + if ([event phase] & NSEventPhaseBegan) + phase |= WebWheelEvent::PhaseBegan; + if ([event phase] & NSEventPhaseStationary) + phase |= WebWheelEvent::PhaseStationary; + if ([event phase] & NSEventPhaseChanged) + phase |= WebWheelEvent::PhaseChanged; + if ([event phase] & NSEventPhaseEnded) + phase |= WebWheelEvent::PhaseEnded; + if ([event phase] & NSEventPhaseCancelled) + phase |= WebWheelEvent::PhaseCancelled; + return static_cast<WebWheelEvent::Phase>(phase); +#else + return WebWheelEvent::PhaseNone; +#endif +} + +static WebWheelEvent::Phase momentumPhaseForEvent(NSEvent *event) +{ +#if !defined(BUILDING_ON_SNOW_LEOPARD) + uint32_t phase = WebWheelEvent::PhaseNone; if ([event momentumPhase] & NSEventPhaseBegan) phase |= WebWheelEvent::PhaseBegan; if ([event momentumPhase] & NSEventPhaseStationary) @@ -1036,11 +1056,12 @@ WebWheelEvent WebEventFactory::createWebWheelEvent(NSEvent *event, NSView *windo } WebWheelEvent::Phase phase = phaseForEvent(event); + WebWheelEvent::Phase momentumPhase = momentumPhaseForEvent(event); bool hasPreciseScrollingDeltas = continuous; WebEvent::Modifiers modifiers = modifiersForEvent(event); double timestamp = [event timestamp]; - return WebWheelEvent(WebEvent::Wheel, IntPoint(position), IntPoint(globalPosition), FloatSize(deltaX, deltaY), FloatSize(wheelTicksX, wheelTicksY), granularity, phase, hasPreciseScrollingDeltas, modifiers, timestamp); + return WebWheelEvent(WebEvent::Wheel, IntPoint(position), IntPoint(globalPosition), FloatSize(deltaX, deltaY), FloatSize(wheelTicksX, wheelTicksY), granularity, phase, momentumPhase, hasPreciseScrollingDeltas, modifiers, timestamp); } WebKeyboardEvent WebEventFactory::createWebKeyboardEvent(NSEvent *event, NSView *) |