| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |