WebWheelEvent::Phase and PlatformWheelEvent::Phase declarations should match AppKit
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Jan 2012 19:28:38 +0000 (19:28 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Jan 2012 19:28:38 +0000 (19:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=77123

Reviewed by Beth Dakin.

Source/WebCore:

* platform/PlatformWheelEvent.h:
():
* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::phaseForEvent):

Source/WebKit2:

* Shared/WebEvent.h:
():
* Shared/mac/WebEventFactory.mm:
(WebKit::phaseForEvent):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106021 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/PlatformWheelEvent.h
Source/WebCore/platform/mac/PlatformEventFactoryMac.mm
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebEvent.h
Source/WebKit2/Shared/mac/WebEventFactory.mm

index 2c2606d..ae2e33d 100644 (file)
@@ -1,3 +1,15 @@
+2012-01-26  Anders Carlsson  <andersca@apple.com>
+
+        WebWheelEvent::Phase and PlatformWheelEvent::Phase declarations should match AppKit
+        https://bugs.webkit.org/show_bug.cgi?id=77123
+
+        Reviewed by Beth Dakin.
+
+        * platform/PlatformWheelEvent.h:
+        ():
+        * platform/mac/PlatformEventFactoryMac.mm:
+        (WebCore::phaseForEvent):
+
 2012-01-26  Daniel Cheng  <dcheng@chromium.org>
 
         Revert code changes from r105800
index 8e99e47..f76f4c9 100644 (file)
@@ -77,11 +77,12 @@ namespace WebCore {
 #if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN))
     enum PlatformWheelEventPhase {
         PlatformWheelEventPhaseNone        = 0,
-        PlatformWheelEventPhaseBegan       = 1 << 1,
-        PlatformWheelEventPhaseStationary  = 1 << 2,
-        PlatformWheelEventPhaseChanged     = 1 << 3,
-        PlatformWheelEventPhaseEnded       = 1 << 4,
-        PlatformWheelEventPhaseCancelled   = 1 << 5,
+        PlatformWheelEventPhaseBegan       = 1 << 0,
+        PlatformWheelEventPhaseStationary  = 1 << 1,
+        PlatformWheelEventPhaseChanged     = 1 << 2,
+        PlatformWheelEventPhaseEnded       = 1 << 3,
+        PlatformWheelEventPhaseCancelled   = 1 << 4,
+        PlatformWheelEventPhaseMayBegin    = 1 << 5,
     };
 #endif
 
index 43623c7..46a9c1b 100644 (file)
@@ -201,6 +201,11 @@ static PlatformWheelEventPhase phaseForEvent(NSEvent *event)
         phase |= PlatformWheelEventPhaseEnded;
     if ([event phase] & NSEventPhaseCancelled)
         phase |= PlatformWheelEventPhaseCancelled;
+#if !defined(BUILDING_ON_LION)
+    if ([event momentumPhase] & NSEventPhaseMayBegin)
+        phase |= PlatformWheelEventPhaseMayBegin;
+#endif
+
     return static_cast<PlatformWheelEventPhase>(phase);
 #else
     UNUSED_PARAM(event);
index 82b1542..9f8a9d2 100644 (file)
@@ -1,3 +1,15 @@
+2012-01-26  Anders Carlsson  <andersca@apple.com>
+
+        WebWheelEvent::Phase and PlatformWheelEvent::Phase declarations should match AppKit
+        https://bugs.webkit.org/show_bug.cgi?id=77123
+
+        Reviewed by Beth Dakin.
+
+        * Shared/WebEvent.h:
+        ():
+        * Shared/mac/WebEventFactory.mm:
+        (WebKit::phaseForEvent):
+
 2012-01-26  Andras Becsi  <andras.becsi@nokia.com>
 
         ASSERT(!m_overlay) reached in TapHighlightController.cpp:73
index c182369..7ec01d4 100644 (file)
@@ -166,11 +166,12 @@ public:
 #if PLATFORM(MAC)
     enum Phase {
         PhaseNone        = 0,
-        PhaseBegan       = 1 << 1,
-        PhaseStationary  = 1 << 2,
-        PhaseChanged     = 1 << 3,
-        PhaseEnded       = 1 << 4,
-        PhaseCancelled   = 1 << 5,
+        PhaseBegan       = 1 << 0,
+        PhaseStationary  = 1 << 1,
+        PhaseChanged     = 1 << 2,
+        PhaseEnded       = 1 << 3,
+        PhaseCancelled   = 1 << 4,
+        PhaseMayBegin    = 1 << 5,
     };
 #endif
 
index 8e72387..9ee9561 100644 (file)
@@ -200,6 +200,11 @@ static WebWheelEvent::Phase phaseForEvent(NSEvent *event)
         phase |= WebWheelEvent::PhaseEnded;
     if ([event phase] & NSEventPhaseCancelled)
         phase |= WebWheelEvent::PhaseCancelled;
+#if !defined(BUILDING_ON_LION)
+    if ([event phase] & NSEventPhaseMayBegin)
+        phase |= WebWheelEvent::PhaseMayBegin;
+#endif
+
     return static_cast<WebWheelEvent::Phase>(phase);
 #else
     return WebWheelEvent::PhaseNone;