* page/EventHandler.cpp:
(WebCore::EventHandler::clear):
* page/EventHandler.h:
* Shared/NativeWebGestureEvent.h:
* Shared/mac/NativeWebGestureEventMac.mm:
(WebKit::pointForEvent):
(WebKit::NativeWebGestureEvent::NativeWebGestureEvent):
(WebKit::distanceForTouches): Deleted.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView selectFindMatch:completionHandler:]):
(-[WKWebView _web_superInputContext]):
(-[WKWebView touchesBeganWithEvent:]): Deleted.
(-[WKWebView touchesMovedWithEvent:]): Deleted.
(-[WKWebView touchesEndedWithEvent:]): Deleted.
(-[WKWebView touchesCancelledWithEvent:]): Deleted.
* UIProcess/API/mac/WKView.mm:
(-[WKView namesOfPromisedFilesDroppedAtDestination:]):
(-[WKView initWithFrame:processPool:configuration:webView:]):
(-[WKView touchesBeganWithEvent:]): Deleted.
(-[WKView touchesMovedWithEvent:]): Deleted.
(-[WKView touchesEndedWithEvent:]): Deleted.
(-[WKView touchesCancelledWithEvent:]): Deleted.
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::WebViewImpl):
(WebKit::WebViewImpl::magnifyWithEvent):
(WebKit::WebViewImpl::smartMagnifyWithEvent):
(WebKit::WebViewImpl::rotateWithEvent):
(WebKit::WebViewImpl::touchesOrderedByAge): Deleted.
(WebKit::WebViewImpl::touchesBeganWithEvent): Deleted.
(WebKit::WebViewImpl::touchesMovedWithEvent): Deleted.
(WebKit::WebViewImpl::touchesEndedWithEvent): Deleted.
(WebKit::WebViewImpl::touchesCancelledWithEvent): Deleted.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198152
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2016-03-14 Tim Horton <timothy_horton@apple.com>
+
+ Revert r194125 and r194186: We're going to fix this a different way.
+
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::clear):
+ * page/EventHandler.h:
+
2016-03-14 Youenn Fablet <youenn.fablet@crf.canon.fr>
[Fetch API] FetchLoader should check for empty bodies
m_clickCount = 0;
m_clickNode = nullptr;
#if ENABLE(IOS_GESTURE_EVENTS)
+ m_gestureInitialDiameter = GestureUnknown;
m_gestureInitialRotation = GestureUnknown;
#endif
#if ENABLE(IOS_GESTURE_EVENTS) || ENABLE(MAC_GESTURE_EVENTS)
- m_gestureInitialDiameter = GestureUnknown;
m_gestureLastDiameter = GestureUnknown;
m_gestureLastRotation = GestureUnknown;
m_gestureTargets.clear();
RefPtr<Node> m_clickNode;
#if ENABLE(IOS_GESTURE_EVENTS)
+ float m_gestureInitialDiameter { GestureUnknown };
float m_gestureInitialRotation { GestureUnknown };
#endif
#if ENABLE(IOS_GESTURE_EVENTS) || ENABLE(MAC_GESTURE_EVENTS)
- float m_gestureInitialDiameter { GestureUnknown };
float m_gestureLastDiameter { GestureUnknown };
float m_gestureLastRotation { GestureUnknown };
EventTargetSet m_gestureTargets;
+2016-03-14 Tim Horton <timothy_horton@apple.com>
+
+ Revert r194125 and r194186: We're going to fix this a different way.
+
+ * Shared/NativeWebGestureEvent.h:
+ * Shared/mac/NativeWebGestureEventMac.mm:
+ (WebKit::pointForEvent):
+ (WebKit::NativeWebGestureEvent::NativeWebGestureEvent):
+ (WebKit::distanceForTouches): Deleted.
+ * UIProcess/API/Cocoa/WKWebView.mm:
+ (-[WKWebView selectFindMatch:completionHandler:]):
+ (-[WKWebView _web_superInputContext]):
+ (-[WKWebView touchesBeganWithEvent:]): Deleted.
+ (-[WKWebView touchesMovedWithEvent:]): Deleted.
+ (-[WKWebView touchesEndedWithEvent:]): Deleted.
+ (-[WKWebView touchesCancelledWithEvent:]): Deleted.
+ * UIProcess/API/mac/WKView.mm:
+ (-[WKView namesOfPromisedFilesDroppedAtDestination:]):
+ (-[WKView initWithFrame:processPool:configuration:webView:]):
+ (-[WKView touchesBeganWithEvent:]): Deleted.
+ (-[WKView touchesMovedWithEvent:]): Deleted.
+ (-[WKView touchesEndedWithEvent:]): Deleted.
+ (-[WKView touchesCancelledWithEvent:]): Deleted.
+ * UIProcess/Cocoa/WebViewImpl.h:
+ * UIProcess/Cocoa/WebViewImpl.mm:
+ (WebKit::WebViewImpl::WebViewImpl):
+ (WebKit::WebViewImpl::magnifyWithEvent):
+ (WebKit::WebViewImpl::smartMagnifyWithEvent):
+ (WebKit::WebViewImpl::rotateWithEvent):
+ (WebKit::WebViewImpl::touchesOrderedByAge): Deleted.
+ (WebKit::WebViewImpl::touchesBeganWithEvent): Deleted.
+ (WebKit::WebViewImpl::touchesMovedWithEvent): Deleted.
+ (WebKit::WebViewImpl::touchesEndedWithEvent): Deleted.
+ (WebKit::WebViewImpl::touchesCancelledWithEvent): Deleted.
+
2016-03-14 Anders Carlsson <andersca@apple.com>
Fix build.
#include "WebGestureEvent.h"
OBJC_CLASS NSEvent;
-OBJC_CLASS NSTouch;
namespace WebKit {
class NativeWebGestureEvent final : public WebGestureEvent {
public:
- explicit NativeWebGestureEvent(NSEvent *, NSView *, Vector<NSTouch *> touches);
+ explicit NativeWebGestureEvent(NSEvent *, NSView *);
NSEvent *nativeEvent() const { return m_nativeEvent.get(); }
return location;
}
-static CGFloat distanceForTouches(Vector<NSTouch *> touches)
-{
- if (touches.size() < 2)
- return -1;
-
- NSPoint firstTouchPosition = touches[0].normalizedPosition;
- NSPoint secondTouchPosition = touches[1].normalizedPosition;
-
- CGFloat dx = secondTouchPosition.x - firstTouchPosition.x;
- CGFloat dy = secondTouchPosition.y - firstTouchPosition.y;
-
- return sqrtf(dx * dx + dy * dy);
-}
-
-NativeWebGestureEvent::NativeWebGestureEvent(NSEvent *event, NSView *view, Vector<NSTouch *> touches)
+NativeWebGestureEvent::NativeWebGestureEvent(NSEvent *event, NSView *view)
: WebGestureEvent(
webEventTypeForNSEvent(event),
static_cast<Modifiers>(0),
event.timestamp,
WebCore::IntPoint(pointForEvent(event, view)),
- distanceForTouches(touches),
+ event.type == NSEventTypeMagnify ? event.magnification : 0,
event.type == NSEventTypeRotate ? event.rotation : 0)
, m_nativeEvent(event)
{
-
}
} // namespace WebKit
[[self _ensureTextFinderClient] selectFindMatch:findMatch completionHandler:completionHandler];
}
-- (void)touchesBeganWithEvent:(NSEvent *)event
-{
- _impl->touchesBeganWithEvent(event);
-}
-
-- (void)touchesMovedWithEvent:(NSEvent *)event
-{
- _impl->touchesMovedWithEvent(event);
-}
-
-- (void)touchesEndedWithEvent:(NSEvent *)event
-{
- _impl->touchesEndedWithEvent(event);
-}
-
-- (void)touchesCancelledWithEvent:(NSEvent *)event
-{
- _impl->touchesCancelledWithEvent(event);
-}
-
- (NSTextInputContext *)_web_superInputContext
{
return [super inputContext];
return _data->_impl->namesOfPromisedFilesDroppedAtDestination(dropDestination);
}
-- (void)touchesBeganWithEvent:(NSEvent *)event
-{
- _data->_impl->touchesBeganWithEvent(event);
-}
-
-- (void)touchesMovedWithEvent:(NSEvent *)event
-{
- _data->_impl->touchesMovedWithEvent(event);
-}
-
-- (void)touchesEndedWithEvent:(NSEvent *)event
-{
- _data->_impl->touchesEndedWithEvent(event);
-}
-
-- (void)touchesCancelledWithEvent:(NSEvent *)event
-{
- _data->_impl->touchesCancelledWithEvent(event);
-}
-
- (instancetype)initWithFrame:(NSRect)frame processPool:(WebProcessPool&)processPool configuration:(Ref<API::PageConfiguration>&&)configuration webView:(WKWebView *)webView
{
self = [super initWithFrame:frame];
void rotateWithEvent(NSEvent *);
void smartMagnifyWithEvent(NSEvent *);
- void touchesBeganWithEvent(NSEvent *);
- void touchesMovedWithEvent(NSEvent *);
- void touchesEndedWithEvent(NSEvent *);
- void touchesCancelledWithEvent(NSEvent *);
-
void setLastMouseDownEvent(NSEvent *);
void gestureEventWasNotHandledByWebCore(NSEvent *);
bool mightBeginDragWhileInactive();
bool mightBeginScrollWhileInactive();
- Vector<NSTouch *> touchesOrderedByAge();
-
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
void handleRequestedCandidates(NSInteger sequenceNumber, NSArray<NSTextCheckingResult *> *candidates);
void handleAcceptedCandidate(NSTextCheckingResult *acceptedCandidate);
RetainPtr<NSEvent> m_keyDownEventBeingResent;
Vector<WebCore::KeypressCommand>* m_collectedKeypressCommands { nullptr };
- Vector<RetainPtr<id <NSObject, NSCopying>>> m_activeTouchIdentities;
- RetainPtr<NSArray> m_lastTouches;
-
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
String m_lastStringForCandidateRequest;
#endif
registerDraggedTypes();
m_view.wantsLayer = YES;
- m_view.acceptsTouchEvents = YES;
// Explicitly set the layer contents placement so AppKit will make sure that our layer has masksToBounds set to YES.
m_view.layerContentsPlacement = NSViewLayerContentsPlacementTopLeft;
{
if (!m_allowsMagnification) {
#if ENABLE(MAC_GESTURE_EVENTS)
- NativeWebGestureEvent webEvent = NativeWebGestureEvent(event, m_view, touchesOrderedByAge());
+ NativeWebGestureEvent webEvent = NativeWebGestureEvent(event, m_view);
m_page->handleGestureEvent(webEvent);
#endif
[m_view _web_superMagnifyWithEvent:event];
return;
}
- NativeWebGestureEvent webEvent = NativeWebGestureEvent(event, m_view, touchesOrderedByAge());
+ NativeWebGestureEvent webEvent = NativeWebGestureEvent(event, m_view);
m_page->handleGestureEvent(webEvent);
#else
gestureController.handleMagnificationGestureEvent(event, [m_view convertPoint:event.locationInWindow fromView:nil]);
#endif
}
-Vector<NSTouch *> WebViewImpl::touchesOrderedByAge()
-{
- Vector<NSTouch *> touches;
-
- for (auto& touchIdentity : m_activeTouchIdentities) {
- for (NSTouch *touch in m_lastTouches.get()) {
- if (![touch.identity isEqual:touchIdentity.get()])
- continue;
- touches.append(touch);
- break;
- }
- }
-
- return touches;
-}
-
-void WebViewImpl::touchesBeganWithEvent(NSEvent *event)
-{
- m_lastTouches = [event touchesMatchingPhase:NSTouchPhaseAny inView:m_view].allObjects;
- for (NSTouch *touch in [event touchesMatchingPhase:NSTouchPhaseBegan inView:m_view])
- m_activeTouchIdentities.append(touch.identity);
-}
-
-void WebViewImpl::touchesMovedWithEvent(NSEvent *event)
-{
- m_lastTouches = [event touchesMatchingPhase:NSTouchPhaseAny inView:m_view].allObjects;
-}
-
-void WebViewImpl::touchesEndedWithEvent(NSEvent *event)
-{
- m_lastTouches = [event touchesMatchingPhase:NSTouchPhaseAny inView:m_view].allObjects;
- for (NSTouch *touch in [event touchesMatchingPhase:NSTouchPhaseEnded inView:m_view]) {
- for (size_t i = 0; i < m_activeTouchIdentities.size(); i++) {
- if ([m_activeTouchIdentities[i] isEqual:touch.identity]) {
- m_activeTouchIdentities.remove(i);
- break;
- }
- }
- }
-}
-
-void WebViewImpl::touchesCancelledWithEvent(NSEvent *event)
-{
- m_lastTouches = [event touchesMatchingPhase:NSTouchPhaseAny inView:m_view].allObjects;
- for (NSTouch *touch in [event touchesMatchingPhase:NSTouchPhaseCancelled inView:m_view]) {
- for (size_t i = 0; i < m_activeTouchIdentities.size(); i++) {
- if ([m_activeTouchIdentities[i] isEqual:touch.identity]) {
- m_activeTouchIdentities.remove(i);
- break;
- }
- }
- }
-}
-
void WebViewImpl::smartMagnifyWithEvent(NSEvent *event)
{
if (!m_allowsMagnification) {
#if ENABLE(MAC_GESTURE_EVENTS)
void WebViewImpl::rotateWithEvent(NSEvent *event)
{
- NativeWebGestureEvent webEvent = NativeWebGestureEvent(event, m_view, touchesOrderedByAge());
+ NativeWebGestureEvent webEvent = NativeWebGestureEvent(event, m_view);
m_page->handleGestureEvent(webEvent);
}
#endif