Commit 0d0256bc authored by andersca@apple.com's avatar andersca@apple.com

Remove gesture event support from WebCore

https://bugs.webkit.org/show_bug.cgi?id=122650

Reviewed by Ryosuke Niwa.

Source/WebCore:

* CMakeLists.txt:
* GNUmakefile.list.am:
* WebCore.exp.in:
* WebCore.xcodeproj/project.pbxproj:
* dom/GestureEvent.cpp: Removed.
* dom/GestureEvent.h: Removed.
* dom/Node.cpp:
* dom/Node.h:
* page/EventHandler.cpp:
(WebCore::EventHandler::EventHandler):
(WebCore::EventHandler::clear):
(WebCore::EventHandler::sendContextMenuEventForKey):
* page/EventHandler.h:
* platform/PlatformGestureEvent.h: Removed.
* platform/Scrollbar.cpp:
* platform/Scrollbar.h:
* platform/mac/PlatformEventFactoryMac.h:
* platform/mac/PlatformEventFactoryMac.mm:

Source/WTF:

* wtf/FeatureDefines.h:
* wtf/nix/FeatureDefinesNix.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157316 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent b9932f12
2013-10-11 Anders Carlsson <andersca@apple.com>
Remove gesture event support from WebCore
https://bugs.webkit.org/show_bug.cgi?id=122650
Reviewed by Ryosuke Niwa.
* wtf/FeatureDefines.h:
* wtf/nix/FeatureDefinesNix.h:
2013-10-09 Filip Pizlo <fpizlo@apple.com>
FTL: Soft-link LLVM as a workaround for LLVM's static initializers and exit-time destructors
......
......@@ -174,10 +174,6 @@
#define ENABLE_FULLSCREEN_API 1
#endif
#if !defined(ENABLE_GESTURE_EVENTS)
#define ENABLE_GESTURE_EVENTS 1
#endif
#if !defined(ENABLE_RUBBER_BANDING)
#define ENABLE_RUBBER_BANDING 1
#endif
......@@ -485,10 +481,6 @@
#define ENABLE_GEOLOCATION 0
#endif
#if !defined(ENABLE_GESTURE_EVENTS)
#define ENABLE_GESTURE_EVENTS 0
#endif
#if !defined(ENABLE_GLIB_SUPPORT)
#define ENABLE_GLIB_SUPPORT 0
#endif
......
......@@ -134,10 +134,6 @@
#define ENABLE_GEOLOCATION 1
#endif
#if !defined(ENABLE_GESTURE_EVENTS)
#define ENABLE_GESTURE_EVENTS 1
#endif
#if !defined(ENABLE_ICONDATABASE)
#define ENABLE_ICONDATABASE 1
#endif
......
......@@ -1137,7 +1137,6 @@ set(WebCore_SOURCES
dom/ExceptionCodePlaceholder.cpp
dom/FocusEvent.cpp
dom/GenericEventQueue.cpp
dom/GestureEvent.cpp
dom/IconURL.cpp
dom/IdTargetObserver.cpp
dom/IdTargetObserverRegistry.cpp
......
2013-10-11 Anders Carlsson <andersca@apple.com>
Remove gesture event support from WebCore
https://bugs.webkit.org/show_bug.cgi?id=122650
Reviewed by Ryosuke Niwa.
* CMakeLists.txt:
* GNUmakefile.list.am:
* WebCore.exp.in:
* WebCore.xcodeproj/project.pbxproj:
* dom/GestureEvent.cpp: Removed.
* dom/GestureEvent.h: Removed.
* dom/Node.cpp:
* dom/Node.h:
* page/EventHandler.cpp:
(WebCore::EventHandler::EventHandler):
(WebCore::EventHandler::clear):
(WebCore::EventHandler::sendContextMenuEventForKey):
* page/EventHandler.h:
* platform/PlatformGestureEvent.h: Removed.
* platform/Scrollbar.cpp:
* platform/Scrollbar.h:
* platform/mac/PlatformEventFactoryMac.h:
* platform/mac/PlatformEventFactoryMac.mm:
2013-10-11 Tim Horton <timothy_horton@apple.com>
Remove some dead code from PlatformCALayer*
......@@ -2843,8 +2843,6 @@ webcore_sources += \
Source/WebCore/dom/FocusEvent.cpp \
Source/WebCore/dom/FocusEvent.h \
Source/WebCore/dom/FragmentScriptingPermission.h \
Source/WebCore/dom/GestureEvent.cpp \
Source/WebCore/dom/GestureEvent.h \
Source/WebCore/dom/IgnoreDestructiveWriteCountIncrementer.h \
Source/WebCore/dom/ExceptionCodePlaceholder.h \
Source/WebCore/dom/GenericEventQueue.cpp \
......
......@@ -2490,10 +2490,6 @@ __ZN7WebCore21GeolocationController14supplementNameEv
__ZN7WebCore21GeolocationController15positionChangedEPNS_19GeolocationPositionE
#endif
#if ENABLE(GESTURE_EVENTS)
__ZN7WebCore12EventHandler18handleGestureEventERKNS_20PlatformGestureEventE
#endif
#if ENABLE(HIDDEN_PAGE_DOM_TIMER_THROTTLING)
__ZN7WebCore8Settings38setHiddenPageDOMTimerThrottlingEnabledEb
#endif
......
......@@ -125,9 +125,7 @@
071A9EC2168FBC43002629F9 /* TextTrackCueGeneric.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 071A9EC0168FB56C002629F9 /* TextTrackCueGeneric.cpp */; };
071A9EC3168FBC55002629F9 /* TextTrackCueGeneric.h in Headers */ = {isa = PBXBuildFile; fileRef = 071A9EC1168FB56C002629F9 /* TextTrackCueGeneric.h */; settings = {ATTRIBUTES = (Private, ); }; };
0720B0A014D3323500642955 /* GenericEventQueue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0720B09E14D3323500642955 /* GenericEventQueue.cpp */; };
0720B0A014D3323500642956 /* GestureEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0720B09F14D3323500642956 /* GestureEvent.cpp */; };
0720B0A114D3323500642955 /* GenericEventQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 0720B09F14D3323500642955 /* GenericEventQueue.h */; settings = {ATTRIBUTES = (Private, ); }; };
0720B0A114D3323500642957 /* GestureEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 0720B09F14D3323500642957 /* GestureEvent.h */; settings = {ATTRIBUTES = (Private, ); }; };
07277E4C17D018CC0015534D /* JSMediaStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07277E4017D018CC0015534D /* JSMediaStream.cpp */; };
07277E4D17D018CC0015534D /* JSMediaStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 07277E4117D018CC0015534D /* JSMediaStream.h */; settings = {ATTRIBUTES = (Private, ); }; };
07277E4E17D018CC0015534D /* JSMediaStreamAudioDestinationNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07277E4217D018CC0015534D /* JSMediaStreamAudioDestinationNode.cpp */; };
......@@ -4940,7 +4938,6 @@
BC94D14F0C275C68006BC617 /* JSHistory.h in Headers */ = {isa = PBXBuildFile; fileRef = BC94D14D0C275C68006BC617 /* JSHistory.h */; };
BC94D1530C275C8B006BC617 /* History.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC94D1500C275C8B006BC617 /* History.cpp */; };
BC94D1540C275C8B006BC617 /* History.h in Headers */ = {isa = PBXBuildFile; fileRef = BC94D1510C275C8B006BC617 /* History.h */; };
BC9585E112F0989500755821 /* PlatformGestureEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9585DF12F0989500755821 /* PlatformGestureEvent.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC96DB430F3A880E00573CB3 /* RenderBoxModelObject.h in Headers */ = {isa = PBXBuildFile; fileRef = BC96DB420F3A880E00573CB3 /* RenderBoxModelObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC96DB460F3A882200573CB3 /* RenderBoxModelObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC96DB450F3A882200573CB3 /* RenderBoxModelObject.cpp */; };
BC97E23A109144950010D361 /* HTMLAllCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = BC97E238109144950010D361 /* HTMLAllCollection.h */; };
......@@ -6492,8 +6489,6 @@
071A9EC1168FB56C002629F9 /* TextTrackCueGeneric.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextTrackCueGeneric.h; sourceTree = "<group>"; };
0720B09E14D3323500642955 /* GenericEventQueue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GenericEventQueue.cpp; sourceTree = "<group>"; };
0720B09F14D3323500642955 /* GenericEventQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GenericEventQueue.h; sourceTree = "<group>"; };
0720B09F14D3323500642956 /* GestureEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GestureEvent.cpp; sourceTree = "<group>"; };
0720B09F14D3323500642957 /* GestureEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GestureEvent.h; sourceTree = "<group>"; };
07221B4A17CEC32700848E51 /* MediaConstraintsImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaConstraintsImpl.cpp; sourceTree = "<group>"; };
07221B4B17CEC32700848E51 /* MediaConstraintsImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaConstraintsImpl.h; sourceTree = "<group>"; };
07221B4C17CEC32700848E51 /* MediaStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaStream.cpp; sourceTree = "<group>"; };
......@@ -11811,7 +11806,6 @@
BC94D1500C275C8B006BC617 /* History.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = History.cpp; sourceTree = "<group>"; };
BC94D1510C275C8B006BC617 /* History.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = History.h; sourceTree = "<group>"; };
BC94D1520C275C8B006BC617 /* History.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = History.idl; sourceTree = "<group>"; };
BC9585DF12F0989500755821 /* PlatformGestureEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformGestureEvent.h; sourceTree = "<group>"; };
BC96DB420F3A880E00573CB3 /* RenderBoxModelObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderBoxModelObject.h; sourceTree = "<group>"; };
BC96DB450F3A882200573CB3 /* RenderBoxModelObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderBoxModelObject.cpp; sourceTree = "<group>"; };
BC97E238109144950010D361 /* HTMLAllCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLAllCollection.h; sourceTree = "<group>"; };
......@@ -19771,7 +19765,6 @@
E1424C89164B3B4E00F32D40 /* PlatformCookieJar.h */,
BC5C76291497FE1400BC4775 /* PlatformEvent.h */,
A723F77A1484CA4C008C6DBE /* PlatformExportMacros.h */,
BC9585DF12F0989500755821 /* PlatformGestureEvent.h */,
935C476609AC4D4300A6AAB4 /* PlatformKeyboardEvent.h */,
932871BF0B20DEB70049035A /* PlatformMenuDescription.h */,
935C476709AC4D4300A6AAB4 /* PlatformMouseEvent.h */,
......@@ -20854,8 +20847,6 @@
A853123C11D0471B00D4D077 /* FragmentScriptingPermission.h */,
0720B09E14D3323500642955 /* GenericEventQueue.cpp */,
0720B09F14D3323500642955 /* GenericEventQueue.h */,
0720B09F14D3323500642956 /* GestureEvent.cpp */,
0720B09F14D3323500642957 /* GestureEvent.h */,
2442BBF81194C9D300D49469 /* HashChangeEvent.h */,
8482B7441198C32E00BFB005 /* HashChangeEvent.idl */,
45099C401370A7800058D513 /* IconURL.cpp */,
......@@ -22442,7 +22433,6 @@
9746AF2914F4DDE6003E7A70 /* GeolocationPosition.h in Headers */,
9746AF2A14F4DDE6003E7A70 /* Geoposition.h in Headers */,
078E092A17D14D1C00420AA1 /* RTCStatsReport.h in Headers */,
0720B0A114D3323500642957 /* GestureEvent.h in Headers */,
086BBD0F136039C2008B15D8 /* Glyph.h in Headers */,
B2C3DA6C0D006CD600EF6F26 /* GlyphBuffer.h in Headers */,
C5D4AA7A116BAFB60069CA93 /* GlyphMetricsMap.h in Headers */,
......@@ -23535,7 +23525,6 @@
BC5C762B1497FE1400BC4775 /* PlatformEvent.h in Headers */,
BCAA487014A052530088FAC4 /* PlatformEventFactoryMac.h in Headers */,
A723F77B1484CA4C008C6DBE /* PlatformExportMacros.h in Headers */,
BC9585E112F0989500755821 /* PlatformGestureEvent.h in Headers */,
935C476809AC4D4300A6AAB4 /* PlatformKeyboardEvent.h in Headers */,
0562F9611573F88F0031CA16 /* PlatformLayer.h in Headers */,
F544F78915CFB2A800AF33A8 /* PlatformLocale.h in Headers */,
......@@ -24670,8 +24659,6 @@
3717D7E717ECC573003C276D /* Copy Scripts */,
93F199FD08245E59001E9ABC /* Resources */,
CD0DBF001422765700280263 /* Copy Audio Resources */,
1C81BA330E97357C00266E07 /* Copy Inspector Resources */,
1C5F9D760E09A1B400E91D0A /* Streamline Inspector Source */,
93F19A0C08245E59001E9ABC /* Sources */,
93F19B1208245E59001E9ABC /* Frameworks */,
5D0D540D0E9862F60029E223 /* Check For Weak VTables and Externals */,
......@@ -25655,7 +25642,6 @@
0720B0A014D3323500642955 /* GenericEventQueue.cpp in Sources */,
9746AF2314F4DDE6003E7A70 /* Geolocation.cpp in Sources */,
9746AF2614F4DDE6003E7A70 /* GeolocationController.cpp in Sources */,
0720B0A014D3323500642956 /* GestureEvent.cpp in Sources */,
B2C3DA6D0D006CD600EF6F26 /* GlyphPageTreeNode.cpp in Sources */,
B2AFFC830D00A5C10030074D /* GlyphPageTreeNodeMac.cpp in Sources */,
BC53C6080DA56C570021EB5D /* Gradient.cpp in Sources */,
/*
* Copyright (C) 2012 Google Inc. All rights reserved.
* Copyright (C) 2013 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#if ENABLE(GESTURE_EVENTS)
#include "GestureEvent.h"
#include "Element.h"
#include <wtf/text/AtomicString.h>
namespace WebCore {
PassRefPtr<GestureEvent> GestureEvent::create()
{
return adoptRef(new GestureEvent);
}
PassRefPtr<GestureEvent> GestureEvent::create(PassRefPtr<AbstractView> view, const PlatformGestureEvent& event)
{
AtomicString eventType;
switch (event.type()) {
case PlatformEvent::GestureScrollBegin:
eventType = eventNames().gesturescrollstartEvent; break;
case PlatformEvent::GestureScrollEnd:
eventType = eventNames().gesturescrollendEvent; break;
case PlatformEvent::GestureScrollUpdate:
case PlatformEvent::GestureScrollUpdateWithoutPropagation:
eventType = eventNames().gesturescrollupdateEvent; break;
case PlatformEvent::GestureTap:
eventType = eventNames().gesturetapEvent; break;
case PlatformEvent::GestureTapDown:
eventType = eventNames().gesturetapdownEvent; break;
case PlatformEvent::GestureTwoFingerTap:
case PlatformEvent::GestureLongPress:
case PlatformEvent::GestureTapDownCancel:
default:
return 0;
}
return adoptRef(new GestureEvent(eventType, event.timestamp(), view, event.globalPosition().x(), event.globalPosition().y(), event.position().x(), event.position().y(), event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(), event.deltaX(), event.deltaY()));
}
void GestureEvent::initGestureEvent(const AtomicString& type, PassRefPtr<AbstractView> view, int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, float deltaX, float deltaY)
{
if (dispatched())
return;
initUIEvent(type, true, true, view, 0);
m_screenLocation = IntPoint(screenX, screenY);
m_ctrlKey = ctrlKey;
m_altKey = altKey;
m_shiftKey = shiftKey;
m_metaKey = metaKey;
m_deltaX = deltaX;
m_deltaY = deltaY;
initCoordinates(IntPoint(clientX, clientY));
}
EventInterface GestureEvent::eventInterface() const
{
// FIXME: This makes it so we never wrap GestureEvents in the right bindings.
return EventInterfaceType;
}
GestureEvent::GestureEvent()
: m_deltaX(0)
, m_deltaY(0)
{
}
GestureEvent::GestureEvent(const AtomicString& type, double timestamp, PassRefPtr<AbstractView> view, int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, float deltaX, float deltaY)
: MouseRelatedEvent(type, true, true, timestamp, view, 0, IntPoint(screenX, screenY), IntPoint(clientX, clientY),
#if ENABLE(POINTER_LOCK)
IntPoint(0, 0),
#endif
ctrlKey, altKey, shiftKey, metaKey)
, m_deltaX(deltaX)
, m_deltaY(deltaY)
{
}
} // namespace WebCore
#endif // ENABLE(GESTURE_EVENTS)
/*
* Copyright (C) 2012 Google Inc. All rights reserved.
* Copyright (C) 2013 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef GestureEvent_h
#define GestureEvent_h
#if ENABLE(GESTURE_EVENTS)
#include "EventNames.h"
#include "Frame.h"
#include "FrameView.h"
#include "MouseRelatedEvent.h"
#include "PlatformEvent.h"
#include "PlatformGestureEvent.h"
namespace WebCore {
class GestureEvent : public MouseRelatedEvent {
public:
virtual ~GestureEvent() { }
static PassRefPtr<GestureEvent> create();
static PassRefPtr<GestureEvent> create(PassRefPtr<AbstractView>, const PlatformGestureEvent&);
void initGestureEvent(const AtomicString& type, PassRefPtr<AbstractView>, int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, float deltaX, float deltaY);
virtual EventInterface eventInterface() const;
float deltaX() const { return m_deltaX; }
float deltaY() const { return m_deltaY; }
private:
GestureEvent();
GestureEvent(const AtomicString& type, double timestamp, PassRefPtr<AbstractView>, int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, float deltaX, float deltaY);
float m_deltaX;
float m_deltaY;
};
} // namespace WebCore
#endif // ENABLE(GESTURE_EVENTS)
#endif // GestureEvent_h
......@@ -113,10 +113,6 @@
#include <wtf/text/CString.h>
#include <wtf/text/StringBuilder.h>
#if ENABLE(GESTURE_EVENTS)
#include "GestureEvent.h"
#endif
#if ENABLE(INDIE_UI)
#include "UIRequestEvent.h"
#endif
......@@ -2100,23 +2096,6 @@ bool Node::dispatchDOMActivateEvent(int detail, PassRefPtr<Event> underlyingEven
return event->defaultHandled();
}
#if ENABLE(GESTURE_EVENTS)
bool Node::dispatchGestureEvent(const PlatformGestureEvent& event)
{
RefPtr<GestureEvent> gestureEvent = GestureEvent::create(document().defaultView(), event);
if (!gestureEvent.get())
return false;
if (isDisabledFormControl(this))
return true;
EventDispatcher::dispatchEvent(this, gestureEvent);
ASSERT(!gestureEvent->defaultPrevented());
return gestureEvent->defaultHandled() || gestureEvent->defaultPrevented();
}
#endif
#if ENABLE(TOUCH_EVENTS)
bool Node::dispatchTouchEvent(PassRefPtr<TouchEvent> event)
{
......
......@@ -79,10 +79,6 @@ class RenderStyle;
class ShadowRoot;
class TagNodeList;
#if ENABLE(GESTURE_EVENTS)
class PlatformGestureEvent;
#endif
#if ENABLE(INDIE_UI)
class UIRequestEvent;
#endif
......@@ -537,9 +533,6 @@ public:
void dispatchSubtreeModifiedEvent();
bool dispatchDOMActivateEvent(int detail, PassRefPtr<Event> underlyingEvent);
#if ENABLE(GESTURE_EVENTS)
bool dispatchGestureEvent(const PlatformGestureEvent&);
#endif
#if ENABLE(TOUCH_EVENTS)
bool dispatchTouchEvent(PassRefPtr<TouchEvent>);
#endif
......
This diff is collapsed.
......@@ -85,10 +85,6 @@ class Widget;
struct DragState;
#if ENABLE(GESTURE_EVENTS)
class PlatformGestureEvent;
#endif
#if ENABLE(DRAG_SUPPORT)
extern const int LinkDragHysteresis;
extern const int ImageDragHysteresis;
......@@ -179,18 +175,6 @@ public:
void defaultWheelEventHandler(Node*, WheelEvent*);
bool handlePasteGlobalSelection(const PlatformMouseEvent&);
#if ENABLE(GESTURE_EVENTS)
bool handleGestureEvent(const PlatformGestureEvent&);
bool handleGestureTap(const PlatformGestureEvent&);
bool handleGestureLongPress(const PlatformGestureEvent&);
bool handleGestureLongTap(const PlatformGestureEvent&);
bool handleGestureTwoFingerTap(const PlatformGestureEvent&);
bool handleGestureScrollUpdate(const PlatformGestureEvent&);
bool handleGestureScrollBegin(const PlatformGestureEvent&);
void clearGestureScrollNodes();
bool isScrollbarHandlingGestures() const;
#endif
#if ENABLE(TOUCH_ADJUSTMENT)
bool shouldApplyTouchAdjustment(const PlatformGestureEvent&) const;
......@@ -204,9 +188,6 @@ public:
#if ENABLE(CONTEXT_MENUS)
bool sendContextMenuEvent(const PlatformMouseEvent&);
bool sendContextMenuEventForKey();
#if ENABLE(GESTURE_EVENTS)
bool sendContextMenuEventForGesture(const PlatformGestureEvent&);
#endif
#endif
void setMouseDownMayStartAutoscroll() { m_mouseDownMayStartAutoscroll = true; }
......@@ -394,14 +375,6 @@ private:
bool isKeyEventAllowedInFullScreen(const PlatformKeyboardEvent&) const;
#endif
#if ENABLE(GESTURE_EVENTS)
bool handleGestureTapDown();
bool handleGestureForTextSelectionOrContextMenu(const PlatformGestureEvent&);
bool passGestureEventToWidget(const PlatformGestureEvent&, Widget*);
bool passGestureEventToWidgetIfPossible(const PlatformGestureEvent&, RenderObject*);
bool sendScrollEventToView(const PlatformGestureEvent&, const FloatSize&);
#endif
void setLastKnownMousePosition(const PlatformMouseEvent&);
#if ENABLE(CURSOR_VISIBILITY)
......@@ -496,13 +469,6 @@ private:
bool m_touchPressed;
#endif
#if ENABLE(GESTURE_EVENTS)
RefPtr<Node> m_scrollGestureHandlingNode;
bool m_lastHitTestResultOverWidget;
RefPtr<Element> m_previousGestureScrolledElement;
RefPtr<Scrollbar> m_scrollbarHandlingScrollGesture;
#endif
double m_maxMouseMovedDuration;
PlatformEvent::Type m_baseEventType;
bool m_didStartDrag;
......
/*
* Copyright (C) 2011 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef PlatformGestureEvent_h
#define PlatformGestureEvent_h
#if ENABLE(GESTURE_EVENTS)
#include "FloatPoint.h"
#include "IntPoint.h"
#include "IntSize.h"
#include "PlatformEvent.h"
namespace WebCore {
class PlatformGestureEvent : public PlatformEvent {
public:
PlatformGestureEvent()
: PlatformEvent(PlatformEvent::GestureScrollBegin)
, m_deltaX(0)
, m_deltaY(0)
{
}
PlatformGestureEvent(Type type, const IntPoint& position, const IntPoint& globalPosition, double timestamp, float deltaX, float deltaY, bool shiftKey, bool ctrlKey, bool altKey, bool metaKey)
: PlatformEvent(type, shiftKey, ctrlKey, altKey, metaKey, timestamp)
, m_position(position)
, m_globalPosition(globalPosition)
, m_deltaX(deltaX)
, m_deltaY(deltaY)
{
}
PlatformGestureEvent(Type type, const IntPoint& position, const IntPoint& globalPosition, double timestamp, const IntSize& area, const FloatPoint& delta, bool shiftKey, bool ctrlKey, bool altKey, bool metaKey)
: PlatformEvent(type, shiftKey, ctrlKey, altKey, metaKey, timestamp)
, m_position(position)
, m_globalPosition(globalPosition)
, m_area(area)
, m_deltaX(delta.x())
, m_deltaY(delta.y())
{
}
const IntPoint& position() const { return m_position; } // PlatformWindow coordinates.
const IntPoint& globalPosition() const { return m_globalPosition; } // Screen coordinates.
const IntSize& area() const { return m_area; }
float deltaX() const { return m_deltaX; }
float deltaY() const { return m_deltaY; }
protected:
IntPoint m_position;
IntPoint m_globalPosition;
IntSize m_area;
float m_deltaX;
float m_deltaY;
};
} // namespace WebCore
#endif // ENABLE(GESTURE_EVENTS)
#endif // PlatformGestureEvent_h
......@@ -34,10 +34,6 @@
#include "ScrollbarTheme.h"
#include <algorithm>
#if ENABLE(GESTURE_EVENTS)
#include "PlatformGestureEvent.h"
#endif
using namespace std;
#if PLATFORM(GTK)
......@@ -340,46 +336,6 @@ void Scrollbar::setPressedPart(ScrollbarPart part)
theme()->invalidatePart(this, m_hoveredPart);
}
#if ENABLE(GESTURE_EVENTS)
bool Scrollbar::gestureEvent(const PlatformGestureEvent& evt)
{
bool handled = false;
switch (evt.type()) {
case PlatformEvent::GestureTapDown:
setPressedPart(theme()->hitTest(this, evt.position()));
m_pressedPos = (orientation() == HorizontalScrollbar ? convertFromContainingWindow(evt.position()).x() : convertFromContainingWindow(evt.position()).y());
return true;
case PlatformEvent::GestureTapDownCancel:
case PlatformEvent::GestureScrollBegin:
if (m_pressedPart == ThumbPart) {
m_scrollPos = m_pressedPos;
return true;
}
break;
case PlatformEvent::GestureScrollUpdate:
case PlatformEvent::GestureScrollUpdateWithoutPropagation:
if (m_pressedPart == ThumbPart) {
m_scrollPos += HorizontalScrollbar ? evt.deltaX() : evt.deltaY();
moveThumb(m_scrollPos, false);
return true;
}
break;
case PlatformEvent::GestureScrollEnd:
m_scrollPos = 0;
break;
case PlatformEvent::GestureTap:
if (m_pressedPart != ThumbPart && m_pressedPart != NoPart)
handled = m_scrollableArea && m_scrollableArea->scroll(pressedPartScrollDirection(), pressedPartScrollGranularity());
break;
default:
break;
}
setPressedPart(NoPart);
m_pressedPos = 0;
return handled;
}
#endif
bool Scrollbar::mouseMoved(const PlatformMouseEvent& evt)
{
if (m_pressedPart == ThumbPart) {
......
......@@ -41,10 +41,6 @@ class PlatformMouseEvent;
class ScrollableArea;
class ScrollbarTheme;
#if ENABLE(GESTURE_EVENTS)
class PlatformGestureEvent;
#endif
class Scrollbar : public Widget,
public ScrollbarThemeClient {
......@@ -126,10 +122,6 @@ public:
bool isWindowActive() const;
#if ENABLE(GESTURE_EVENTS)
bool gestureEvent(const PlatformGestureEvent&);
#endif
// These methods are used for platform scrollbars to give :hover feedback. They will not get called
// when the mouse went down in a scrollbar, since it is assumed the scrollbar will start
// grabbing all events in that case anyway.
......
......@@ -30,10 +30,6 @@
#include "PlatformMouseEvent.h"
#include "PlatformWheelEvent.h"
#if ENABLE(GESTURE_EVENTS)
#include "PlatformGestureEvent.h"
#endif
namespace WebCore {
class PlatformEventFactory {
......@@ -41,9 +37,6 @@ public:
static PlatformMouseEvent createPlatformMouseEvent(NSEvent *, NSView *windowView);
static PlatformWheelEvent createPlatformWheelEvent(NSEvent *, NSView *windowView);
static PlatformKeyboardEvent createPlatformKeyboardEvent(NSEvent *);
#if ENABLE(GESTURE_EVENTS)
static PlatformGestureEvent createPlatformGestureEvent(NSEvent *, NSView *windowView);
#endif
};
#if PLATFORM(MAC) && defined(__OBJC__)
......