Diff
Modified: trunk/Source/WebKit/chromium/ChangeLog (94660 => 94661)
--- trunk/Source/WebKit/chromium/ChangeLog 2011-09-07 10:28:47 UTC (rev 94660)
+++ trunk/Source/WebKit/chromium/ChangeLog 2011-09-07 10:36:57 UTC (rev 94661)
@@ -1,3 +1,23 @@
+2011-09-07 Sheriff Bot <[email protected]>
+
+ 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 <[email protected]>
[Chromium] Web Inspector: repair console sniffing for interactive ui tests
Modified: trunk/Source/WebKit/chromium/public/WebInputEvent.h (94660 => 94661)
--- trunk/Source/WebKit/chromium/public/WebInputEvent.h 2011-09-07 10:28:47 UTC (rev 94660)
+++ trunk/Source/WebKit/chromium/public/WebInputEvent.h 2011-09-07 10:36:57 UTC (rev 94661)
@@ -344,25 +344,14 @@
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];
+ int touchPointsLength;
+ WebTouchPoint touchPoints[touchPointsLengthCap];
- 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];
-
WebTouchEvent(unsigned sizeParam = sizeof(WebTouchEvent))
: WebInputEvent(sizeParam)
- , touchesLength(0)
- , changedTouchesLength(0)
- , targetTouchesLength(0)
+ , touchPointsLength(0)
{
}
};
Modified: trunk/Source/WebKit/chromium/public/WebTouchPoint.h (94660 => 94661)
--- trunk/Source/WebKit/chromium/public/WebTouchPoint.h 2011-09-07 10:28:47 UTC (rev 94660)
+++ trunk/Source/WebKit/chromium/public/WebTouchPoint.h 2011-09-07 10:36:57 UTC (rev 94661)
@@ -38,8 +38,14 @@
class WebTouchPoint {
public:
+ enum Finger {
+ FingerFirst,
+ FingerSecond,
+ FingerThird
+ };
+
WebTouchPoint()
- : id(0)
+ : id(FingerFirst)
, state(StateUndefined)
, radiusX(0)
, radiusY(0)
Modified: trunk/Source/WebKit/chromium/src/WebInputEventConversion.cpp (94660 => 94661)
--- trunk/Source/WebKit/chromium/src/WebInputEventConversion.cpp 2011-09-07 10:28:47 UTC (rev 94660)
+++ trunk/Source/WebKit/chromium/src/WebInputEventConversion.cpp 2011-09-07 10:36:57 UTC (rev 94661)
@@ -39,9 +39,6 @@
#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"
@@ -50,8 +47,6 @@
namespace WebKit {
-static const double millisPerSecond = 1000.0;
-
// MakePlatformMouseEvent -----------------------------------------------------
PlatformMouseEventBuilder::PlatformMouseEventBuilder(Widget* widget, const WebMouseEvent& e)
@@ -266,8 +261,8 @@
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
@@ -301,7 +296,7 @@
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;
@@ -344,7 +339,7 @@
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(
@@ -374,7 +369,7 @@
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
@@ -382,59 +377,12 @@
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
Modified: trunk/Source/WebKit/chromium/src/WebInputEventConversion.h (94660 => 94661)
--- trunk/Source/WebKit/chromium/src/WebInputEventConversion.h 2011-09-07 10:28:47 UTC (rev 94660)
+++ trunk/Source/WebKit/chromium/src/WebInputEventConversion.h 2011-09-07 10:36:57 UTC (rev 94661)
@@ -43,7 +43,6 @@
class MouseEvent;
class ScrollView;
class WheelEvent;
-class TouchEvent;
class Widget;
}
@@ -52,7 +51,6 @@
class WebMouseEvent;
class WebMouseWheelEvent;
class WebKeyboardEvent;
-class WebTouchEvent;
class WebGestureEvent;
// These classes are used to convert from WebInputEvent subclasses to
@@ -83,13 +81,11 @@
};
#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&);
@@ -121,16 +117,6 @@
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
Modified: trunk/Tools/ChangeLog (94660 => 94661)
--- trunk/Tools/ChangeLog 2011-09-07 10:28:47 UTC (rev 94660)
+++ trunk/Tools/ChangeLog 2011-09-07 10:36:57 UTC (rev 94661)
@@ -1,5 +1,17 @@
2011-09-07 Sheriff Bot <[email protected]>
+ 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).
+
+ * DumpRenderTree/chromium/EventSender.cpp:
+ (EventSender::sendCurrentTouchEvent):
+
+2011-09-07 Sheriff Bot <[email protected]>
+
Unreviewed, rolling out r94655.
http://trac.webkit.org/changeset/94655
https://bugs.webkit.org/show_bug.cgi?id=67703
Modified: trunk/Tools/DumpRenderTree/chromium/EventSender.cpp (94660 => 94661)
--- trunk/Tools/DumpRenderTree/chromium/EventSender.cpp 2011-09-07 10:28:47 UTC (rev 94660)
+++ trunk/Tools/DumpRenderTree/chromium/EventSender.cpp 2011-09-07 10:36:57 UTC (rev 94661)
@@ -948,16 +948,16 @@
void EventSender::sendCurrentTouchEvent(const WebInputEvent::Type type)
{
- ASSERT(static_cast<unsigned>(WebTouchEvent::touchesLengthCap) > touchPoints.size());
+ ASSERT(static_cast<unsigned>(WebTouchEvent::touchPointsLengthCap) > touchPoints.size());
webview()->layout();
WebTouchEvent touchEvent;
touchEvent.type = type;
touchEvent.modifiers = touchModifiers;
touchEvent.timeStampSeconds = getCurrentEventTimeSec();
- touchEvent.touchesLength = touchPoints.size();
+ touchEvent.touchPointsLength = touchPoints.size();
for (unsigned i = 0; i < touchPoints.size(); ++i)
- touchEvent.touches[i] = touchPoints[i];
+ touchEvent.touchPoints[i] = touchPoints[i];
webview()->handleInputEvent(touchEvent);
for (unsigned i = 0; i < touchPoints.size(); ++i) {