Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(491)

Side by Side Diff: third_party/WebKit/Source/core/input/ScrollManager.cpp

Issue 2539283002: Remove PlatformGestureEvent in favour of using WebGestureEvent (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/input/ScrollManager.h" 5 #include "core/input/ScrollManager.h"
6 6
7 #include "core/dom/DOMNodeIds.h" 7 #include "core/dom/DOMNodeIds.h"
8 #include "core/events/GestureEvent.h" 8 #include "core/events/GestureEvent.h"
9 #include "core/frame/BrowserControls.h" 9 #include "core/frame/BrowserControls.h"
10 #include "core/frame/FrameHost.h" 10 #include "core/frame/FrameHost.h"
11 #include "core/frame/FrameView.h" 11 #include "core/frame/FrameView.h"
12 #include "core/html/HTMLFrameOwnerElement.h" 12 #include "core/html/HTMLFrameOwnerElement.h"
13 #include "core/input/EventHandler.h" 13 #include "core/input/EventHandler.h"
14 #include "core/input/EventHandlingUtil.h" 14 #include "core/input/EventHandlingUtil.h"
15 #include "core/layout/LayoutBlock.h" 15 #include "core/layout/LayoutBlock.h"
16 #include "core/layout/LayoutPart.h" 16 #include "core/layout/LayoutPart.h"
17 #include "core/layout/api/LayoutViewItem.h" 17 #include "core/layout/api/LayoutViewItem.h"
18 #include "core/loader/DocumentLoader.h" 18 #include "core/loader/DocumentLoader.h"
19 #include "core/page/AutoscrollController.h" 19 #include "core/page/AutoscrollController.h"
20 #include "core/page/Page.h" 20 #include "core/page/Page.h"
21 #include "core/page/scrolling/OverscrollController.h" 21 #include "core/page/scrolling/OverscrollController.h"
22 #include "core/page/scrolling/RootScrollerController.h" 22 #include "core/page/scrolling/RootScrollerController.h"
23 #include "core/page/scrolling/ScrollState.h" 23 #include "core/page/scrolling/ScrollState.h"
24 #include "core/paint/PaintLayer.h" 24 #include "core/paint/PaintLayer.h"
25 #include "platform/PlatformGestureEvent.h"
26 #include "wtf/PtrUtil.h" 25 #include "wtf/PtrUtil.h"
27 #include <memory> 26 #include <memory>
28 27
29 namespace blink { 28 namespace blink {
30 29
31 ScrollManager::ScrollManager(LocalFrame& frame) : m_frame(frame) { 30 ScrollManager::ScrollManager(LocalFrame& frame) : m_frame(frame) {
32 clear(); 31 clear();
33 } 32 }
34 33
35 void ScrollManager::clear() { 34 void ScrollManager::clear() {
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 m_frame->document()->updateStyleAndLayoutIgnorePendingStylesheets(); 190 m_frame->document()->updateStyleAndLayoutIgnorePendingStylesheets();
192 191
193 if (m_currentScrollChain.empty()) 192 if (m_currentScrollChain.empty())
194 recomputeScrollChain(startNode, m_currentScrollChain); 193 recomputeScrollChain(startNode, m_currentScrollChain);
195 scrollState.setScrollChain(m_currentScrollChain); 194 scrollState.setScrollChain(m_currentScrollChain);
196 195
197 scrollState.distributeToScrollChainDescendant(); 196 scrollState.distributeToScrollChainDescendant();
198 } 197 }
199 198
200 WebInputEventResult ScrollManager::handleGestureScrollBegin( 199 WebInputEventResult ScrollManager::handleGestureScrollBegin(
201 const PlatformGestureEvent& gestureEvent) { 200 const WebGestureEvent& gestureEvent) {
202 Document* document = m_frame->document(); 201 Document* document = m_frame->document();
203 202
204 if (document->layoutViewItem().isNull()) 203 if (document->layoutViewItem().isNull())
205 return WebInputEventResult::NotHandled; 204 return WebInputEventResult::NotHandled;
206 205
207 // If there's no layoutObject on the node, send the event to the nearest 206 // If there's no layoutObject on the node, send the event to the nearest
208 // ancestor with a layoutObject. Needed for <option> and <optgroup> elements 207 // ancestor with a layoutObject. Needed for <option> and <optgroup> elements
209 // so we can touch scroll <select>s 208 // so we can touch scroll <select>s
210 while (m_scrollGestureHandlingNode && 209 while (m_scrollGestureHandlingNode &&
211 !m_scrollGestureHandlingNode->layoutObject()) 210 !m_scrollGestureHandlingNode->layoutObject())
212 m_scrollGestureHandlingNode = 211 m_scrollGestureHandlingNode =
213 m_scrollGestureHandlingNode->parentOrShadowHostNode(); 212 m_scrollGestureHandlingNode->parentOrShadowHostNode();
214 213
215 if (!m_scrollGestureHandlingNode) 214 if (!m_scrollGestureHandlingNode)
216 m_scrollGestureHandlingNode = m_frame->document()->documentElement(); 215 m_scrollGestureHandlingNode = m_frame->document()->documentElement();
217 216
218 if (!m_scrollGestureHandlingNode || 217 if (!m_scrollGestureHandlingNode ||
219 !m_scrollGestureHandlingNode->layoutObject()) 218 !m_scrollGestureHandlingNode->layoutObject())
220 return WebInputEventResult::NotHandled; 219 return WebInputEventResult::NotHandled;
221 220
222 passScrollGestureEventToWidget(gestureEvent, 221 passScrollGestureEventToWidget(gestureEvent,
223 m_scrollGestureHandlingNode->layoutObject()); 222 m_scrollGestureHandlingNode->layoutObject());
224 223
225 m_currentScrollChain.clear(); 224 m_currentScrollChain.clear();
226 std::unique_ptr<ScrollStateData> scrollStateData = 225 std::unique_ptr<ScrollStateData> scrollStateData =
227 makeUnique<ScrollStateData>(); 226 makeUnique<ScrollStateData>();
228 scrollStateData->position_x = gestureEvent.position().x(); 227 IntPoint position = flooredIntPoint(gestureEvent.positionInRootFrame());
229 scrollStateData->position_y = gestureEvent.position().y(); 228 scrollStateData->position_x = position.x();
229 scrollStateData->position_y = position.y();
230 scrollStateData->is_beginning = true; 230 scrollStateData->is_beginning = true;
231 scrollStateData->from_user_input = true; 231 scrollStateData->from_user_input = true;
232 scrollStateData->is_direct_manipulation = 232 scrollStateData->is_direct_manipulation =
233 gestureEvent.source() == PlatformGestureSourceTouchscreen; 233 gestureEvent.sourceDevice == WebGestureDeviceTouchscreen;
234 scrollStateData->delta_consumed_for_scroll_sequence = 234 scrollStateData->delta_consumed_for_scroll_sequence =
235 m_deltaConsumedForScrollSequence; 235 m_deltaConsumedForScrollSequence;
236 ScrollState* scrollState = ScrollState::create(std::move(scrollStateData)); 236 ScrollState* scrollState = ScrollState::create(std::move(scrollStateData));
237 customizedScroll(*m_scrollGestureHandlingNode.get(), *scrollState); 237 customizedScroll(*m_scrollGestureHandlingNode.get(), *scrollState);
238 return WebInputEventResult::HandledSystem; 238 return WebInputEventResult::HandledSystem;
239 } 239 }
240 240
241 WebInputEventResult ScrollManager::handleGestureScrollUpdate( 241 WebInputEventResult ScrollManager::handleGestureScrollUpdate(
242 const PlatformGestureEvent& gestureEvent) { 242 const WebGestureEvent& gestureEvent) {
243 DCHECK_EQ(gestureEvent.type(), PlatformEvent::GestureScrollUpdate); 243 DCHECK_EQ(gestureEvent.type, WebInputEvent::GestureScrollUpdate);
244 244
245 Node* node = m_scrollGestureHandlingNode.get(); 245 Node* node = m_scrollGestureHandlingNode.get();
246 if (!node || !node->layoutObject()) 246 if (!node || !node->layoutObject())
247 return WebInputEventResult::NotHandled; 247 return WebInputEventResult::NotHandled;
248 248
249 // Negate the deltas since the gesture event stores finger movement and 249 // Negate the deltas since the gesture event stores finger movement and
250 // scrolling occurs in the direction opposite the finger's movement 250 // scrolling occurs in the direction opposite the finger's movement
251 // direction. e.g. Finger moving up has negative event delta but causes the 251 // direction. e.g. Finger moving up has negative event delta but causes the
252 // page to scroll down causing positive scroll delta. 252 // page to scroll down causing positive scroll delta.
253 FloatSize delta(-gestureEvent.deltaX(), -gestureEvent.deltaY()); 253 FloatSize delta(-gestureEvent.deltaXInRootFrame(),
254 -gestureEvent.deltaYInRootFrame());
254 FloatSize velocity(-gestureEvent.velocityX(), -gestureEvent.velocityY()); 255 FloatSize velocity(-gestureEvent.velocityX(), -gestureEvent.velocityY());
255 FloatPoint position(gestureEvent.position()); 256 FloatPoint position(gestureEvent.positionInRootFrame());
256 257
257 if (delta.isZero()) 258 if (delta.isZero())
258 return WebInputEventResult::NotHandled; 259 return WebInputEventResult::NotHandled;
259 260
260 LayoutObject* layoutObject = node->layoutObject(); 261 LayoutObject* layoutObject = node->layoutObject();
261 262
262 // Try to send the event to the correct view. 263 // Try to send the event to the correct view.
263 WebInputEventResult result = 264 WebInputEventResult result =
264 passScrollGestureEventToWidget(gestureEvent, layoutObject); 265 passScrollGestureEventToWidget(gestureEvent, layoutObject);
265 if (result != WebInputEventResult::NotHandled) { 266 if (result != WebInputEventResult::NotHandled) {
266 // FIXME: we should allow simultaneous scrolling of nested 267 // FIXME: we should allow simultaneous scrolling of nested
267 // iframes along perpendicular axes. See crbug.com/466991. 268 // iframes along perpendicular axes. See crbug.com/466991.
268 m_deltaConsumedForScrollSequence = true; 269 m_deltaConsumedForScrollSequence = true;
269 return result; 270 return result;
270 } 271 }
271 272
272 std::unique_ptr<ScrollStateData> scrollStateData = 273 std::unique_ptr<ScrollStateData> scrollStateData =
273 makeUnique<ScrollStateData>(); 274 makeUnique<ScrollStateData>();
274 scrollStateData->delta_x = delta.width(); 275 scrollStateData->delta_x = delta.width();
275 scrollStateData->delta_y = delta.height(); 276 scrollStateData->delta_y = delta.height();
276 scrollStateData->delta_granularity = 277 scrollStateData->delta_granularity = static_cast<double>(
277 static_cast<double>(gestureEvent.deltaUnits()); 278 toPlatformScrollGranularity(gestureEvent.deltaUnits()));
278 scrollStateData->velocity_x = velocity.width(); 279 scrollStateData->velocity_x = velocity.width();
279 scrollStateData->velocity_y = velocity.height(); 280 scrollStateData->velocity_y = velocity.height();
280 scrollStateData->position_x = position.x(); 281 scrollStateData->position_x = position.x();
281 scrollStateData->position_y = position.y(); 282 scrollStateData->position_y = position.y();
282 scrollStateData->should_propagate = !gestureEvent.preventPropagation(); 283 scrollStateData->should_propagate = !gestureEvent.preventPropagation();
283 scrollStateData->is_in_inertial_phase = 284 scrollStateData->is_in_inertial_phase =
284 gestureEvent.inertialPhase() == ScrollInertialPhaseMomentum; 285 gestureEvent.inertialPhase() == WebGestureEvent::MomentumPhase;
285 scrollStateData->is_direct_manipulation = 286 scrollStateData->is_direct_manipulation =
286 gestureEvent.source() == PlatformGestureSourceTouchscreen; 287 gestureEvent.sourceDevice == WebGestureDeviceTouchscreen;
287 scrollStateData->from_user_input = true; 288 scrollStateData->from_user_input = true;
288 scrollStateData->delta_consumed_for_scroll_sequence = 289 scrollStateData->delta_consumed_for_scroll_sequence =
289 m_deltaConsumedForScrollSequence; 290 m_deltaConsumedForScrollSequence;
290 ScrollState* scrollState = ScrollState::create(std::move(scrollStateData)); 291 ScrollState* scrollState = ScrollState::create(std::move(scrollStateData));
291 if (m_previousGestureScrolledNode) { 292 if (m_previousGestureScrolledNode) {
292 // The ScrollState needs to know what the current 293 // The ScrollState needs to know what the current
293 // native scrolling element is, so that for an 294 // native scrolling element is, so that for an
294 // inertial scroll that shouldn't propagate, only the 295 // inertial scroll that shouldn't propagate, only the
295 // currently scrolling element responds. 296 // currently scrolling element responds.
296 DCHECK(m_previousGestureScrolledNode->isElementNode()); 297 DCHECK(m_previousGestureScrolledNode->isElementNode());
(...skipping 16 matching lines...) Expand all
313 314
314 if (didScrollX || didScrollY) { 315 if (didScrollX || didScrollY) {
315 setFrameWasScrolledByUser(); 316 setFrameWasScrolledByUser();
316 return WebInputEventResult::HandledSystem; 317 return WebInputEventResult::HandledSystem;
317 } 318 }
318 319
319 return WebInputEventResult::NotHandled; 320 return WebInputEventResult::NotHandled;
320 } 321 }
321 322
322 WebInputEventResult ScrollManager::handleGestureScrollEnd( 323 WebInputEventResult ScrollManager::handleGestureScrollEnd(
323 const PlatformGestureEvent& gestureEvent) { 324 const WebGestureEvent& gestureEvent) {
324 Node* node = m_scrollGestureHandlingNode; 325 Node* node = m_scrollGestureHandlingNode;
325 326
326 if (node && node->layoutObject()) { 327 if (node && node->layoutObject()) {
327 passScrollGestureEventToWidget(gestureEvent, node->layoutObject()); 328 passScrollGestureEventToWidget(gestureEvent, node->layoutObject());
328 std::unique_ptr<ScrollStateData> scrollStateData = 329 std::unique_ptr<ScrollStateData> scrollStateData =
329 makeUnique<ScrollStateData>(); 330 makeUnique<ScrollStateData>();
330 scrollStateData->is_ending = true; 331 scrollStateData->is_ending = true;
331 scrollStateData->is_in_inertial_phase = 332 scrollStateData->is_in_inertial_phase =
332 gestureEvent.inertialPhase() == ScrollInertialPhaseMomentum; 333 gestureEvent.inertialPhase() == WebGestureEvent::MomentumPhase;
333 scrollStateData->from_user_input = true; 334 scrollStateData->from_user_input = true;
334 scrollStateData->is_direct_manipulation = 335 scrollStateData->is_direct_manipulation =
335 gestureEvent.source() == PlatformGestureSourceTouchscreen; 336 gestureEvent.sourceDevice == WebGestureDeviceTouchscreen;
336 scrollStateData->delta_consumed_for_scroll_sequence = 337 scrollStateData->delta_consumed_for_scroll_sequence =
337 m_deltaConsumedForScrollSequence; 338 m_deltaConsumedForScrollSequence;
338 ScrollState* scrollState = ScrollState::create(std::move(scrollStateData)); 339 ScrollState* scrollState = ScrollState::create(std::move(scrollStateData));
339 customizedScroll(*node, *scrollState); 340 customizedScroll(*node, *scrollState);
340 } 341 }
341 342
342 clearGestureScrollState(); 343 clearGestureScrollState();
343 return WebInputEventResult::NotHandled; 344 return WebInputEventResult::NotHandled;
344 } 345 }
345 346
346 FrameHost* ScrollManager::frameHost() const { 347 FrameHost* ScrollManager::frameHost() const {
347 if (!m_frame->page()) 348 if (!m_frame->page())
348 return nullptr; 349 return nullptr;
349 350
350 return &m_frame->page()->frameHost(); 351 return &m_frame->page()->frameHost();
351 } 352 }
352 353
353 WebInputEventResult ScrollManager::passScrollGestureEventToWidget( 354 WebInputEventResult ScrollManager::passScrollGestureEventToWidget(
354 const PlatformGestureEvent& gestureEvent, 355 const WebGestureEvent& gestureEvent,
355 LayoutObject* layoutObject) { 356 LayoutObject* layoutObject) {
356 DCHECK(gestureEvent.isScrollEvent()); 357 DCHECK(gestureEvent.isScrollEvent());
357 358
358 if (!m_lastGestureScrollOverWidget || !layoutObject || 359 if (!m_lastGestureScrollOverWidget || !layoutObject ||
359 !layoutObject->isLayoutPart()) 360 !layoutObject->isLayoutPart())
360 return WebInputEventResult::NotHandled; 361 return WebInputEventResult::NotHandled;
361 362
362 Widget* widget = toLayoutPart(layoutObject)->widget(); 363 Widget* widget = toLayoutPart(layoutObject)->widget();
363 364
364 if (!widget || !widget->isFrameView()) 365 if (!widget || !widget->isFrameView())
(...skipping 10 matching lines...) Expand all
375 return false; 376 return false;
376 377
377 if (!node.isElementNode()) 378 if (!node.isElementNode())
378 return false; 379 return false;
379 380
380 return node.isSameNode( 381 return node.isSameNode(
381 m_frame->document()->rootScrollerController()->effectiveRootScroller()); 382 m_frame->document()->rootScrollerController()->effectiveRootScroller());
382 } 383 }
383 384
384 WebInputEventResult ScrollManager::handleGestureScrollEvent( 385 WebInputEventResult ScrollManager::handleGestureScrollEvent(
385 const PlatformGestureEvent& gestureEvent) { 386 const WebGestureEvent& gestureEvent) {
386 if (!m_frame->view()) 387 if (!m_frame->view())
387 return WebInputEventResult::NotHandled; 388 return WebInputEventResult::NotHandled;
388 389
389 Node* eventTarget = nullptr; 390 Node* eventTarget = nullptr;
390 Scrollbar* scrollbar = nullptr; 391 Scrollbar* scrollbar = nullptr;
391 if (gestureEvent.type() != PlatformEvent::GestureScrollBegin) { 392 if (gestureEvent.type != WebInputEvent::GestureScrollBegin) {
392 scrollbar = m_scrollbarHandlingScrollGesture.get(); 393 scrollbar = m_scrollbarHandlingScrollGesture.get();
393 eventTarget = m_scrollGestureHandlingNode.get(); 394 eventTarget = m_scrollGestureHandlingNode.get();
394 } 395 }
395 396
396 if (!eventTarget) { 397 if (!eventTarget) {
397 Document* document = m_frame->document(); 398 Document* document = m_frame->document();
398 if (document->layoutViewItem().isNull()) 399 if (document->layoutViewItem().isNull())
399 return WebInputEventResult::NotHandled; 400 return WebInputEventResult::NotHandled;
400 401
401 FrameView* view = m_frame->view(); 402 FrameView* view = m_frame->view();
402 LayoutPoint viewPoint = view->rootFrameToContents(gestureEvent.position()); 403 LayoutPoint viewPoint = view->rootFrameToContents(
404 flooredIntPoint(gestureEvent.positionInRootFrame()));
403 HitTestRequest request(HitTestRequest::ReadOnly); 405 HitTestRequest request(HitTestRequest::ReadOnly);
404 HitTestResult result(request, viewPoint); 406 HitTestResult result(request, viewPoint);
405 document->layoutViewItem().hitTest(result); 407 document->layoutViewItem().hitTest(result);
406 408
407 eventTarget = result.innerNode(); 409 eventTarget = result.innerNode();
408 410
409 m_lastGestureScrollOverWidget = result.isOverWidget(); 411 m_lastGestureScrollOverWidget = result.isOverWidget();
410 m_scrollGestureHandlingNode = eventTarget; 412 m_scrollGestureHandlingNode = eventTarget;
411 m_previousGestureScrolledNode = nullptr; 413 m_previousGestureScrolledNode = nullptr;
412 m_deltaConsumedForScrollSequence = false; 414 m_deltaConsumedForScrollSequence = false;
(...skipping 22 matching lines...) Expand all
435 DispatchEventResult gestureDomEventResult = 437 DispatchEventResult gestureDomEventResult =
436 eventTarget->dispatchEvent(gestureDomEvent); 438 eventTarget->dispatchEvent(gestureDomEvent);
437 if (gestureDomEventResult != DispatchEventResult::NotCanceled) { 439 if (gestureDomEventResult != DispatchEventResult::NotCanceled) {
438 DCHECK(gestureDomEventResult != 440 DCHECK(gestureDomEventResult !=
439 DispatchEventResult::CanceledByEventHandler); 441 DispatchEventResult::CanceledByEventHandler);
440 return EventHandlingUtil::toWebInputEventResult(gestureDomEventResult); 442 return EventHandlingUtil::toWebInputEventResult(gestureDomEventResult);
441 } 443 }
442 } 444 }
443 } 445 }
444 446
445 switch (gestureEvent.type()) { 447 switch (gestureEvent.type) {
446 case PlatformEvent::GestureScrollBegin: 448 case WebInputEvent::GestureScrollBegin:
447 return handleGestureScrollBegin(gestureEvent); 449 return handleGestureScrollBegin(gestureEvent);
448 case PlatformEvent::GestureScrollUpdate: 450 case WebInputEvent::GestureScrollUpdate:
449 return handleGestureScrollUpdate(gestureEvent); 451 return handleGestureScrollUpdate(gestureEvent);
450 case PlatformEvent::GestureScrollEnd: 452 case WebInputEvent::GestureScrollEnd:
451 return handleGestureScrollEnd(gestureEvent); 453 return handleGestureScrollEnd(gestureEvent);
452 case PlatformEvent::GestureFlingStart: 454 case WebInputEvent::GestureFlingStart:
453 case PlatformEvent::GesturePinchBegin: 455 case WebInputEvent::GesturePinchBegin:
454 case PlatformEvent::GesturePinchEnd: 456 case WebInputEvent::GesturePinchEnd:
455 case PlatformEvent::GesturePinchUpdate: 457 case WebInputEvent::GesturePinchUpdate:
456 return WebInputEventResult::NotHandled; 458 return WebInputEventResult::NotHandled;
457 default: 459 default:
458 NOTREACHED(); 460 NOTREACHED();
459 return WebInputEventResult::NotHandled; 461 return WebInputEventResult::NotHandled;
460 } 462 }
461 } 463 }
462 464
463 bool ScrollManager::isScrollbarHandlingGestures() const { 465 bool ScrollManager::isScrollbarHandlingGestures() const {
464 return m_scrollbarHandlingScrollGesture.get(); 466 return m_scrollbarHandlingScrollGesture.get();
465 } 467 }
466 468
467 bool ScrollManager::handleScrollGestureOnResizer( 469 bool ScrollManager::handleScrollGestureOnResizer(
468 Node* eventTarget, 470 Node* eventTarget,
469 const PlatformGestureEvent& gestureEvent) { 471 const WebGestureEvent& gestureEvent) {
470 if (gestureEvent.source() != PlatformGestureSourceTouchscreen) 472 if (gestureEvent.sourceDevice != WebGestureDeviceTouchscreen)
471 return false; 473 return false;
472 474
473 if (gestureEvent.type() == PlatformEvent::GestureScrollBegin) { 475 if (gestureEvent.type == WebInputEvent::GestureScrollBegin) {
474 PaintLayer* layer = eventTarget->layoutObject() 476 PaintLayer* layer = eventTarget->layoutObject()
475 ? eventTarget->layoutObject()->enclosingLayer() 477 ? eventTarget->layoutObject()->enclosingLayer()
476 : nullptr; 478 : nullptr;
477 IntPoint p = m_frame->view()->rootFrameToContents(gestureEvent.position()); 479 IntPoint p = m_frame->view()->rootFrameToContents(
480 flooredIntPoint(gestureEvent.positionInRootFrame()));
478 if (layer && layer->getScrollableArea() && 481 if (layer && layer->getScrollableArea() &&
479 layer->getScrollableArea()->isPointInResizeControl(p, 482 layer->getScrollableArea()->isPointInResizeControl(p,
480 ResizerForTouch)) { 483 ResizerForTouch)) {
481 m_resizeScrollableArea = layer->getScrollableArea(); 484 m_resizeScrollableArea = layer->getScrollableArea();
482 m_resizeScrollableArea->setInResizeMode(true); 485 m_resizeScrollableArea->setInResizeMode(true);
483 m_offsetFromResizeCorner = 486 m_offsetFromResizeCorner =
484 LayoutSize(m_resizeScrollableArea->offsetFromResizeCorner(p)); 487 LayoutSize(m_resizeScrollableArea->offsetFromResizeCorner(p));
485 return true; 488 return true;
486 } 489 }
487 } else if (gestureEvent.type() == PlatformEvent::GestureScrollUpdate) { 490 } else if (gestureEvent.type == WebInputEvent::GestureScrollUpdate) {
488 if (m_resizeScrollableArea && m_resizeScrollableArea->inResizeMode()) { 491 if (m_resizeScrollableArea && m_resizeScrollableArea->inResizeMode()) {
489 m_resizeScrollableArea->resize(gestureEvent, m_offsetFromResizeCorner); 492 m_resizeScrollableArea->resize(gestureEvent, m_offsetFromResizeCorner);
490 return true; 493 return true;
491 } 494 }
492 } else if (gestureEvent.type() == PlatformEvent::GestureScrollEnd) { 495 } else if (gestureEvent.type == WebInputEvent::GestureScrollEnd) {
493 if (m_resizeScrollableArea && m_resizeScrollableArea->inResizeMode()) { 496 if (m_resizeScrollableArea && m_resizeScrollableArea->inResizeMode()) {
494 m_resizeScrollableArea->setInResizeMode(false); 497 m_resizeScrollableArea->setInResizeMode(false);
495 m_resizeScrollableArea = nullptr; 498 m_resizeScrollableArea = nullptr;
496 return false; 499 return false;
497 } 500 }
498 } 501 }
499 502
500 return false; 503 return false;
501 } 504 }
502 505
(...skipping 30 matching lines...) Expand all
533 if (scrollbar->gestureEvent(targetedEvent.event(), &shouldUpdateCapture)) { 536 if (scrollbar->gestureEvent(targetedEvent.event(), &shouldUpdateCapture)) {
534 if (shouldUpdateCapture) 537 if (shouldUpdateCapture)
535 m_scrollbarHandlingScrollGesture = scrollbar; 538 m_scrollbarHandlingScrollGesture = scrollbar;
536 return true; 539 return true;
537 } 540 }
538 } 541 }
539 return false; 542 return false;
540 } 543 }
541 544
542 } // namespace blink 545 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698