<rdar://problem/
8751861>
Reviewed by Darin Adler.
Source/WebCore:
* WebCore.exp.in: Remove _wkIsLatchingWheelEvent, add _wkGetNSEventMomentumPhase.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleWheelEvent): Set m_useLatchedWheelEventNode based on the
event's momentumPhase.
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::wheelEvent): Remove the setting of m_useLatchedWheelEventNode.
It is now done in EventHandler::handleWheelEvent.
* platform/mac/WebCoreSystemInterface.h: Remove wkIsLatchingWheelEvent, add wkGetNSEventMomentumPhase.
* platform/mac/WebCoreSystemInterface.mm: Ditto.
* platform/mac/WheelEventMac.mm:
(WebCore::momentumPhaseForEvent): Return a phase on older Mac system by using wkGetNSEventMomentumPhase.
Source/WebKit/mac:
* WebCoreSupport/WebSystemInterface.mm:
(InitWebCoreSystemInterface): Remove IsLatchingWheelEvent, add GetNSEventMomentumPhase.
* WebView/WebDynamicScrollBarsView.mm:
(-[WebDynamicScrollBarsView scrollWheel:]): Use WKGetNSEventMomentumPhase to set isLatchingEvent.
Source/WebKit2:
* Shared/mac/WebEventFactory.mm:
(WebKit::momentumPhaseForEvent): Return a phase on older Mac system by using WKGetNSEventMomentumPhase.
* WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
(InitWebCoreSystemInterface): Remove IsLatchingWheelEvent, add GetNSEventMomentumPhase.
WebKitLibraries:
* WebKitSystemInterface.h:
* libWebKitSystemInterfaceLeopard.a: Updated to remove WKIsLatchingWheelEvent and add WKGetNSEventMomentumPhase.
* libWebKitSystemInterfaceSnowLeopard.a: Ditto.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@82709
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2011-04-01 Timothy Hatcher <timothy@apple.com>
+
+ Make momentum scroll event latching work in WebKit2 on Mac.
+
+ <rdar://problem/8751861>
+
+ Reviewed by Darin Adler.
+
+ * WebCore.exp.in: Remove _wkIsLatchingWheelEvent, add _wkGetNSEventMomentumPhase.
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::handleWheelEvent): Set m_useLatchedWheelEventNode based on the
+ event's momentumPhase.
+ * page/mac/EventHandlerMac.mm:
+ (WebCore::EventHandler::wheelEvent): Remove the setting of m_useLatchedWheelEventNode.
+ It is now done in EventHandler::handleWheelEvent.
+ * platform/mac/WebCoreSystemInterface.h: Remove wkIsLatchingWheelEvent, add wkGetNSEventMomentumPhase.
+ * platform/mac/WebCoreSystemInterface.mm: Ditto.
+ * platform/mac/WheelEventMac.mm:
+ (WebCore::momentumPhaseForEvent): Return a phase on older Mac system by using wkGetNSEventMomentumPhase.
+
2011-04-01 Steve Block <steveblock@google.com>
Reviewed by Jeremy Orlow.
_wkHTTPCookiesForURL
_wkHitTestMediaUIPart
_wkInitializeMaximumHTTPConnectionCountPerHost
-_wkIsLatchingWheelEvent
_wkMeasureMediaUIPart
_wkMediaControllerThemeAvailable
_wkPopupMenu
_wkVerticalScrollbarPainterForController
_wkWillEndLiveResize
_wkWillStartLiveResize
+#else
+_wkGetNSEventMomentumPhase
#endif
_wkUnregisterUniqueIdForElement
HitTestResult result(vPoint);
doc->renderView()->layer()->hitTest(request, result);
+#if PLATFORM(MAC)
+ m_useLatchedWheelEventNode = e.momentumPhase() == PlatformWheelEventPhaseBegan || e.momentumPhase() == PlatformWheelEventPhaseChanged;
+#endif
+
if (m_useLatchedWheelEventNode) {
if (!m_latchedWheelEventNode) {
m_latchedWheelEventNode = result.innerNode();
CurrentEventScope scope(event);
- m_useLatchedWheelEventNode = wkIsLatchingWheelEvent(event);
-
PlatformWheelEvent wheelEvent(event, page->chrome()->platformPageClient());
handleWheelEvent(wheelEvent);
extern void (*wkSetCONNECTProxyForStream)(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort);
extern void (*wkSetCONNECTProxyAuthorizationForStream)(CFReadStreamRef, CFStringRef proxyAuthorizationString);
extern CFHTTPMessageRef (*wkCopyCONNECTProxyResponse)(CFReadStreamRef, CFURLRef responseURL);
-extern BOOL (*wkIsLatchingWheelEvent)(NSEvent *);
#ifndef BUILDING_ON_TIGER
extern void (*wkGetGlyphsForCharacters)(CGFontRef, const UniChar[], CGGlyph[], size_t);
extern void* wkGetHyphenationLocationBeforeIndex;
#else
extern CFIndex (*wkGetHyphenationLocationBeforeIndex)(CFStringRef string, CFIndex index);
+
+typedef enum {
+ wkEventPhaseNone = 0,
+ wkEventPhaseBegan = 1,
+ wkEventPhaseChanged = 2,
+ wkEventPhaseEnded = 3,
+} wkEventPhase;
+
+extern int (*wkGetNSEventMomentumPhase)(NSEvent *);
#endif
extern CTLineRef (*wkCreateCTLineWithUniCharProvider)(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*);
void (*wkSetCONNECTProxyForStream)(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort);
void (*wkSetCONNECTProxyAuthorizationForStream)(CFReadStreamRef, CFStringRef proxyAuthorizationString);
CFHTTPMessageRef (*wkCopyCONNECTProxyResponse)(CFReadStreamRef, CFURLRef responseURL);
-BOOL (*wkIsLatchingWheelEvent)(NSEvent *);
#ifndef BUILDING_ON_TIGER
void (*wkGetGlyphsForCharacters)(CGFontRef, const UniChar[], CGGlyph[], size_t);
void* wkGetHyphenationLocationBeforeIndex;
#else
CFIndex (*wkGetHyphenationLocationBeforeIndex)(CFStringRef string, CFIndex index);
+int (*wkGetNSEventMomentumPhase)(NSEvent *);
#endif
CTLineRef (*wkCreateCTLineWithUniCharProvider)(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*);
static PlatformWheelEventPhase momentumPhaseForEvent(NSEvent *event)
{
+ uint32_t phase = PlatformWheelEventPhaseNone;
+
#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
- uint32_t phase = PlatformWheelEventPhaseNone;
if ([event momentumPhase] & NSEventPhaseBegan)
phase |= PlatformWheelEventPhaseBegan;
if ([event momentumPhase] & NSEventPhaseStationary)
phase |= PlatformWheelEventPhaseEnded;
if ([event momentumPhase] & NSEventPhaseCancelled)
phase |= PlatformWheelEventPhaseCancelled;
- return static_cast<PlatformWheelEventPhase>(phase);
#else
- UNUSED_PARAM(event);
- return PlatformWheelEventPhaseNone;
+ switch (wkGetNSEventMomentumPhase(event)) {
+ case wkEventPhaseNone:
+ phase = PlatformWheelEventPhaseNone;
+ break;
+ case wkEventPhaseBegan:
+ phase = PlatformWheelEventPhaseBegan;
+ break;
+ case wkEventPhaseChanged:
+ phase = PlatformWheelEventPhaseChanged;
+ break;
+ case wkEventPhaseEnded:
+ phase = PlatformWheelEventPhaseEnded;
+ break;
+ }
#endif
+
+ return static_cast<PlatformWheelEventPhase>(phase);
}
static PlatformWheelEventPhase phaseForEvent(NSEvent *event)
+2011-04-01 Timothy Hatcher <timothy@apple.com>
+
+ Make momentum scroll event latching work in WebKit2 on Mac.
+
+ <rdar://problem/8751861>
+
+ Reviewed by Darin Adler.
+
+ * WebCoreSupport/WebSystemInterface.mm:
+ (InitWebCoreSystemInterface): Remove IsLatchingWheelEvent, add GetNSEventMomentumPhase.
+ * WebView/WebDynamicScrollBarsView.mm:
+ (-[WebDynamicScrollBarsView scrollWheel:]): Use WKGetNSEventMomentumPhase to set isLatchingEvent.
+
2011-03-31 Darin Adler <darin@apple.com>
Reviewed by Anders Carlsson.
INIT(GetWheelEventDeltas);
INIT(HitTestMediaUIPart);
INIT(InitializeMaximumHTTPConnectionCountPerHost);
- INIT(IsLatchingWheelEvent);
INIT(MeasureMediaUIPart);
INIT(MediaControllerThemeAvailable);
INIT(PopupMenu);
#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_SNOW_LEOPARD)
INIT(GetHyphenationLocationBeforeIndex);
+ INIT(GetNSEventMomentumPhase);
#endif
INIT(CreateCTLineWithUniCharProvider);
+
#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
INIT(IOSurfaceContextCreate);
INIT(IOSurfaceContextCreateImage);
BOOL isContinuous;
WKGetWheelEventDeltas(event, &deltaX, &deltaY, &isContinuous);
- BOOL isLatchingEvent = WKIsLatchingWheelEvent(event);
+ int momentumPhase = WKGetNSEventMomentumPhase(event);
+ BOOL isLatchingEvent = momentumPhase == WKEventPhaseBegan || momentumPhase == WKEventPhaseChanged;
if (fabsf(deltaY) > fabsf(deltaX)) {
if (![self allowsVerticalScrolling]) {
+2011-04-01 Timothy Hatcher <timothy@apple.com>
+
+ Make momentum scroll event latching work in WebKit2 on Mac.
+
+ <rdar://problem/8751861>
+
+ Reviewed by Darin Adler.
+
+ * Shared/mac/WebEventFactory.mm:
+ (WebKit::momentumPhaseForEvent): Return a phase on older Mac system by using WKGetNSEventMomentumPhase.
+ * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
+ (InitWebCoreSystemInterface): Remove IsLatchingWheelEvent, add GetNSEventMomentumPhase.
+
2011-04-01 Alexey Proskuryakov <ap@apple.com>
Reviewed by Anders Carlsson.
static WebWheelEvent::Phase momentumPhaseForEvent(NSEvent *event)
{
-#if !defined(BUILDING_ON_SNOW_LEOPARD)
uint32_t phase = WebWheelEvent::PhaseNone;
+
+#if !defined(BUILDING_ON_SNOW_LEOPARD)
if ([event momentumPhase] & NSEventPhaseBegan)
phase |= WebWheelEvent::PhaseBegan;
if ([event momentumPhase] & NSEventPhaseStationary)
phase |= WebWheelEvent::PhaseEnded;
if ([event momentumPhase] & NSEventPhaseCancelled)
phase |= WebWheelEvent::PhaseCancelled;
- return static_cast<WebWheelEvent::Phase>(phase);
#else
- return WebWheelEvent::PhaseNone;
+ switch (WKGetNSEventMomentumPhase(event)) {
+ case WKEventPhaseNone:
+ phase = WebWheelEvent::PhaseNone;
+ break;
+ case WKEventPhaseBegan:
+ phase = WebWheelEvent::PhaseBegan;
+ break;
+ case WKEventPhaseChanged:
+ phase = WebWheelEvent::PhaseChanged;
+ break;
+ case WKEventPhaseEnded:
+ phase = WebWheelEvent::PhaseEnded;
+ break;
+ }
#endif
+
+ return static_cast<WebWheelEvent::Phase>(phase);
}
#if ENABLE(GESTURE_EVENTS)
INIT(GetWheelEventDeltas);
INIT(HitTestMediaUIPart);
INIT(InitializeMaximumHTTPConnectionCountPerHost);
- INIT(IsLatchingWheelEvent);
INIT(MeasureMediaUIPart);
INIT(MediaControllerThemeAvailable);
INIT(PopupMenu);
INIT(ScrollbarPainterUsesOverlayScrollers);
#else
INIT(GetHyphenationLocationBeforeIndex);
+ INIT(GetNSEventMomentumPhase);
#endif
INIT(GetAXTextMarkerTypeID);
+2011-04-01 Timothy Hatcher <timothy@apple.com>
+
+ Make momentum scroll event latching work in WebKit2 on Mac.
+
+ <rdar://problem/8751861>
+
+ Reviewed by Darin Adler.
+
+ * WebKitSystemInterface.h:
+ * libWebKitSystemInterfaceLeopard.a: Updated to remove WKIsLatchingWheelEvent and add WKGetNSEventMomentumPhase.
+ * libWebKitSystemInterfaceSnowLeopard.a: Ditto.
+
2011-03-30 Steve Falkenburg <sfalken@apple.com>
Reviewed by Adam Roben.
void WKSetCONNECTProxyAuthorizationForStream(CFReadStreamRef, CFStringRef proxyAuthorizationString);
CFHTTPMessageRef WKCopyCONNECTProxyResponse(CFReadStreamRef, CFURLRef responseURL);
-BOOL WKIsLatchingWheelEvent(NSEvent *);
+#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_SNOW_LEOPARD)
+typedef enum {
+ WKEventPhaseNone = 0,
+ WKEventPhaseBegan = 1,
+ WKEventPhaseChanged = 2,
+ WKEventPhaseEnded = 3,
+} WKEventPhase;
+
+int WKGetNSEventMomentumPhase(NSEvent *);
+#endif
#ifndef BUILDING_ON_TIGER
void WKWindowSetAlpha(NSWindow *window, float alphaValue);
bool WKScrollbarPainterUsesOverlayScrollers(void);
+NSRange WKExtractWordDefinitionTokenRangeFromContextualString(NSString *contextString, NSRange range, NSDictionary **options);
+void WKShowWordDefinitionWindow(NSAttributedString *term, NSPoint screenPoint, NSDictionary *options);
+void WKHideWordDefinitionWindow(void);
+
#endif
#ifdef __cplusplus