<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[164551] trunk/Source</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/164551">164551</a></dd>
<dt>Author</dt> <dd>weinig@apple.com</dd>
<dt>Date</dt> <dd>2014-02-22 15:56:26 -0800 (Sat, 22 Feb 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>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:
* 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.
../WebKit/mac:
* DOM/WebDOMOperations.mm:
(toNSEventPhase):
(-[DOMWheelEvent _phase]):
(-[DOMWheelEvent _momentumPhase]):
* DOM/WebDOMOperationsPrivate.h:
Expose _phase and _momentumPhase as SPI.
* MigrateHeaders.make:
Make DOMWheelEventInternal.h to WebKit.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoredomElementcpp">trunk/Source/WebCore/dom/Element.cpp</a></li>
<li><a href="#trunkSourceWebCoredomWheelEventcpp">trunk/Source/WebCore/dom/WheelEvent.cpp</a></li>
<li><a href="#trunkSourceWebCoredomWheelEventh">trunk/Source/WebCore/dom/WheelEvent.h</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacDOMWebDOMOperationsmm">trunk/Source/WebKit/mac/DOM/WebDOMOperations.mm</a></li>
<li><a href="#trunkSourceWebKitmacDOMWebDOMOperationsPrivateh">trunk/Source/WebKit/mac/DOM/WebDOMOperationsPrivate.h</a></li>
<li><a href="#trunkSourceWebKitmacMigrateHeadersmake">trunk/Source/WebKit/mac/MigrateHeaders.make</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (164550 => 164551)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -1,3 +1,32 @@
</span><ins>+2014-02-21 Sam Weinig <sam@webkit.org>
+
+ 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.
+
</ins><span class="cx"> 2014-02-22 Alexey Proskuryakov <ap@apple.com>
</span><span class="cx">
</span><span class="cx"> Rename JWK key_ops values from wrap/unwrap to wrapKey/unwrapKey
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (164550 => 164551)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -57,6 +57,7 @@
</span><span class="cx"> __Z3kitPN7WebCore8DocumentE
</span><span class="cx"> __Z4coreP10DOMElement
</span><span class="cx"> __Z4coreP11DOMDocument
</span><ins>+__Z4coreP13DOMWheelEvent
</ins><span class="cx"> __Z4coreP19DOMDocumentFragment
</span><span class="cx"> __Z4coreP22DOMCSSStyleDeclaration
</span><span class="cx"> __Z4coreP7DOMNode
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (164550 => 164551)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -2289,6 +2289,7 @@
</span><span class="cx">                 7BE7427381FA906FBB4F0F2C /* JSSVGGraphicsElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 950C4C02BED8936F818E2F99 /* JSSVGGraphicsElement.h */; };
</span><span class="cx">                 7C2BDD3D17C7F98C0038FF15 /* JSDOMGlobalObjectTask.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C2BDD3B17C7F98B0038FF15 /* JSDOMGlobalObjectTask.cpp */; };
</span><span class="cx">                 7C2BDD3E17C7F98C0038FF15 /* JSDOMGlobalObjectTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C2BDD3C17C7F98B0038FF15 /* JSDOMGlobalObjectTask.h */; };
</span><ins>+                7C4902A218B825F8007D9298 /* DOMWheelEventInternal.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 85989DCA0ACC8BBD00A0BC51 /* DOMWheelEventInternal.h */; };
</ins><span class="cx">                 7C522D4B15B477E8009B7C95 /* InspectorOverlay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C522D4915B477E8009B7C95 /* InspectorOverlay.cpp */; };
</span><span class="cx">                 7C5343FC17B74B63004232F0 /* JSMediaQueryListListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C5343FA17B74B63004232F0 /* JSMediaQueryListListener.cpp */; };
</span><span class="cx">                 7C5343FD17B74B63004232F0 /* JSMediaQueryListListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C5343FB17B74B63004232F0 /* JSMediaQueryListListener.h */; };
</span><span class="lines">@@ -2473,7 +2474,7 @@
</span><span class="cx">                 85031B4E0A44EFC700F992E0 /* UIEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 85031B380A44EFC700F992E0 /* UIEvent.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 85031B4F0A44EFC700F992E0 /* UIEventWithKeyState.h in Headers */ = {isa = PBXBuildFile; fileRef = 85031B390A44EFC700F992E0 /* UIEventWithKeyState.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 85031B500A44EFC700F992E0 /* WheelEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 85031B3A0A44EFC700F992E0 /* WheelEvent.cpp */; };
</span><del>-                85031B510A44EFC700F992E0 /* WheelEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 85031B3B0A44EFC700F992E0 /* WheelEvent.h */; };
</del><ins>+                85031B510A44EFC700F992E0 /* WheelEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 85031B3B0A44EFC700F992E0 /* WheelEvent.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 85032DD70AA8C9BE007D3B7D /* DOMCSSCharsetRule.h in Headers */ = {isa = PBXBuildFile; fileRef = 85032DC30AA8C9BE007D3B7D /* DOMCSSCharsetRule.h */; };
</span><span class="cx">                 85032DD80AA8C9BE007D3B7D /* DOMCSSCharsetRule.mm in Sources */ = {isa = PBXBuildFile; fileRef = 85032DC40AA8C9BE007D3B7D /* DOMCSSCharsetRule.mm */; };
</span><span class="cx">                 85032DD90AA8C9BE007D3B7D /* DOMCSSFontFaceRule.h in Headers */ = {isa = PBXBuildFile; fileRef = 85032DC50AA8C9BE007D3B7D /* DOMCSSFontFaceRule.h */; };
</span><span class="lines">@@ -6633,6 +6634,7 @@
</span><span class="cx">                                 85F32B400AA6401A00FF3184 /* DOMHTMLInputElement.h in Copy Generated Headers */,
</span><span class="cx">                                 6596F2B30B8731DF001326BD /* DOMHTMLInputElementInternal.h in Copy Generated Headers */,
</span><span class="cx">                                 1CCA732210ADD44A00FD440D /* DOMHTMLInputElementPrivate.h in Copy Generated Headers */,
</span><ins>+                                7C4902A218B825F8007D9298 /* DOMWheelEventInternal.h in Copy Generated Headers */,
</ins><span class="cx">                                 85BA4CE70AA686510088052D /* DOMHTMLLabelElement.h in Copy Generated Headers */,
</span><span class="cx">                                 85BA4CE80AA686510088052D /* DOMHTMLLegendElement.h in Copy Generated Headers */,
</span><span class="cx">                                 85BA4D2B0AA6889F0088052D /* DOMHTMLLIElement.h in Copy Generated Headers */,
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.cpp (164550 => 164551)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -254,27 +254,13 @@
</span><span class="cx"> return didNotSwallowEvent;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-inline static unsigned deltaMode(const PlatformWheelEvent& event)
-{
- return event.granularity() == ScrollByPageWheelEvent ? WheelEvent::DOM_DELTA_PAGE : WheelEvent::DOM_DELTA_PIXEL;
-}
</del><span class="cx">
</span><span class="cx"> bool Element::dispatchWheelEvent(const PlatformWheelEvent& event)
</span><span class="cx"> {
</span><span class="cx"> if (!(event.deltaX() || event.deltaY()))
</span><span class="cx"> return true;
</span><span class="cx">
</span><del>- 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());
-
</del><ins>+ RefPtr<WheelEvent> wheelEvent = WheelEvent::create(event, document().defaultView());
</ins><span class="cx"> return EventDispatcher::dispatchEvent(this, wheelEvent) && !wheelEvent->defaultHandled();
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoredomWheelEventcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/WheelEvent.cpp (164550 => 164551)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -26,12 +26,15 @@
</span><span class="cx">
</span><span class="cx"> #include "Clipboard.h"
</span><span class="cx"> #include "EventNames.h"
</span><del>-#include "PlatformWheelEvent.h"
-
</del><span class="cx"> #include <wtf/MathExtras.h>
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><ins>+inline static unsigned determineDeltaMode(const PlatformWheelEvent& event)
+{
+ return event.granularity() == ScrollByPageWheelEvent ? WheelEvent::DOM_DELTA_PAGE : WheelEvent::DOM_DELTA_PIXEL;
+}
+
</ins><span class="cx"> WheelEventInit::WheelEventInit()
</span><span class="cx"> : deltaX(0)
</span><span class="cx"> , deltaY(0)
</span><span class="lines">@@ -61,28 +64,26 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-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(),
</del><ins>+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()
</ins><span class="cx"> #if ENABLE(POINTER_LOCK)
</span><del>- 0, 0,
</del><ins>+ , 0, 0
</ins><span class="cx"> #endif
</span><del>- ctrlKey, altKey, shiftKey, metaKey, 0, 0, 0, false)
- , m_wheelDelta(wheelTicks.x() * TickMultiplier, wheelTicks.y() * TickMultiplier)
- , m_deltaX(-rawDelta.x())
- , m_deltaY(-rawDelta.y())
</del><ins>+ , 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())
</ins><span class="cx"> , m_deltaZ(0)
</span><del>- , m_deltaMode(deltaMode)
- , m_directionInvertedFromDevice(directionInvertedFromDevice)
</del><ins>+ , m_deltaMode(determineDeltaMode(event))
+ , m_directionInvertedFromDevice(event.directionInvertedFromDevice())
+#if PLATFORM(MAC)
+ , m_phase(event.phase())
+ , m_momentumPhase(event.momentumPhase())
+#endif
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-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)
</del><ins>+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)
</ins><span class="cx"> {
</span><span class="cx"> if (dispatched())
</span><span class="cx"> return;
</span><span class="lines">@@ -106,12 +107,9 @@
</span><span class="cx"> initCoordinates(IntPoint(pageX, pageY));
</span><span class="cx"> }
</span><span class="cx">
</span><del>-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)
</del><ins>+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)
</ins><span class="cx"> {
</span><del>- initWheelEvent(rawDeltaX, rawDeltaY, view, screenX, screenY, pageX, pageY,
- ctrlKey, altKey, shiftKey, metaKey);
</del><ins>+ initWheelEvent(rawDeltaX, rawDeltaY, view, screenX, screenY, pageX, pageY, ctrlKey, altKey, shiftKey, metaKey);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> EventInterface WheelEvent::eventInterface() const
</span></span></pre></div>
<a id="trunkSourceWebCoredomWheelEventh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/WheelEvent.h (164550 => 164551)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx">
</span><span class="cx"> #include "FloatPoint.h"
</span><span class="cx"> #include "MouseEvent.h"
</span><ins>+#include "PlatformWheelEvent.h"
</ins><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="lines">@@ -63,13 +64,9 @@
</span><span class="cx"> return adoptRef(new WheelEvent(type, initializer));
</span><span class="cx"> }
</span><span class="cx">
</span><del>- 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)
</del><ins>+ static PassRefPtr<WheelEvent> create(const PlatformWheelEvent& event, PassRefPtr<AbstractView> view)
</ins><span class="cx"> {
</span><del>- return adoptRef(new WheelEvent(wheelTicks, rawDelta, deltaMode, view,
- screenLocation, pageLocation, ctrlKey, altKey, shiftKey, metaKey, directionInvertedFromDevice, timestamp));
</del><ins>+ return adoptRef(new WheelEvent(event, view));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void initWheelEvent(int rawDeltaX, int rawDeltaY, PassRefPtr<AbstractView>,
</span><span class="lines">@@ -95,12 +92,15 @@
</span><span class="cx"> virtual EventInterface eventInterface() const override;
</span><span class="cx"> virtual bool isMouseEvent() const override;
</span><span class="cx">
</span><ins>+#if PLATFORM(MAC)
+ PlatformWheelEventPhase phase() const { return m_phase; }
+ PlatformWheelEventPhase momentumPhase() const { return m_momentumPhase; }
+#endif
+
</ins><span class="cx"> private:
</span><span class="cx"> WheelEvent();
</span><span class="cx"> WheelEvent(const AtomicString&, const WheelEventInit&);
</span><del>- 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);
</del><ins>+ WheelEvent(const PlatformWheelEvent&, PassRefPtr<AbstractView>);
</ins><span class="cx">
</span><span class="cx"> virtual bool isWheelEvent() const override;
</span><span class="cx">
</span><span class="lines">@@ -110,6 +110,11 @@
</span><span class="cx"> double m_deltaZ;
</span><span class="cx"> unsigned m_deltaMode;
</span><span class="cx"> bool m_directionInvertedFromDevice;
</span><ins>+
+#if PLATFORM(MAC)
+ PlatformWheelEventPhase m_phase;
+ PlatformWheelEventPhase m_momentumPhase;
+#endif
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> EVENT_TYPE_CASTS(WheelEvent)
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (164550 => 164551)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2014-02-21 Sam Weinig <sam@webkit.org>
+
+ 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.
+
</ins><span class="cx"> 2014-02-22 David Kilzer <ddkilzer@apple.com>
</span><span class="cx">
</span><span class="cx"> Revert r164434 since it actually broke ASan builds
</span></span></pre></div>
<a id="trunkSourceWebKitmacDOMWebDOMOperationsmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/DOM/WebDOMOperations.mm (164550 => 164551)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> #import "DOMElementInternal.h"
</span><span class="cx"> #import "DOMNodeInternal.h"
</span><span class="cx"> #import "DOMRangeInternal.h"
</span><ins>+#import "DOMWheelEventInternal.h"
</ins><span class="cx"> #import "WebArchiveInternal.h"
</span><span class="cx"> #import "WebDataSourcePrivate.h"
</span><span class="cx"> #import "WebFrameInternal.h"
</span><span class="lines">@@ -46,14 +47,16 @@
</span><span class="cx"> #import <WebCore/HTMLParserIdioms.h>
</span><span class="cx"> #import <WebCore/JSElement.h>
</span><span class="cx"> #import <WebCore/LegacyWebArchive.h>
</span><del>-#import <WebCore/markup.h>
</del><ins>+#import <WebCore/PlatformWheelEvent.h>
</ins><span class="cx"> #import <WebCore/RenderElement.h>
</span><span class="cx"> #import <WebCore/RenderTreeAsText.h>
</span><span class="cx"> #import <WebCore/ShadowRoot.h>
</span><ins>+#import <WebCore/WheelEvent.h>
+#import <WebCore/markup.h>
</ins><span class="cx"> #import <WebKit/DOMExtensions.h>
</span><span class="cx"> #import <WebKit/DOMHTML.h>
</span><ins>+#import <runtime/JSCJSValue.h>
</ins><span class="cx"> #import <runtime/JSLock.h>
</span><del>-#import <runtime/JSCJSValue.h>
</del><span class="cx"> #import <wtf/Assertions.h>
</span><span class="cx">
</span><span class="cx"> using namespace WebCore;
</span><span class="lines">@@ -224,3 +227,40 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> @end
</span><ins>+
+#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
</ins></span></pre></div>
<a id="trunkSourceWebKitmacDOMWebDOMOperationsPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/DOM/WebDOMOperationsPrivate.h (164550 => 164551)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -31,6 +31,9 @@
</span><span class="cx">
</span><span class="cx"> #if TARGET_OS_IPHONE
</span><span class="cx"> #import <Foundation/NSGeometry.h>
</span><ins>+#else
+#import <AppKit/NSEvent.h>
+#import <WebKit/DOMWheelEvent.h>
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> @interface DOMElement (WebDOMElementOperationsPrivate)
</span><span class="lines">@@ -56,3 +59,10 @@
</span><span class="cx"> - (void)showPlaceholderIfNecessary;
</span><span class="cx"> #endif
</span><span class="cx"> @end
</span><ins>+
+#if !TARGET_OS_IPHONE
+@interface DOMWheelEvent (WebDOMWheelEventOperationsPrivate)
+- (NSEventPhase)_phase;
+- (NSEventPhase)_momentumPhase;
+@end
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKitmacMigrateHeadersmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/MigrateHeaders.make (164550 => 164551)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -177,6 +177,7 @@
</span><span class="cx"> $(PUBLIC_HEADERS_DIR)/DOMUIEvent.h \
</span><span class="cx"> $(PUBLIC_HEADERS_DIR)/DOMViews.h \
</span><span class="cx"> $(PUBLIC_HEADERS_DIR)/DOMWheelEvent.h \
</span><ins>+ $(INTERNAL_HEADERS_DIR)/DOMWheelEventInternal.h \
</ins><span class="cx"> $(PUBLIC_HEADERS_DIR)/DOMXPath.h \
</span><span class="cx"> $(PUBLIC_HEADERS_DIR)/DOMXPathException.h \
</span><span class="cx"> $(PUBLIC_HEADERS_DIR)/DOMXPathExpression.h \
</span></span></pre>
</div>
</div>
</body>
</html>