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

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

Issue 1209183004: Expose scroll customization for touch to JS (behind REF). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Address skobes' nits. Created 5 years, 5 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
« no previous file with comments | « Source/core/page/scrolling/ScrollState.h ('k') | Source/core/page/scrolling/ScrollState.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "config.h" 5 #include "config.h"
6 #include "core/page/scrolling/ScrollState.h" 6 #include "core/page/scrolling/ScrollState.h"
7 7
8 #include "core/dom/Element.h" 8 #include "core/dom/Element.h"
9 #include "core/dom/ExceptionCode.h" 9 #include "core/dom/ExceptionCode.h"
10 10
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 if (fabs(x) > fabs(m_deltaX) || fabs(y) > fabs(m_deltaY)) { 48 if (fabs(x) > fabs(m_deltaX) || fabs(y) > fabs(m_deltaY)) {
49 exceptionState.throwDOMException(InvalidModificationError, "Can't change direction of delta using consumeDelta"); 49 exceptionState.throwDOMException(InvalidModificationError, "Can't change direction of delta using consumeDelta");
50 return; 50 return;
51 } 51 }
52 consumeDeltaNative(x, y); 52 consumeDeltaNative(x, y);
53 } 53 }
54 54
55 void ScrollState::distributeToScrollChainDescendant() 55 void ScrollState::distributeToScrollChainDescendant()
56 { 56 {
57 if (!m_scrollChain.isEmpty()) 57 if (!m_scrollChain.isEmpty())
58 m_scrollChain.takeFirst()->distributeScroll(*this); 58 m_scrollChain.takeFirst()->callDistributeScroll(*this);
59 } 59 }
60 60
61 void ScrollState::consumeDeltaNative(double x, double y) 61 void ScrollState::consumeDeltaNative(double x, double y)
62 { 62 {
63 m_deltaX -= x; 63 m_deltaX -= x;
64 m_deltaY -= y; 64 m_deltaY -= y;
65 65
66 if (x || y) 66 if (x || y)
67 m_deltaConsumedForScrollSequence = true; 67 m_deltaConsumedForScrollSequence = true;
68 } 68 }
69 69
70 } // namespace blink 70 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/page/scrolling/ScrollState.h ('k') | Source/core/page/scrolling/ScrollState.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698