Commit 7e6de6b9 authored by weinig@apple.com's avatar weinig@apple.com
Browse files

2011-01-25 Sam Weinig <sam@webkit.org>

        Reviewed by Anders Carlsson.

        Add hasPreciseScrollingDeltas bit to PlatformWheelEvent on the Mac.
        https://bugs.webkit.org/show_bug.cgi?id=53107

        * platform/PlatformWheelEvent.h:
        (WebCore::PlatformWheelEvent::PlatformWheelEvent):
        (WebCore::PlatformWheelEvent::hasPreciseScrollingDeltas):
        * platform/mac/WheelEventMac.mm:
        (WebCore::PlatformWheelEvent::PlatformWheelEvent):
2011-01-25  Sam Weinig  <sam@webkit.org>

        Reviewed by Anders Carlsson.

        Add hasPreciseScrollingDeltas bit to PlatformWheelEvent on the Mac.
        https://bugs.webkit.org/show_bug.cgi?id=53107

        * Shared/WebEvent.h:
        (WebKit::WebWheelEvent::hasPreciseScrollingDeltas):
        * Shared/WebEventConversion.cpp:
        (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent):
        * Shared/WebWheelEvent.cpp:
        (WebKit::WebWheelEvent::WebWheelEvent):
        * Shared/mac/WebEventFactory.mm:
        (WebKit::WebEventFactory::createWebWheelEvent):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76622 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 1a9f042d
2011-01-25 Sam Weinig <sam@webkit.org>
Reviewed by Anders Carlsson.
Add hasPreciseScrollingDeltas bit to PlatformWheelEvent on the Mac.
https://bugs.webkit.org/show_bug.cgi?id=53107
* platform/PlatformWheelEvent.h:
(WebCore::PlatformWheelEvent::PlatformWheelEvent):
(WebCore::PlatformWheelEvent::hasPreciseScrollingDeltas):
* platform/mac/WheelEventMac.mm:
(WebCore::PlatformWheelEvent::PlatformWheelEvent):
2011-01-20 Jer Noble <jer.noble@apple.com>
 
Reviewed by Eric Carlson.
......@@ -98,6 +98,7 @@ namespace WebCore {
, m_altKey(false)
, m_metaKey(false)
#if PLATFORM(MAC)
, m_hasPreciseScrollingDeltas(false)
, m_phase(PlatformWheelEventPhaseNone)
#endif
{
......@@ -151,6 +152,7 @@ namespace WebCore {
#endif
PlatformWheelEventPhase phase() const { return m_phase; }
bool hasPreciseScrollingDeltas() const { return m_hasPreciseScrollingDeltas; }
#endif
#if PLATFORM(QT)
......@@ -186,6 +188,7 @@ namespace WebCore {
bool m_altKey;
bool m_metaKey;
#if PLATFORM(MAC)
bool m_hasPreciseScrollingDeltas;
PlatformWheelEventPhase m_phase;
#endif
};
......
......@@ -71,11 +71,13 @@ PlatformWheelEvent::PlatformWheelEvent(NSEvent* event, NSView *windowView)
if (continuous) {
m_wheelTicksX = m_deltaX / static_cast<float>(Scrollbar::pixelsPerLineStep());
m_wheelTicksY = m_deltaY / static_cast<float>(Scrollbar::pixelsPerLineStep());
m_hasPreciseScrollingDeltas = true;
} else {
m_wheelTicksX = m_deltaX;
m_wheelTicksY = m_deltaY;
m_deltaX *= static_cast<float>(Scrollbar::pixelsPerLineStep());
m_deltaY *= static_cast<float>(Scrollbar::pixelsPerLineStep());
m_hasPreciseScrollingDeltas = false;
}
}
......
2011-01-25 Sam Weinig <sam@webkit.org>
Reviewed by Anders Carlsson.
Add hasPreciseScrollingDeltas bit to PlatformWheelEvent on the Mac.
https://bugs.webkit.org/show_bug.cgi?id=53107
* Shared/WebEvent.h:
(WebKit::WebWheelEvent::hasPreciseScrollingDeltas):
* Shared/WebEventConversion.cpp:
(WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent):
* Shared/WebWheelEvent.cpp:
(WebKit::WebWheelEvent::WebWheelEvent):
* Shared/mac/WebEventFactory.mm:
(WebKit::WebEventFactory::createWebWheelEvent):
2011-01-25 Anders Carlsson <andersca@apple.com>
 
Reviewed by Sam Weinig.
......@@ -166,7 +166,7 @@ public:
WebWheelEvent(Type, const WebCore::IntPoint& position, const WebCore::IntPoint& globalPosition, const WebCore::FloatSize& delta, const WebCore::FloatSize& wheelTicks, Granularity, Modifiers, double timestamp);
#if PLATFORM(MAC)
WebWheelEvent(Type, const WebCore::IntPoint& position, const WebCore::IntPoint& globalPosition, const WebCore::FloatSize& delta, const WebCore::FloatSize& wheelTicks, Granularity, Phase, Modifiers, double timestamp);
WebWheelEvent(Type, const WebCore::IntPoint& position, const WebCore::IntPoint& globalPosition, const WebCore::FloatSize& delta, const WebCore::FloatSize& wheelTicks, Granularity, Phase, bool hasPreciseScrollingDeltas, Modifiers, double timestamp);
#endif
const WebCore::IntPoint position() const { return m_position; }
......@@ -176,6 +176,7 @@ public:
Granularity granularity() const { return static_cast<Granularity>(m_granularity); }
#if PLATFORM(MAC)
Phase phase() const { return static_cast<Phase>(m_phase); }
bool hasPreciseScrollingDeltas() const { return m_hasPreciseScrollingDeltas; }
#endif
void encode(CoreIPC::ArgumentEncoder*) const;
......@@ -191,6 +192,7 @@ private:
uint32_t m_granularity; // Granularity
#if PLATFORM(MAC)
uint32_t m_phase; // Phase
bool m_hasPreciseScrollingDeltas;
#endif
};
......
......@@ -112,6 +112,7 @@ public:
m_metaKey = webEvent.metaKey();
#if PLATFORM(MAC)
m_phase = static_cast<WebCore::PlatformWheelEventPhase>(webEvent.phase());
m_hasPreciseScrollingDeltas = webEvent.hasPreciseScrollingDeltas();
#endif
}
};
......
......@@ -44,7 +44,7 @@ WebWheelEvent::WebWheelEvent(Type type, const IntPoint& position, const IntPoint
}
#if PLATFORM(MAC)
WebWheelEvent::WebWheelEvent(Type type, const IntPoint& position, const IntPoint& globalPosition, const FloatSize& delta, const FloatSize& wheelTicks, Granularity granularity, Phase phase, Modifiers modifiers, double timestamp)
WebWheelEvent::WebWheelEvent(Type type, const IntPoint& position, const IntPoint& globalPosition, const FloatSize& delta, const FloatSize& wheelTicks, Granularity granularity, Phase phase, bool hasPreciseScrollingDeltas, Modifiers modifiers, double timestamp)
: WebEvent(type, modifiers, timestamp)
, m_position(position)
, m_globalPosition(globalPosition)
......@@ -52,6 +52,7 @@ WebWheelEvent::WebWheelEvent(Type type, const IntPoint& position, const IntPoint
, m_wheelTicks(wheelTicks)
, m_granularity(granularity)
, m_phase(phase)
, m_hasPreciseScrollingDeltas(hasPreciseScrollingDeltas)
{
ASSERT(isWheelEventType(type));
}
......
......@@ -1020,10 +1020,11 @@ WebWheelEvent WebEventFactory::createWebWheelEvent(NSEvent *event, NSView *windo
}
WebWheelEvent::Phase phase = phaseForEvent(event);
bool hasPreciseScrollingDeltas = continuous;
WebEvent::Modifiers modifiers = modifiersForEvent(event);
double timestamp = [event timestamp];
return WebWheelEvent(WebEvent::Wheel, IntPoint(position), IntPoint(globalPosition), FloatSize(deltaX, deltaY), FloatSize(wheelTicksX, wheelTicksY), granularity, phase, modifiers, timestamp);
return WebWheelEvent(WebEvent::Wheel, IntPoint(position), IntPoint(globalPosition), FloatSize(deltaX, deltaY), FloatSize(wheelTicksX, wheelTicksY), granularity, phase, hasPreciseScrollingDeltas, modifiers, timestamp);
}
WebKeyboardEvent WebEventFactory::createWebKeyboardEvent(NSEvent *event, NSView *)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment