Diff
Modified: trunk/Source/WebCore/ChangeLog (164550 => 164551)
--- trunk/Source/WebCore/ChangeLog 2014-02-22 22:39:22 UTC (rev 164550)
+++ trunk/Source/WebCore/ChangeLog 2014-02-22 23:56:26 UTC (rev 164551)
@@ -1,3 +1,32 @@
+2014-02-21 Sam Weinig <[email protected]>
+
+ Expose phase and momentum phase as SPI on DOMWheelEvent
+ <rdar://problem/16110871>
+ https://bugs.webkit.org/show_bug.cgi?id=129184
+
+ Reviewed by Anders Carlsson.
+
+ * WebCore.exp.in:
+ Export core(DOMWheelEvent).
+
+ * WebCore.xcodeproj/project.pbxproj:
+ Make DOMWheelEventInternal.h available in WebKit.
+
+ * dom/Element.cpp:
+ (WebCore::Element::dispatchWheelEvent):
+ * dom/WheelEvent.cpp:
+ (WebCore::determineDeltaMode):
+ (WebCore::WheelEvent::WheelEvent):
+ (WebCore::WheelEvent::initWheelEvent):
+ (WebCore::WheelEvent::initWebKitWheelEvent):
+ Move PlatformWheelEvent -> DOMWheelEvent conversion to DOMWheelEvent.
+
+ * dom/WheelEvent.h:
+ (WebCore::WheelEvent::create):
+ (WebCore::WheelEvent::phase):
+ (WebCore::WheelEvent::momentumPhase):
+ Store phase and momentumPhase on the WheelEvent.
+
2014-02-22 Alexey Proskuryakov <[email protected]>
Rename JWK key_ops values from wrap/unwrap to wrapKey/unwrapKey
Modified: trunk/Source/WebCore/WebCore.exp.in (164550 => 164551)
--- trunk/Source/WebCore/WebCore.exp.in 2014-02-22 22:39:22 UTC (rev 164550)
+++ trunk/Source/WebCore/WebCore.exp.in 2014-02-22 23:56:26 UTC (rev 164551)
@@ -57,6 +57,7 @@
__Z3kitPN7WebCore8DocumentE
__Z4coreP10DOMElement
__Z4coreP11DOMDocument
+__Z4coreP13DOMWheelEvent
__Z4coreP19DOMDocumentFragment
__Z4coreP22DOMCSSStyleDeclaration
__Z4coreP7DOMNode
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (164550 => 164551)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2014-02-22 22:39:22 UTC (rev 164550)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2014-02-22 23:56:26 UTC (rev 164551)
@@ -2289,6 +2289,7 @@
7BE7427381FA906FBB4F0F2C /* JSSVGGraphicsElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 950C4C02BED8936F818E2F99 /* JSSVGGraphicsElement.h */; };
7C2BDD3D17C7F98C0038FF15 /* JSDOMGlobalObjectTask.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C2BDD3B17C7F98B0038FF15 /* JSDOMGlobalObjectTask.cpp */; };
7C2BDD3E17C7F98C0038FF15 /* JSDOMGlobalObjectTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C2BDD3C17C7F98B0038FF15 /* JSDOMGlobalObjectTask.h */; };
+ 7C4902A218B825F8007D9298 /* DOMWheelEventInternal.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 85989DCA0ACC8BBD00A0BC51 /* DOMWheelEventInternal.h */; };
7C522D4B15B477E8009B7C95 /* InspectorOverlay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C522D4915B477E8009B7C95 /* InspectorOverlay.cpp */; };
7C5343FC17B74B63004232F0 /* JSMediaQueryListListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C5343FA17B74B63004232F0 /* JSMediaQueryListListener.cpp */; };
7C5343FD17B74B63004232F0 /* JSMediaQueryListListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C5343FB17B74B63004232F0 /* JSMediaQueryListListener.h */; };
@@ -2473,7 +2474,7 @@
85031B4E0A44EFC700F992E0 /* UIEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 85031B380A44EFC700F992E0 /* UIEvent.h */; settings = {ATTRIBUTES = (Private, ); }; };
85031B4F0A44EFC700F992E0 /* UIEventWithKeyState.h in Headers */ = {isa = PBXBuildFile; fileRef = 85031B390A44EFC700F992E0 /* UIEventWithKeyState.h */; settings = {ATTRIBUTES = (Private, ); }; };
85031B500A44EFC700F992E0 /* WheelEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 85031B3A0A44EFC700F992E0 /* WheelEvent.cpp */; };
- 85031B510A44EFC700F992E0 /* WheelEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 85031B3B0A44EFC700F992E0 /* WheelEvent.h */; };
+ 85031B510A44EFC700F992E0 /* WheelEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 85031B3B0A44EFC700F992E0 /* WheelEvent.h */; settings = {ATTRIBUTES = (Private, ); }; };
85032DD70AA8C9BE007D3B7D /* DOMCSSCharsetRule.h in Headers */ = {isa = PBXBuildFile; fileRef = 85032DC30AA8C9BE007D3B7D /* DOMCSSCharsetRule.h */; };
85032DD80AA8C9BE007D3B7D /* DOMCSSCharsetRule.mm in Sources */ = {isa = PBXBuildFile; fileRef = 85032DC40AA8C9BE007D3B7D /* DOMCSSCharsetRule.mm */; };
85032DD90AA8C9BE007D3B7D /* DOMCSSFontFaceRule.h in Headers */ = {isa = PBXBuildFile; fileRef = 85032DC50AA8C9BE007D3B7D /* DOMCSSFontFaceRule.h */; };
@@ -6633,6 +6634,7 @@
85F32B400AA6401A00FF3184 /* DOMHTMLInputElement.h in Copy Generated Headers */,
6596F2B30B8731DF001326BD /* DOMHTMLInputElementInternal.h in Copy Generated Headers */,
1CCA732210ADD44A00FD440D /* DOMHTMLInputElementPrivate.h in Copy Generated Headers */,
+ 7C4902A218B825F8007D9298 /* DOMWheelEventInternal.h in Copy Generated Headers */,
85BA4CE70AA686510088052D /* DOMHTMLLabelElement.h in Copy Generated Headers */,
85BA4CE80AA686510088052D /* DOMHTMLLegendElement.h in Copy Generated Headers */,
85BA4D2B0AA6889F0088052D /* DOMHTMLLIElement.h in Copy Generated Headers */,
Modified: trunk/Source/WebCore/dom/Element.cpp (164550 => 164551)
--- trunk/Source/WebCore/dom/Element.cpp 2014-02-22 22:39:22 UTC (rev 164550)
+++ trunk/Source/WebCore/dom/Element.cpp 2014-02-22 23:56:26 UTC (rev 164551)
@@ -254,27 +254,13 @@
return didNotSwallowEvent;
}
-inline static unsigned deltaMode(const PlatformWheelEvent& event)
-{
- return event.granularity() == ScrollByPageWheelEvent ? WheelEvent::DOM_DELTA_PAGE : WheelEvent::DOM_DELTA_PIXEL;
-}
bool Element::dispatchWheelEvent(const PlatformWheelEvent& event)
{
if (!(event.deltaX() || event.deltaY()))
return true;
- RefPtr<WheelEvent> wheelEvent = WheelEvent::create(
- FloatPoint(event.wheelTicksX(), event.wheelTicksY()),
- FloatPoint(event.deltaX(), event.deltaY()),
- deltaMode(event),
- document().defaultView(),
- event.globalPosition(),
- event.position(),
- event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(),
- event.directionInvertedFromDevice(),
- event.timestamp());
-
+ RefPtr<WheelEvent> wheelEvent = WheelEvent::create(event, document().defaultView());
return EventDispatcher::dispatchEvent(this, wheelEvent) && !wheelEvent->defaultHandled();
}
Modified: trunk/Source/WebCore/dom/WheelEvent.cpp (164550 => 164551)
--- trunk/Source/WebCore/dom/WheelEvent.cpp 2014-02-22 22:39:22 UTC (rev 164550)
+++ trunk/Source/WebCore/dom/WheelEvent.cpp 2014-02-22 23:56:26 UTC (rev 164551)
@@ -26,12 +26,15 @@
#include "Clipboard.h"
#include "EventNames.h"
-#include "PlatformWheelEvent.h"
-
#include <wtf/MathExtras.h>
namespace WebCore {
+inline static unsigned determineDeltaMode(const PlatformWheelEvent& event)
+{
+ return event.granularity() == ScrollByPageWheelEvent ? WheelEvent::DOM_DELTA_PAGE : WheelEvent::DOM_DELTA_PIXEL;
+}
+
WheelEventInit::WheelEventInit()
: deltaX(0)
, deltaY(0)
@@ -61,28 +64,26 @@
{
}
-WheelEvent::WheelEvent(const FloatPoint& wheelTicks, const FloatPoint& rawDelta, unsigned deltaMode,
- PassRefPtr<AbstractView> view, const IntPoint& screenLocation, const IntPoint& pageLocation,
- bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool directionInvertedFromDevice, double timestamp)
- : MouseEvent(eventNames().wheelEvent,
- true, true, timestamp, view, 0, screenLocation.x(), screenLocation.y(),
- pageLocation.x(), pageLocation.y(),
+WheelEvent::WheelEvent(const PlatformWheelEvent& event, PassRefPtr<AbstractView> view)
+ : MouseEvent(eventNames().wheelEvent, true, true, event.timestamp(), view, 0, event.globalPosition().x(), event.globalPosition().y(), event.position().x(), event.position().y()
#if ENABLE(POINTER_LOCK)
- 0, 0,
+ , 0, 0
#endif
- ctrlKey, altKey, shiftKey, metaKey, 0, 0, 0, false)
- , m_wheelDelta(wheelTicks.x() * TickMultiplier, wheelTicks.y() * TickMultiplier)
- , m_deltaX(-rawDelta.x())
- , m_deltaY(-rawDelta.y())
+ , event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(), 0, 0, 0, false)
+ , m_wheelDelta(event.wheelTicksX() * TickMultiplier, event.wheelTicksY() * TickMultiplier)
+ , m_deltaX(-event.deltaX())
+ , m_deltaY(-event.deltaY())
, m_deltaZ(0)
- , m_deltaMode(deltaMode)
- , m_directionInvertedFromDevice(directionInvertedFromDevice)
+ , m_deltaMode(determineDeltaMode(event))
+ , m_directionInvertedFromDevice(event.directionInvertedFromDevice())
+#if PLATFORM(MAC)
+ , m_phase(event.phase())
+ , m_momentumPhase(event.momentumPhase())
+#endif
{
}
-void WheelEvent::initWheelEvent(int rawDeltaX, int rawDeltaY, PassRefPtr<AbstractView> view,
- int screenX, int screenY, int pageX, int pageY,
- bool ctrlKey, bool altKey, bool shiftKey, bool metaKey)
+void WheelEvent::initWheelEvent(int rawDeltaX, int rawDeltaY, PassRefPtr<AbstractView> view, int screenX, int screenY, int pageX, int pageY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey)
{
if (dispatched())
return;
@@ -106,12 +107,9 @@
initCoordinates(IntPoint(pageX, pageY));
}
-void WheelEvent::initWebKitWheelEvent(int rawDeltaX, int rawDeltaY, PassRefPtr<AbstractView> view,
- int screenX, int screenY, int pageX, int pageY,
- bool ctrlKey, bool altKey, bool shiftKey, bool metaKey)
+void WheelEvent::initWebKitWheelEvent(int rawDeltaX, int rawDeltaY, PassRefPtr<AbstractView> view, int screenX, int screenY, int pageX, int pageY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey)
{
- initWheelEvent(rawDeltaX, rawDeltaY, view, screenX, screenY, pageX, pageY,
- ctrlKey, altKey, shiftKey, metaKey);
+ initWheelEvent(rawDeltaX, rawDeltaY, view, screenX, screenY, pageX, pageY, ctrlKey, altKey, shiftKey, metaKey);
}
EventInterface WheelEvent::eventInterface() const
Modified: trunk/Source/WebCore/dom/WheelEvent.h (164550 => 164551)
--- trunk/Source/WebCore/dom/WheelEvent.h 2014-02-22 22:39:22 UTC (rev 164550)
+++ trunk/Source/WebCore/dom/WheelEvent.h 2014-02-22 23:56:26 UTC (rev 164551)
@@ -27,6 +27,7 @@
#include "FloatPoint.h"
#include "MouseEvent.h"
+#include "PlatformWheelEvent.h"
namespace WebCore {
@@ -63,13 +64,9 @@
return adoptRef(new WheelEvent(type, initializer));
}
- static PassRefPtr<WheelEvent> create(const FloatPoint& wheelTicks,
- const FloatPoint& rawDelta, unsigned deltaMode, PassRefPtr<AbstractView> view,
- const IntPoint& screenLocation, const IntPoint& pageLocation,
- bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool directionInvertedFromDevice, double timestamp)
+ static PassRefPtr<WheelEvent> create(const PlatformWheelEvent& event, PassRefPtr<AbstractView> view)
{
- return adoptRef(new WheelEvent(wheelTicks, rawDelta, deltaMode, view,
- screenLocation, pageLocation, ctrlKey, altKey, shiftKey, metaKey, directionInvertedFromDevice, timestamp));
+ return adoptRef(new WheelEvent(event, view));
}
void initWheelEvent(int rawDeltaX, int rawDeltaY, PassRefPtr<AbstractView>,
@@ -95,12 +92,15 @@
virtual EventInterface eventInterface() const override;
virtual bool isMouseEvent() const override;
+#if PLATFORM(MAC)
+ PlatformWheelEventPhase phase() const { return m_phase; }
+ PlatformWheelEventPhase momentumPhase() const { return m_momentumPhase; }
+#endif
+
private:
WheelEvent();
WheelEvent(const AtomicString&, const WheelEventInit&);
- WheelEvent(const FloatPoint& wheelTicks, const FloatPoint& rawDelta,
- unsigned, PassRefPtr<AbstractView>, const IntPoint& screenLocation, const IntPoint& pageLocation,
- bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool directionInvertedFromDevice, double timestamp);
+ WheelEvent(const PlatformWheelEvent&, PassRefPtr<AbstractView>);
virtual bool isWheelEvent() const override;
@@ -110,6 +110,11 @@
double m_deltaZ;
unsigned m_deltaMode;
bool m_directionInvertedFromDevice;
+
+#if PLATFORM(MAC)
+ PlatformWheelEventPhase m_phase;
+ PlatformWheelEventPhase m_momentumPhase;
+#endif
};
EVENT_TYPE_CASTS(WheelEvent)
Modified: trunk/Source/WebKit/mac/ChangeLog (164550 => 164551)
--- trunk/Source/WebKit/mac/ChangeLog 2014-02-22 22:39:22 UTC (rev 164550)
+++ trunk/Source/WebKit/mac/ChangeLog 2014-02-22 23:56:26 UTC (rev 164551)
@@ -1,3 +1,21 @@
+2014-02-21 Sam Weinig <[email protected]>
+
+ Expose phase and momentum phase as SPI on DOMWheelEvent
+ <rdar://problem/16110871>
+ https://bugs.webkit.org/show_bug.cgi?id=129184
+
+ Reviewed by Anders Carlsson.
+
+ * DOM/WebDOMOperations.mm:
+ (toNSEventPhase):
+ (-[DOMWheelEvent _phase]):
+ (-[DOMWheelEvent _momentumPhase]):
+ * DOM/WebDOMOperationsPrivate.h:
+ Expose _phase and _momentumPhase as SPI.
+
+ * MigrateHeaders.make:
+ Make DOMWheelEventInternal.h to WebKit.
+
2014-02-22 David Kilzer <[email protected]>
Revert r164434 since it actually broke ASan builds
Modified: trunk/Source/WebKit/mac/DOM/WebDOMOperations.mm (164550 => 164551)
--- trunk/Source/WebKit/mac/DOM/WebDOMOperations.mm 2014-02-22 22:39:22 UTC (rev 164550)
+++ trunk/Source/WebKit/mac/DOM/WebDOMOperations.mm 2014-02-22 23:56:26 UTC (rev 164551)
@@ -32,6 +32,7 @@
#import "DOMElementInternal.h"
#import "DOMNodeInternal.h"
#import "DOMRangeInternal.h"
+#import "DOMWheelEventInternal.h"
#import "WebArchiveInternal.h"
#import "WebDataSourcePrivate.h"
#import "WebFrameInternal.h"
@@ -46,14 +47,16 @@
#import <WebCore/HTMLParserIdioms.h>
#import <WebCore/JSElement.h>
#import <WebCore/LegacyWebArchive.h>
-#import <WebCore/markup.h>
+#import <WebCore/PlatformWheelEvent.h>
#import <WebCore/RenderElement.h>
#import <WebCore/RenderTreeAsText.h>
#import <WebCore/ShadowRoot.h>
+#import <WebCore/WheelEvent.h>
+#import <WebCore/markup.h>
#import <WebKit/DOMExtensions.h>
#import <WebKit/DOMHTML.h>
+#import <runtime/JSCJSValue.h>
#import <runtime/JSLock.h>
-#import <runtime/JSCJSValue.h>
#import <wtf/Assertions.h>
using namespace WebCore;
@@ -224,3 +227,40 @@
}
@end
+
+#if !PLATFORM(IOS)
+static NSEventPhase toNSEventPhase(PlatformWheelEventPhase platformPhase)
+{
+ uint32_t phase = PlatformWheelEventPhaseNone;
+ if (platformPhase & PlatformWheelEventPhaseBegan)
+ phase |= NSEventPhaseBegan;
+ if (platformPhase & PlatformWheelEventPhaseStationary)
+ phase |= NSEventPhaseStationary;
+ if (platformPhase & PlatformWheelEventPhaseChanged)
+ phase |= NSEventPhaseChanged;
+ if (platformPhase & PlatformWheelEventPhaseEnded)
+ phase |= NSEventPhaseEnded;
+ if (platformPhase & PlatformWheelEventPhaseCancelled)
+ phase |= NSEventPhaseCancelled;
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
+ if (platformPhase & PlatformWheelEventPhaseMayBegin)
+ phase |= NSEventPhaseMayBegin;
+#endif
+
+ return static_cast<NSEventPhase>(phase);
+}
+
+@implementation DOMWheelEvent (WebDOMWheelEventOperationsPrivate)
+
+- (NSEventPhase)_phase
+{
+ return toNSEventPhase(core(self)->phase());
+}
+
+- (NSEventPhase)_momentumPhase
+{
+ return toNSEventPhase(core(self)->momentumPhase());
+}
+
+@end
+#endif
Modified: trunk/Source/WebKit/mac/DOM/WebDOMOperationsPrivate.h (164550 => 164551)
--- trunk/Source/WebKit/mac/DOM/WebDOMOperationsPrivate.h 2014-02-22 22:39:22 UTC (rev 164550)
+++ trunk/Source/WebKit/mac/DOM/WebDOMOperationsPrivate.h 2014-02-22 23:56:26 UTC (rev 164551)
@@ -31,6 +31,9 @@
#if TARGET_OS_IPHONE
#import <Foundation/NSGeometry.h>
+#else
+#import <AppKit/NSEvent.h>
+#import <WebKit/DOMWheelEvent.h>
#endif
@interface DOMElement (WebDOMElementOperationsPrivate)
@@ -56,3 +59,10 @@
- (void)showPlaceholderIfNecessary;
#endif
@end
+
+#if !TARGET_OS_IPHONE
+@interface DOMWheelEvent (WebDOMWheelEventOperationsPrivate)
+- (NSEventPhase)_phase;
+- (NSEventPhase)_momentumPhase;
+@end
+#endif
Modified: trunk/Source/WebKit/mac/MigrateHeaders.make (164550 => 164551)
--- trunk/Source/WebKit/mac/MigrateHeaders.make 2014-02-22 22:39:22 UTC (rev 164550)
+++ trunk/Source/WebKit/mac/MigrateHeaders.make 2014-02-22 23:56:26 UTC (rev 164551)
@@ -177,6 +177,7 @@
$(PUBLIC_HEADERS_DIR)/DOMUIEvent.h \
$(PUBLIC_HEADERS_DIR)/DOMViews.h \
$(PUBLIC_HEADERS_DIR)/DOMWheelEvent.h \
+ $(INTERNAL_HEADERS_DIR)/DOMWheelEventInternal.h \
$(PUBLIC_HEADERS_DIR)/DOMXPath.h \
$(PUBLIC_HEADERS_DIR)/DOMXPathException.h \
$(PUBLIC_HEADERS_DIR)/DOMXPathExpression.h \