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 "core/page/scrolling/ScrollState.h" | 5 #include "core/page/scrolling/ScrollState.h" |
6 | 6 |
| 7 #include <memory> |
7 #include "core/dom/DOMNodeIds.h" | 8 #include "core/dom/DOMNodeIds.h" |
8 #include "core/dom/Element.h" | 9 #include "core/dom/Element.h" |
9 #include "core/dom/ExceptionCode.h" | 10 #include "core/dom/ExceptionCode.h" |
10 #include "platform/graphics/CompositorElementId.h" | 11 #include "platform/graphics/CompositorElementId.h" |
11 #include "wtf/PtrUtil.h" | 12 #include "wtf/PtrUtil.h" |
12 #include <memory> | |
13 | 13 |
14 namespace blink { | 14 namespace blink { |
15 | 15 |
16 namespace { | 16 namespace { |
17 Element* elementForId(int elementId) { | 17 Element* elementForId(int elementId) { |
18 Node* node = DOMNodeIds::nodeForId(elementId); | 18 Node* node = DOMNodeIds::nodeForId(elementId); |
19 ASSERT(node); | 19 ASSERT(node); |
20 if (!node) | 20 if (!node) |
21 return nullptr; | 21 return nullptr; |
22 ASSERT(node->isElementNode()); | 22 ASSERT(node->isElementNode()); |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 m_data->set_current_native_scrolling_element(createCompositorElementId( | 103 m_data->set_current_native_scrolling_element(createCompositorElementId( |
104 DOMNodeIds::idForNode(element), CompositorSubElementId::Scroll)); | 104 DOMNodeIds::idForNode(element), CompositorSubElementId::Scroll)); |
105 } | 105 } |
106 | 106 |
107 void ScrollState::setCurrentNativeScrollingElementById(int elementId) { | 107 void ScrollState::setCurrentNativeScrollingElementById(int elementId) { |
108 m_data->set_current_native_scrolling_element( | 108 m_data->set_current_native_scrolling_element( |
109 createCompositorElementId(elementId, CompositorSubElementId::Scroll)); | 109 createCompositorElementId(elementId, CompositorSubElementId::Scroll)); |
110 } | 110 } |
111 | 111 |
112 } // namespace blink | 112 } // namespace blink |
OLD | NEW |