| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> | 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> |
| 3 * 1999 Lars Knoll <knoll@kde.org> | 3 * 1999 Lars Knoll <knoll@kde.org> |
| 4 * 1999 Antti Koivisto <koivisto@kde.org> | 4 * 1999 Antti Koivisto <koivisto@kde.org> |
| 5 * 2000 Dirk Mueller <mueller@kde.org> | 5 * 2000 Dirk Mueller <mueller@kde.org> |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
| 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
| 9 * Copyright (C) 2009 Google Inc. All rights reserved. | 9 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 10 * | 10 * |
| (...skipping 1928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1939 void FrameView::didScrollTimerFired(TimerBase*) { | 1939 void FrameView::didScrollTimerFired(TimerBase*) { |
| 1940 if (m_frame->document() && !m_frame->document()->layoutViewItem().isNull()) | 1940 if (m_frame->document() && !m_frame->document()->layoutViewItem().isNull()) |
| 1941 m_frame->document()->fetcher()->updateAllImageResourcePriorities(); | 1941 m_frame->document()->fetcher()->updateAllImageResourcePriorities(); |
| 1942 } | 1942 } |
| 1943 | 1943 |
| 1944 void FrameView::updateLayersAndCompositingAfterScrollIfNeeded() { | 1944 void FrameView::updateLayersAndCompositingAfterScrollIfNeeded() { |
| 1945 // Nothing to do after scrolling if there are no fixed position elements. | 1945 // Nothing to do after scrolling if there are no fixed position elements. |
| 1946 if (!hasViewportConstrainedObjects()) | 1946 if (!hasViewportConstrainedObjects()) |
| 1947 return; | 1947 return; |
| 1948 | 1948 |
| 1949 // Update sticky position objects which are stuck to the viewport. | 1949 // Update sticky position objects which are stuck to the viewport. In order to |
| 1950 // correctly compute the sticky position offsets, the layers must be visited |
| 1951 // top-down, so start at the 'root' sticky elements and recurse downwards. |
| 1950 for (const auto& viewportConstrainedObject : *m_viewportConstrainedObjects) { | 1952 for (const auto& viewportConstrainedObject : *m_viewportConstrainedObjects) { |
| 1951 LayoutObject* layoutObject = viewportConstrainedObject; | 1953 LayoutObject* layoutObject = viewportConstrainedObject; |
| 1952 PaintLayer* layer = toLayoutBoxModelObject(layoutObject)->layer(); | 1954 PaintLayer* layer = toLayoutBoxModelObject(layoutObject)->layer(); |
| 1953 if (layoutObject->style()->position() == StickyPosition) { | 1955 StickyConstraintsMap constraintsMap = |
| 1956 layer->getScrollableArea()->stickyConstraintsMap(); |
| 1957 if (layoutObject->style()->position() == StickyPosition && |
| 1958 constraintsMap.contains(layer) && |
| 1959 !constraintsMap.get(layer).hasAncestorStickyElement()) { |
| 1954 // TODO(skobes): Resolve circular dependency between scroll offset and | 1960 // TODO(skobes): Resolve circular dependency between scroll offset and |
| 1955 // compositing state, and remove this disabler. https://crbug.com/420741 | 1961 // compositing state, and remove this disabler. https://crbug.com/420741 |
| 1956 DisableCompositingQueryAsserts disabler; | 1962 DisableCompositingQueryAsserts disabler; |
| 1957 layer->updateLayerPositionsAfterOverflowScroll(); | 1963 layer->updateLayerPositionsAfterOverflowScroll(); |
| 1958 layoutObject->setMayNeedPaintInvalidationSubtree(); | 1964 layoutObject->setMayNeedPaintInvalidationSubtree(); |
| 1959 } | 1965 } |
| 1960 } | 1966 } |
| 1961 | 1967 |
| 1962 // If there fixed position elements, scrolling may cause compositing layers to | 1968 // If there fixed position elements, scrolling may cause compositing layers to |
| 1963 // change. Update widget and layer positions after scrolling, but only if | 1969 // change. Update widget and layer positions after scrolling, but only if |
| (...skipping 3097 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5061 std::unique_ptr<CompositorAnimationTimeline> timeline) { | 5067 std::unique_ptr<CompositorAnimationTimeline> timeline) { |
| 5062 m_animationTimeline = std::move(timeline); | 5068 m_animationTimeline = std::move(timeline); |
| 5063 } | 5069 } |
| 5064 | 5070 |
| 5065 void FrameView::setAnimationHost( | 5071 void FrameView::setAnimationHost( |
| 5066 std::unique_ptr<CompositorAnimationHost> host) { | 5072 std::unique_ptr<CompositorAnimationHost> host) { |
| 5067 m_animationHost = std::move(host); | 5073 m_animationHost = std::move(host); |
| 5068 } | 5074 } |
| 5069 | 5075 |
| 5070 } // namespace blink | 5076 } // namespace blink |
| OLD | NEW |