Changeset 127689 in webkit
- Timestamp:
- Sep 5, 2012 9:46:39 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/chromium/ChangeLog
r127678 r127689 1 2012-09-05 Rick Byers <rbyers@chromium.org> 2 3 Use new type-specific WebGestureEvent fields 4 https://bugs.webkit.org/show_bug.cgi?id=95573 5 6 Reviewed by James Robinson. 7 8 Chromium has been updated to store gesture-type specific details in the 9 new WebGestureEvent fields (crrev.com/152508, crrev.com/154815 and 10 crrev.com/154959), so we can now rely on them. 11 12 * src/WebCompositorInputHandlerImpl.cpp: 13 Update the compositor scroll, pinch and fling handling to use these new fields. 14 (WebKit::WebCompositorInputHandlerImpl::handleInputEventInternal): 15 (WebKit::WebCompositorInputHandlerImpl::handleGestureFling): 16 * src/WebInputEventConversion.cpp: 17 Update PlatformGestureEvent/WebGestureEvent conversion to use the new 18 fields, storing into the existing overloaded PlatformGestureEvent 19 fields (which will be cleaned up in my next CL). 20 (WebKit::PlatformGestureEventBuilder::PlatformGestureEventBuilder): 21 (WebKit::WebGestureEventBuilder::WebGestureEventBuilder): 22 * src/WebViewImpl.cpp: 23 (WebKit::WebViewImpl::handleGestureEvent): 24 Update fling scrolling implementation for correct location of velocity. 25 * tests/WebCompositorInputHandlerImplTest.cpp: 26 (WebKit::TEST_F): 27 Update tests to use the new fields. 28 29 1 30 2012-09-05 James Robinson <jamesr@chromium.org> 2 31 -
trunk/Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.cpp
r126018 r127689 217 217 218 218 const WebGestureEvent& gestureEvent = *static_cast<const WebGestureEvent*>(&event); 219 m_inputHandlerClient->scrollBy(IntPoint(gestureEvent.x, gestureEvent.y), IntSize(-gestureEvent.deltaX, -gestureEvent.deltaY)); 219 m_inputHandlerClient->scrollBy(IntPoint(gestureEvent.x, gestureEvent.y), 220 IntSize(-gestureEvent.data.scrollUpdate.deltaX, -gestureEvent.data.scrollUpdate.deltaY)); 220 221 return DidHandle; 221 222 } else if (event.type == WebInputEvent::GestureScrollEnd) { … … 247 248 ASSERT(m_expectPinchUpdateEnd); 248 249 const WebGestureEvent& gestureEvent = *static_cast<const WebGestureEvent*>(&event); 249 m_inputHandlerClient->pinchGestureUpdate(gestureEvent.d eltaX, IntPoint(gestureEvent.x, gestureEvent.y));250 m_inputHandlerClient->pinchGestureUpdate(gestureEvent.data.pinchUpdate.scale, IntPoint(gestureEvent.x, gestureEvent.y)); 250 251 return DidHandle; 251 252 } else if (event.type == WebInputEvent::GestureFlingStart) { … … 268 269 case CCInputHandlerClient::ScrollStarted: { 269 270 TRACE_EVENT_INSTANT0("cc", "WebCompositorInputHandlerImpl::handleGestureFling::started"); 270 OwnPtr<PlatformGestureCurve> flingCurve = TouchpadFlingPlatformGestureCurve::create(FloatPoint(gestureEvent.d eltaX, gestureEvent.deltaY));271 OwnPtr<PlatformGestureCurve> flingCurve = TouchpadFlingPlatformGestureCurve::create(FloatPoint(gestureEvent.data.flingStart.velocityX, gestureEvent.data.flingStart.velocityY)); 271 272 m_wheelFlingAnimation = CCActiveGestureAnimation::create(PlatformGestureToCCGestureAdapter::create(flingCurve.release()), this); 272 m_wheelFlingParameters.delta = WebFloatPoint(gestureEvent.d eltaX, gestureEvent.deltaY);273 m_wheelFlingParameters.delta = WebFloatPoint(gestureEvent.data.flingStart.velocityX, gestureEvent.data.flingStart.velocityY); 273 274 m_wheelFlingParameters.point = WebPoint(gestureEvent.x, gestureEvent.y); 274 275 m_wheelFlingParameters.globalPoint = WebPoint(gestureEvent.globalX, gestureEvent.globalY); -
trunk/Source/WebKit/chromium/src/WebInputEventConversion.cpp
r124954 r127689 150 150 case WebInputEvent::GestureScrollUpdate: 151 151 m_type = PlatformEvent::GestureScrollUpdate; 152 m_deltaX = e.data.scrollUpdate.deltaX; 153 m_deltaY = e.data.scrollUpdate.deltaY; 152 154 break; 153 155 case WebInputEvent::GestureTap: 154 156 m_type = PlatformEvent::GestureTap; 155 m_area = IntSize(e.boundingBox.width, e.boundingBox.height); 157 m_area = IntSize(e.data.tap.width, e.data.tap.height); 158 // FIXME: PlatformGestureEvent deltaX is overloaded - wkb.ug/93123 159 m_deltaX = static_cast<int>(e.data.tap.tapCount); 156 160 break; 157 161 case WebInputEvent::GestureTapDown: … … 166 170 case WebInputEvent::GestureLongPress: 167 171 m_type = PlatformEvent::GestureLongPress; 168 m_area = IntSize(e. boundingBox.width, e.boundingBox.height);172 m_area = IntSize(e.data.longPress.width, e.data.longPress.height); 169 173 break; 170 174 case WebInputEvent::GesturePinchBegin: … … 176 180 case WebInputEvent::GesturePinchUpdate: 177 181 m_type = PlatformEvent::GesturePinchUpdate; 182 // FIXME: PlatformGestureEvent deltaX is overloaded - wkb.ug/93123 183 m_deltaX = e.data.pinchUpdate.scale; 178 184 break; 179 185 default: … … 182 188 m_position = widget->convertFromContainingWindow(IntPoint(e.x, e.y)); 183 189 m_globalPosition = IntPoint(e.globalX, e.globalY); 184 m_deltaX = e.deltaX;185 m_deltaY = e.deltaY;186 190 m_timestamp = e.timeStampSeconds; 187 191 … … 527 531 else if (event.type() == eventNames().gesturescrollendEvent) 528 532 type = GestureScrollEnd; 529 else if (event.type() == eventNames().gesturescrollupdateEvent) 533 else if (event.type() == eventNames().gesturescrollupdateEvent) { 530 534 type = GestureScrollUpdate; 535 data.scrollUpdate.deltaX = event.deltaX(); 536 data.scrollUpdate.deltaY = event.deltaY(); 537 } 531 538 532 539 timeStampSeconds = event.timeStamp() / millisPerSecond; … … 537 544 x = event.absoluteLocation().x() - widget->location().x(); 538 545 y = event.absoluteLocation().y() - widget->location().y(); 539 540 deltaX = event.deltaX();541 deltaY = event.deltaY();542 546 } 543 547 #endif // ENABLE(GESTURE_EVENTS) -
trunk/Source/WebKit/chromium/src/WebViewImpl.cpp
r127672 r127689 694 694 m_flingModifier = event.modifiers; 695 695 // FIXME: Make the curve parametrizable from the browser. 696 m_gestureAnimation = ActivePlatformGestureAnimation::create(TouchpadFlingPlatformGestureCurve::create(FloatPoint(event.d eltaX, event.deltaY)), this);696 m_gestureAnimation = ActivePlatformGestureAnimation::create(TouchpadFlingPlatformGestureCurve::create(FloatPoint(event.data.flingStart.velocityX, event.data.flingStart.velocityY)), this); 697 697 scheduleAnimation(); 698 698 return true; -
trunk/Source/WebKit/chromium/tests/WebCompositorInputHandlerImplTest.cpp
r126018 r127689 201 201 202 202 gesture.type = WebInputEvent::GestureScrollUpdate; 203 gesture.d eltaY = -40; // -Y means scroll down - i.e. in the +Y direction.203 gesture.data.scrollUpdate.deltaY = -40; // -Y means scroll down - i.e. in the +Y direction. 204 204 EXPECT_CALL(m_mockCCInputHandlerClient, scrollBy(testing::_, testing::Property(&WebCore::IntSize::height, testing::Gt(0)))); 205 205 m_inputHandler->handleInputEvent(gesture); … … 208 208 209 209 gesture.type = WebInputEvent::GestureScrollEnd; 210 gesture.d eltaY = 0;210 gesture.data.scrollUpdate.deltaY = 0; 211 211 EXPECT_CALL(m_mockCCInputHandlerClient, scrollEnd()); 212 212 m_inputHandler->handleInputEvent(gesture); … … 228 228 229 229 gesture.type = WebInputEvent::GestureScrollUpdate; 230 gesture.d eltaY = 40;230 gesture.data.scrollUpdate.deltaY = 40; 231 231 m_inputHandler->handleInputEvent(gesture); 232 232 … … 234 234 235 235 gesture.type = WebInputEvent::GestureScrollEnd; 236 gesture.d eltaY = 0;236 gesture.data.scrollUpdate.deltaY = 0; 237 237 m_inputHandler->handleInputEvent(gesture); 238 238 } … … 267 267 268 268 gesture.type = WebInputEvent::GesturePinchUpdate; 269 gesture.d eltaX= 1.5;269 gesture.data.pinchUpdate.scale = 1.5; 270 270 gesture.x = 7; 271 271 gesture.y = 13; … … 276 276 277 277 gesture.type = WebInputEvent::GesturePinchUpdate; 278 gesture.d eltaX= 0.5;278 gesture.data.pinchUpdate.scale = 0.5; 279 279 gesture.x = 9; 280 280 gesture.y = 6; … … 299 299 300 300 gesture.type = WebInputEvent::GestureFlingStart; 301 gesture.d eltaX = 10;301 gesture.data.flingStart.velocityX = 10; 302 302 EXPECT_CALL(m_mockCCInputHandlerClient, scheduleAnimation()); 303 303 m_inputHandler->handleInputEvent(gesture); … … 360 360 WebPoint flingGlobalPoint = WebPoint(17, 23); 361 361 int modifiers = 7; 362 gesture.d eltaX = flingDelta.x;363 gesture.d eltaY = flingDelta.y;362 gesture.data.flingStart.velocityX = flingDelta.x; 363 gesture.data.flingStart.velocityY = flingDelta.y; 364 364 gesture.x = flingPoint.x; 365 365 gesture.y = flingPoint.y; … … 444 444 WebPoint flingGlobalPoint = WebPoint(17, 23); 445 445 int modifiers = 1; 446 gesture.d eltaX = flingDelta.x;447 gesture.d eltaY = flingDelta.y;446 gesture.data.flingStart.velocityX = flingDelta.x; 447 gesture.data.flingStart.velocityY = flingDelta.y; 448 448 gesture.x = flingPoint.x; 449 449 gesture.y = flingPoint.y; … … 523 523 flingGlobalPoint = WebPoint(32, 71); 524 524 modifiers = 2; 525 gesture.d eltaX = flingDelta.x;526 gesture.d eltaY = flingDelta.y;525 gesture.data.flingStart.velocityX = flingDelta.x; 526 gesture.data.flingStart.velocityY = flingDelta.y; 527 527 gesture.x = flingPoint.x; 528 528 gesture.y = flingPoint.y; -
trunk/Tools/ChangeLog
r127688 r127689 1 2012-09-05 Rick Byers <rbyers@chromium.org> 2 3 Update chromium DumpRenderTree for new WebGestureEvent fields 4 https://bugs.webkit.org/show_bug.cgi?id=95573 5 6 Reviewed by James Robinson. 7 8 Update EventSender to write gesture details into the appropriate 9 type-specific WebGestureEvent fields. 10 * DumpRenderTree/chromium/TestRunner/EventSender.cpp: 11 (EventSender::gestureEvent): 12 (EventSender::gestureFlingStart): 13 1 14 2012-09-05 Dirk Pranke <dpranke@chromium.org> 2 15 -
trunk/Tools/DumpRenderTree/chromium/TestRunner/EventSender.cpp
r124906 r127689 1154 1154 switch (type) { 1155 1155 case WebInputEvent::GestureScrollUpdate: 1156 event.d eltaX = static_cast<float>(arguments[0].toDouble());1157 event.d eltaY = static_cast<float>(arguments[1].toDouble());1156 event.data.scrollUpdate.deltaX = static_cast<float>(arguments[0].toDouble()); 1157 event.data.scrollUpdate.deltaY = static_cast<float>(arguments[1].toDouble()); 1158 1158 event.x = m_currentGestureLocation.x; 1159 1159 event.y = m_currentGestureLocation.y; 1160 m_currentGestureLocation.x = m_currentGestureLocation.x + event.d eltaX;1161 m_currentGestureLocation.y = m_currentGestureLocation.y + event.d eltaY;1160 m_currentGestureLocation.x = m_currentGestureLocation.x + event.data.scrollUpdate.deltaX; 1161 m_currentGestureLocation.y = m_currentGestureLocation.y + event.data.scrollUpdate.deltaY; 1162 1162 break; 1163 1163 … … 1168 1168 break; 1169 1169 case WebInputEvent::GestureScrollEnd: 1170 event.deltaX = static_cast<float>(arguments[0].toDouble());1171 event.deltaY = static_cast<float>(arguments[1].toDouble());1172 1170 event.x = m_currentGestureLocation.x; 1173 1171 event.y = m_currentGestureLocation.y; 1174 1172 break; 1175 1173 case WebInputEvent::GestureTap: 1176 if (arguments.size() >= 3) {1177 // Tap count.1178 event.deltaX = static_cast<float>(arguments[2].toDouble());1179 }1174 if (arguments.size() >= 3) 1175 event.data.tap.tapCount = static_cast<float>(arguments[2].toDouble()); 1176 else 1177 event.data.tap.tapCount = 1; 1180 1178 event.x = point.x; 1181 1179 event.y = point.y; … … 1233 1231 event.globalY = event.y; 1234 1232 1235 event.d eltaX = static_cast<float>(arguments[2].toDouble());1236 event.d eltaY = static_cast<float>(arguments[3].toDouble());1233 event.data.flingStart.velocityX = static_cast<float>(arguments[2].toDouble()); 1234 event.data.flingStart.velocityY = static_cast<float>(arguments[3].toDouble()); 1237 1235 event.timeStampSeconds = getCurrentEventTimeSec(); 1238 1236 webview()->handleInputEvent(event);
Note: See TracChangeset
for help on using the changeset viewer.