+2011-09-07 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r94635.
+ http://trac.webkit.org/changeset/94635
+ https://bugs.webkit.org/show_bug.cgi?id=67704
+
+ Linux Touch build is failing to compile this change.
+ (Requested by loislo on #webkit).
+
+ * public/WebInputEvent.h:
+ (WebKit::WebTouchEvent::WebTouchEvent):
+ * public/WebTouchPoint.h:
+ (WebKit::WebTouchPoint::WebTouchPoint):
+ * src/WebInputEventConversion.cpp:
+ (WebKit::PlatformTouchEventBuilder::PlatformTouchEventBuilder):
+ (WebKit::WebMouseEventBuilder::WebMouseEventBuilder):
+ (WebKit::WebMouseWheelEventBuilder::WebMouseWheelEventBuilder):
+ (WebKit::WebKeyboardEventBuilder::WebKeyboardEventBuilder):
+ * src/WebInputEventConversion.h:
+
2011-09-05 Yury Semikhatsky <yurys@chromium.org>
[Chromium] Web Inspector: repair console sniffing for interactive ui tests
class WebTouchEvent : public WebInputEvent {
public:
- enum { touchesLengthCap = 8 };
+ static const int touchPointsLengthCap = 4;
- unsigned touchesLength;
- // List of all touches which are currently down.
- WebTouchPoint touches[touchesLengthCap];
-
- unsigned changedTouchesLength;
- // List of all touches whose state has changed since the last WebTouchEvent
- WebTouchPoint changedTouches[touchesLengthCap];
-
- unsigned targetTouchesLength;
- // List of all touches which are currently down and are targeting the event recipient.
- WebTouchPoint targetTouches[touchesLengthCap];
+ int touchPointsLength;
+ WebTouchPoint touchPoints[touchPointsLengthCap];
WebTouchEvent(unsigned sizeParam = sizeof(WebTouchEvent))
: WebInputEvent(sizeParam)
- , touchesLength(0)
- , changedTouchesLength(0)
- , targetTouchesLength(0)
+ , touchPointsLength(0)
{
}
};
#include "PlatformMouseEvent.h"
#include "PlatformWheelEvent.h"
#include "ScrollView.h"
-#include "Touch.h"
-#include "TouchEvent.h"
-#include "TouchList.h"
#include "WebInputEvent.h"
#include "WheelEvent.h"
#include "Widget.h"
namespace WebKit {
-static const double millisPerSecond = 1000.0;
-
// MakePlatformMouseEvent -----------------------------------------------------
PlatformMouseEventBuilder::PlatformMouseEventBuilder(Widget* widget, const WebMouseEvent& e)
m_metaKey = event.modifiers & WebInputEvent::MetaKey;
m_timestamp = event.timeStampSeconds;
- for (unsigned i = 0; i < event.touchesLength; ++i)
- m_touchPoints.append(PlatformTouchPointBuilder(widget, event.touches[i]));
+ for (int i = 0; i < event.touchPointsLength; ++i)
+ m_touchPoints.append(PlatformTouchPointBuilder(widget, event.touchPoints[i]));
}
#endif
type = WebInputEvent::ContextMenu;
else
return; // Skip all other mouse events.
- timeStampSeconds = event.timeStamp() / millisPerSecond;
+ timeStampSeconds = event.timeStamp() * 1.0e-3;
switch (event.button()) {
case LeftButton:
button = WebMouseEvent::ButtonLeft;
if (event.type() != eventNames().mousewheelEvent)
return;
type = WebInputEvent::MouseWheel;
- timeStampSeconds = event.timeStamp() / millisPerSecond;
+ timeStampSeconds = event.timeStamp() * 1.0e-3;
modifiers = getWebInputModifiers(event);
ScrollView* view = widget->parent();
IntPoint p = view->contentsToWindow(
else
return; // Skip all other keyboard events.
modifiers = getWebInputModifiers(event);
- timeStampSeconds = event.timeStamp() / millisPerSecond;
+ timeStampSeconds = event.timeStamp() * 1.0e-3;
windowsKeyCode = event.keyCode();
// The platform keyevent does not exist if the event was created using
if (!event.keyEvent())
return;
nativeKeyCode = event.keyEvent()->nativeVirtualKeyCode();
- unsigned numberOfCharacters = std::min(event.keyEvent()->text().length(), static_cast<unsigned>(textLengthCap));
- for (unsigned i = 0; i < numberOfCharacters; ++i) {
+ unsigned int numChars = std::min(event.keyEvent()->text().length(),
+ static_cast<unsigned int>(WebKeyboardEvent::textLengthCap));
+ for (unsigned int i = 0; i < numChars; i++) {
text[i] = event.keyEvent()->text()[i];
unmodifiedText[i] = event.keyEvent()->unmodifiedText()[i];
}
}
-#if ENABLE(TOUCH_EVENTS)
-
-static void addTouchPoints(TouchList* touches, const IntPoint& offset, WebTouchPoint* touchPoints, unsigned* touchPointsLength)
-{
- unsigned numberOfTouches = std::min(touches->length(), static_cast<unsigned>(WebTouchEvent::touchesLengthCap));
- for (unsigned i = 0; i < numberOfTouches; ++i) {
- const Touch* touch = touches->item(i);
-
- WebTouchPoint point;
- point.id = touch->identifier();
- point.screenPosition = WebPoint(touch->screenX(), touch->screenY());
- point.position = WebPoint(touch->pageX() - offset.x(), touch->pageY() - offset.y());
- point.radiusX = touch->webkitRadiusX();
- point.radiusY = touch->webkitRadiusY();
- point.rotationAngle = touch->webkitRotationAngle();
- point.force = touch->webkitForce();
-
- touchPoints[i] = point;
- }
- *touchPointsLength = numberOfTouches;
-}
-
-WebTouchEventBuilder::WebTouchEventBuilder(const Widget* widget, const TouchEvent& event)
-{
- if (event.type() == eventNames().touchstartEvent)
- type = TouchStart;
- else if (event.type() == eventNames().touchmoveEvent)
- type = TouchMove;
- else if (event.type() == eventNames().touchendEvent)
- type = TouchEnd;
- else if (event.type() == eventNames().touchcancelEvent)
- type = TouchCancel;
- else {
- ASSERT_NOT_REACHED();
- type = Undefined;
- return;
- }
-
- modifiers = getWebInputModifiers(event);
- timeStampSeconds = event.timeStamp() / millisPerSecond;
-
- addTouchPoints(event.touches(), widget->location(), touches, &touchesLength);
- addTouchPoints(event.changedTouches(), widget->location(), changedTouches, &changedTouchesLength);
- addTouchPoints(event.targetTouches(), widget->location(), targetTouches, &targetTouchesLength);
-}
-
-#endif // ENABLE(TOUCH_EVENTS)
-
} // namespace WebKit
class MouseEvent;
class ScrollView;
class WheelEvent;
-class TouchEvent;
class Widget;
}
class WebMouseEvent;
class WebMouseWheelEvent;
class WebKeyboardEvent;
-class WebTouchEvent;
class WebGestureEvent;
// These classes are used to convert from WebInputEvent subclasses to
};
#if ENABLE(TOUCH_EVENTS)
-// Converts a WebTouchPoint to a WebCore::PlatformTouchPoint.
class PlatformTouchPointBuilder : public WebCore::PlatformTouchPoint {
public:
PlatformTouchPointBuilder(WebCore::Widget*, const WebTouchPoint&);
};
-// Converts a WebTouchEvent to a WebCore::PlatformTouchEvent.
class PlatformTouchEventBuilder : public WebCore::PlatformTouchEvent {
public:
PlatformTouchEventBuilder(WebCore::Widget*, const WebTouchEvent&);
WebKeyboardEventBuilder(const WebCore::KeyboardEvent&);
};
-#if ENABLE(TOUCH_EVENTS)
-// Converts a WebCore::TouchEvent to a corresponding WebTouchEvent.
-// NOTE: WebTouchEvents have a cap on the number of WebTouchPoints. Any points
-// exceeding that cap will be dropped.
-class WebTouchEventBuilder : public WebTouchEvent {
-public:
- WebTouchEventBuilder(const WebCore::Widget*, const WebCore::TouchEvent&);
-};
-#endif // ENABLE(TOUCH_EVENTS)
-
} // namespace WebKit
#endif