| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. |
| 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
| 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) | 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 621 // scroll. This is a hack, we stuff the enum into the double value for | 621 // scroll. This is a hack, we stuff the enum into the double value for |
| 622 // now. | 622 // now. |
| 623 scrollStateData->delta_granularity = static_cast<double>(granularity); | 623 scrollStateData->delta_granularity = static_cast<double>(granularity); |
| 624 scrollStateData->velocity_x = velocity.width(); | 624 scrollStateData->velocity_x = velocity.width(); |
| 625 scrollStateData->velocity_y = velocity.height(); | 625 scrollStateData->velocity_y = velocity.height(); |
| 626 scrollStateData->should_propagate = false; | 626 scrollStateData->should_propagate = false; |
| 627 scrollStateData->is_in_inertial_phase = false; | 627 scrollStateData->is_in_inertial_phase = false; |
| 628 scrollStateData->from_user_input = true; | 628 scrollStateData->from_user_input = true; |
| 629 scrollStateData->delta_consumed_for_scroll_sequence = false; | 629 scrollStateData->delta_consumed_for_scroll_sequence = false; |
| 630 ScrollState* scrollState = | 630 ScrollState* scrollState = |
| 631 ScrollState::create(scrollStateData.release()); | 631 ScrollState::create(std::move(scrollStateData)); |
| 632 | 632 |
| 633 customizedScroll(*node, *scrollState); | 633 customizedScroll(*node, *scrollState); |
| 634 | 634 |
| 635 ScrollResult result( | 635 ScrollResult result( |
| 636 scrollState->deltaX() != delta.width(), | 636 scrollState->deltaX() != delta.width(), |
| 637 scrollState->deltaY() != delta.height(), | 637 scrollState->deltaY() != delta.height(), |
| 638 scrollState->deltaX(), | 638 scrollState->deltaX(), |
| 639 scrollState->deltaY()); | 639 scrollState->deltaY()); |
| 640 | 640 |
| 641 *wasRootScroller = true; | 641 *wasRootScroller = true; |
| (...skipping 1727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2369 | 2369 |
| 2370 if (node) { | 2370 if (node) { |
| 2371 passScrollGestureEventToWidget(gestureEvent, node->layoutObject()); | 2371 passScrollGestureEventToWidget(gestureEvent, node->layoutObject()); |
| 2372 if (RuntimeEnabledFeatures::scrollCustomizationEnabled()) { | 2372 if (RuntimeEnabledFeatures::scrollCustomizationEnabled()) { |
| 2373 OwnPtr<ScrollStateData> scrollStateData = adoptPtr(new ScrollStateDa
ta()); | 2373 OwnPtr<ScrollStateData> scrollStateData = adoptPtr(new ScrollStateDa
ta()); |
| 2374 scrollStateData->is_ending = true; | 2374 scrollStateData->is_ending = true; |
| 2375 scrollStateData->is_in_inertial_phase = gestureEvent.inertial(); | 2375 scrollStateData->is_in_inertial_phase = gestureEvent.inertial(); |
| 2376 scrollStateData->from_user_input = true; | 2376 scrollStateData->from_user_input = true; |
| 2377 scrollStateData->is_direct_manipulation = true; | 2377 scrollStateData->is_direct_manipulation = true; |
| 2378 scrollStateData->delta_consumed_for_scroll_sequence = m_deltaConsume
dForScrollSequence; | 2378 scrollStateData->delta_consumed_for_scroll_sequence = m_deltaConsume
dForScrollSequence; |
| 2379 ScrollState* scrollState = ScrollState::create(scrollStateData.relea
se()); | 2379 ScrollState* scrollState = ScrollState::create(std::move(scrollState
Data)); |
| 2380 customizedScroll(*node, *scrollState); | 2380 customizedScroll(*node, *scrollState); |
| 2381 } | 2381 } |
| 2382 } | 2382 } |
| 2383 | 2383 |
| 2384 clearGestureScrollState(); | 2384 clearGestureScrollState(); |
| 2385 return WebInputEventResult::NotHandled; | 2385 return WebInputEventResult::NotHandled; |
| 2386 } | 2386 } |
| 2387 | 2387 |
| 2388 WebInputEventResult EventHandler::handleGestureScrollBegin(const PlatformGesture
Event& gestureEvent) | 2388 WebInputEventResult EventHandler::handleGestureScrollBegin(const PlatformGesture
Event& gestureEvent) |
| 2389 { | 2389 { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 2410 | 2410 |
| 2411 passScrollGestureEventToWidget(gestureEvent, m_scrollGestureHandlingNode->la
youtObject()); | 2411 passScrollGestureEventToWidget(gestureEvent, m_scrollGestureHandlingNode->la
youtObject()); |
| 2412 if (RuntimeEnabledFeatures::scrollCustomizationEnabled()) { | 2412 if (RuntimeEnabledFeatures::scrollCustomizationEnabled()) { |
| 2413 m_currentScrollChain.clear(); | 2413 m_currentScrollChain.clear(); |
| 2414 OwnPtr<ScrollStateData> scrollStateData = adoptPtr(new ScrollStateData()
); | 2414 OwnPtr<ScrollStateData> scrollStateData = adoptPtr(new ScrollStateData()
); |
| 2415 scrollStateData->position_x = gestureEvent.position().x(); | 2415 scrollStateData->position_x = gestureEvent.position().x(); |
| 2416 scrollStateData->position_y = gestureEvent.position().y(); | 2416 scrollStateData->position_y = gestureEvent.position().y(); |
| 2417 scrollStateData->is_beginning = true; | 2417 scrollStateData->is_beginning = true; |
| 2418 scrollStateData->from_user_input = true; | 2418 scrollStateData->from_user_input = true; |
| 2419 scrollStateData->delta_consumed_for_scroll_sequence = m_deltaConsumedFor
ScrollSequence; | 2419 scrollStateData->delta_consumed_for_scroll_sequence = m_deltaConsumedFor
ScrollSequence; |
| 2420 ScrollState* scrollState = ScrollState::create(scrollStateData.release()
); | 2420 ScrollState* scrollState = ScrollState::create(std::move(scrollStateData
)); |
| 2421 customizedScroll(*m_scrollGestureHandlingNode.get(), *scrollState); | 2421 customizedScroll(*m_scrollGestureHandlingNode.get(), *scrollState); |
| 2422 } else { | 2422 } else { |
| 2423 if (m_frame->isMainFrame()) | 2423 if (m_frame->isMainFrame()) |
| 2424 m_frame->host()->topControls().scrollBegin(); | 2424 m_frame->host()->topControls().scrollBegin(); |
| 2425 } | 2425 } |
| 2426 return WebInputEventResult::HandledSystem; | 2426 return WebInputEventResult::HandledSystem; |
| 2427 } | 2427 } |
| 2428 | 2428 |
| 2429 bool EventHandler::isRootScroller(const Node& node) const | 2429 bool EventHandler::isRootScroller(const Node& node) const |
| 2430 { | 2430 { |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2478 OwnPtr<ScrollStateData> scrollStateData = adoptPtr(new ScrollStateDa
ta()); | 2478 OwnPtr<ScrollStateData> scrollStateData = adoptPtr(new ScrollStateDa
ta()); |
| 2479 scrollStateData->delta_x = delta.width(); | 2479 scrollStateData->delta_x = delta.width(); |
| 2480 scrollStateData->delta_y = delta.height(); | 2480 scrollStateData->delta_y = delta.height(); |
| 2481 scrollStateData->delta_granularity = ScrollByPrecisePixel; | 2481 scrollStateData->delta_granularity = ScrollByPrecisePixel; |
| 2482 scrollStateData->velocity_x = velocity.width(); | 2482 scrollStateData->velocity_x = velocity.width(); |
| 2483 scrollStateData->velocity_y = velocity.height(); | 2483 scrollStateData->velocity_y = velocity.height(); |
| 2484 scrollStateData->should_propagate = !gestureEvent.preventPropagation
(); | 2484 scrollStateData->should_propagate = !gestureEvent.preventPropagation
(); |
| 2485 scrollStateData->is_in_inertial_phase = gestureEvent.inertial(); | 2485 scrollStateData->is_in_inertial_phase = gestureEvent.inertial(); |
| 2486 scrollStateData->from_user_input = true; | 2486 scrollStateData->from_user_input = true; |
| 2487 scrollStateData->delta_consumed_for_scroll_sequence = m_deltaConsume
dForScrollSequence; | 2487 scrollStateData->delta_consumed_for_scroll_sequence = m_deltaConsume
dForScrollSequence; |
| 2488 ScrollState* scrollState = ScrollState::create(scrollStateData.relea
se()); | 2488 ScrollState* scrollState = ScrollState::create(std::move(scrollState
Data)); |
| 2489 if (m_previousGestureScrolledNode) { | 2489 if (m_previousGestureScrolledNode) { |
| 2490 // The ScrollState needs to know what the current | 2490 // The ScrollState needs to know what the current |
| 2491 // native scrolling element is, so that for an | 2491 // native scrolling element is, so that for an |
| 2492 // inertial scroll that shouldn't propagate, only the | 2492 // inertial scroll that shouldn't propagate, only the |
| 2493 // currently scrolling element responds. | 2493 // currently scrolling element responds. |
| 2494 ASSERT(m_previousGestureScrolledNode->isElementNode()); | 2494 ASSERT(m_previousGestureScrolledNode->isElementNode()); |
| 2495 scrollState->setCurrentNativeScrollingElement(toElement(m_previo
usGestureScrolledNode.get())); | 2495 scrollState->setCurrentNativeScrollingElement(toElement(m_previo
usGestureScrolledNode.get())); |
| 2496 } | 2496 } |
| 2497 customizedScroll(*node, *scrollState); | 2497 customizedScroll(*node, *scrollState); |
| 2498 m_previousGestureScrolledNode = scrollState->currentNativeScrollingE
lement(); | 2498 m_previousGestureScrolledNode = scrollState->currentNativeScrollingE
lement(); |
| (...skipping 1208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3707 | 3707 |
| 3708 FrameHost* EventHandler::frameHost() const | 3708 FrameHost* EventHandler::frameHost() const |
| 3709 { | 3709 { |
| 3710 if (!m_frame->page()) | 3710 if (!m_frame->page()) |
| 3711 return nullptr; | 3711 return nullptr; |
| 3712 | 3712 |
| 3713 return &m_frame->page()->frameHost(); | 3713 return &m_frame->page()->frameHost(); |
| 3714 } | 3714 } |
| 3715 | 3715 |
| 3716 } // namespace blink | 3716 } // namespace blink |
| OLD | NEW |