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

Side by Side Diff: third_party/WebKit/Source/core/page/scrolling/ScrollState.cpp

Issue 2907053004: GSB uses delta_hints to calculate scrolling chain. (Closed)
Patch Set: Merged with master. Created 3 years, 6 months 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/page/scrolling/ScrollState.h" 5 #include "core/page/scrolling/ScrollState.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include "core/dom/DOMNodeIds.h" 8 #include "core/dom/DOMNodeIds.h"
9 #include "core/dom/Element.h" 9 #include "core/dom/Element.h"
10 #include "core/dom/ExceptionCode.h" 10 #include "core/dom/ExceptionCode.h"
(...skipping 14 matching lines...) Expand all
25 return nullptr; 25 return nullptr;
26 return static_cast<Element*>(node); 26 return static_cast<Element*>(node);
27 } 27 }
28 } // namespace 28 } // namespace
29 29
30 ScrollState* ScrollState::Create(ScrollStateInit init) { 30 ScrollState* ScrollState::Create(ScrollStateInit init) {
31 std::unique_ptr<ScrollStateData> scroll_state_data = 31 std::unique_ptr<ScrollStateData> scroll_state_data =
32 WTF::MakeUnique<ScrollStateData>(); 32 WTF::MakeUnique<ScrollStateData>();
33 scroll_state_data->delta_x = init.deltaX(); 33 scroll_state_data->delta_x = init.deltaX();
34 scroll_state_data->delta_y = init.deltaY(); 34 scroll_state_data->delta_y = init.deltaY();
35 scroll_state_data->delta_x_hint = init.deltaXHint();
36 scroll_state_data->delta_y_hint = init.deltaYHint();
37 scroll_state_data->ignore_delta_hints = init.ignoreDeltaHints();
35 scroll_state_data->position_x = init.positionX(); 38 scroll_state_data->position_x = init.positionX();
36 scroll_state_data->position_y = init.positionY(); 39 scroll_state_data->position_y = init.positionY();
37 scroll_state_data->velocity_x = init.velocityX(); 40 scroll_state_data->velocity_x = init.velocityX();
38 scroll_state_data->velocity_y = init.velocityY(); 41 scroll_state_data->velocity_y = init.velocityY();
39 scroll_state_data->is_beginning = init.isBeginning(); 42 scroll_state_data->is_beginning = init.isBeginning();
40 scroll_state_data->is_in_inertial_phase = init.isInInertialPhase(); 43 scroll_state_data->is_in_inertial_phase = init.isInInertialPhase();
41 scroll_state_data->is_ending = init.isEnding(); 44 scroll_state_data->is_ending = init.isEnding();
42 scroll_state_data->should_propagate = init.shouldPropagate(); 45 scroll_state_data->should_propagate = init.shouldPropagate();
43 scroll_state_data->from_user_input = init.fromUserInput(); 46 scroll_state_data->from_user_input = init.fromUserInput();
44 scroll_state_data->is_direct_manipulation = init.isDirectManipulation(); 47 scroll_state_data->is_direct_manipulation = init.isDirectManipulation();
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 } 105 }
103 106
104 void ScrollState::SetCurrentNativeScrollingElement(Element* element) { 107 void ScrollState::SetCurrentNativeScrollingElement(Element* element) {
105 element_ = element; 108 element_ = element;
106 data_->set_current_native_scrolling_element(CompositorElementIdFromDOMNodeId( 109 data_->set_current_native_scrolling_element(CompositorElementIdFromDOMNodeId(
107 DOMNodeIds::IdForNode(element), 110 DOMNodeIds::IdForNode(element),
108 CompositorElementIdNamespace::kScrollState)); 111 CompositorElementIdNamespace::kScrollState));
109 } 112 }
110 113
111 } // namespace blink 114 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698