OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * Copyright (C) 2013 Apple Inc. All rights reserved. | 3 * Copyright (C) 2013 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 } | 189 } |
190 | 190 |
191 static ScrollableArea* scrollableAreaForNode(Node* node) | 191 static ScrollableArea* scrollableAreaForNode(Node* node) |
192 { | 192 { |
193 if (!node) | 193 if (!node) |
194 return nullptr; | 194 return nullptr; |
195 | 195 |
196 if (node->isDocumentNode()) { | 196 if (node->isDocumentNode()) { |
197 // This can be removed after root layer scrolling is enabled. | 197 // This can be removed after root layer scrolling is enabled. |
198 if (FrameView* frameView = toDocument(node)->view()) | 198 if (FrameView* frameView = toDocument(node)->view()) |
199 return frameView->scrollableArea(); | 199 return frameView->layoutViewportScrollableArea(); |
200 } | 200 } |
201 | 201 |
202 LayoutObject* layoutObject = node->layoutObject(); | 202 LayoutObject* layoutObject = node->layoutObject(); |
203 if (!layoutObject || !layoutObject->isBox()) | 203 if (!layoutObject || !layoutObject->isBox()) |
204 return nullptr; | 204 return nullptr; |
205 | 205 |
206 return toLayoutBox(layoutObject)->scrollableArea(); | 206 return toLayoutBox(layoutObject)->scrollableArea(); |
207 } | 207 } |
208 | 208 |
209 const char* Internals::internalsId = "internals"; | 209 const char* Internals::internalsId = "internals"; |
(...skipping 2350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2560 } | 2560 } |
2561 | 2561 |
2562 int Internals::getScrollAnimationState(Node* node) const | 2562 int Internals::getScrollAnimationState(Node* node) const |
2563 { | 2563 { |
2564 if (ScrollableArea* scrollableArea = scrollableAreaForNode(node)) | 2564 if (ScrollableArea* scrollableArea = scrollableAreaForNode(node)) |
2565 return static_cast<int>(scrollableArea->scrollAnimator().m_runState); | 2565 return static_cast<int>(scrollableArea->scrollAnimator().m_runState); |
2566 return -1; | 2566 return -1; |
2567 } | 2567 } |
2568 | 2568 |
2569 } // namespace blink | 2569 } // namespace blink |
OLD | NEW |