| 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 1939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1950 void FrameView::didScrollTimerFired(TimerBase*) { | 1950 void FrameView::didScrollTimerFired(TimerBase*) { |
| 1951 if (m_frame->document() && !m_frame->document()->layoutViewItem().isNull()) | 1951 if (m_frame->document() && !m_frame->document()->layoutViewItem().isNull()) |
| 1952 m_frame->document()->fetcher()->updateAllImageResourcePriorities(); | 1952 m_frame->document()->fetcher()->updateAllImageResourcePriorities(); |
| 1953 } | 1953 } |
| 1954 | 1954 |
| 1955 void FrameView::updateLayersAndCompositingAfterScrollIfNeeded() { | 1955 void FrameView::updateLayersAndCompositingAfterScrollIfNeeded() { |
| 1956 // Nothing to do after scrolling if there are no fixed position elements. | 1956 // Nothing to do after scrolling if there are no fixed position elements. |
| 1957 if (!hasViewportConstrainedObjects()) | 1957 if (!hasViewportConstrainedObjects()) |
| 1958 return; | 1958 return; |
| 1959 | 1959 |
| 1960 // Update sticky position objects which are stuck to the viewport. | 1960 // Update sticky position objects which are stuck to the viewport. In order to |
| 1961 // correctly compute the sticky position offsets, the layers must be visited |
| 1962 // top-down, so start at the 'root' sticky elements and recurse downwards. |
| 1961 for (const auto& viewportConstrainedObject : *m_viewportConstrainedObjects) { | 1963 for (const auto& viewportConstrainedObject : *m_viewportConstrainedObjects) { |
| 1962 LayoutObject* layoutObject = viewportConstrainedObject; | 1964 LayoutObject* layoutObject = viewportConstrainedObject; |
| 1963 PaintLayer* layer = toLayoutBoxModelObject(layoutObject)->layer(); | 1965 PaintLayer* layer = toLayoutBoxModelObject(layoutObject)->layer(); |
| 1964 if (layoutObject->style()->position() == EPosition::kSticky) { | 1966 StickyConstraintsMap constraintsMap = layer->ancestorOverflowLayer() |
| 1967 ->getScrollableArea() |
| 1968 ->stickyConstraintsMap(); |
| 1969 if (layoutObject->style()->position() == EPosition::kSticky && |
| 1970 constraintsMap.contains(layer) && |
| 1971 !constraintsMap.get(layer).hasAncestorStickyElement()) { |
| 1965 // TODO(skobes): Resolve circular dependency between scroll offset and | 1972 // TODO(skobes): Resolve circular dependency between scroll offset and |
| 1966 // compositing state, and remove this disabler. https://crbug.com/420741 | 1973 // compositing state, and remove this disabler. https://crbug.com/420741 |
| 1967 DisableCompositingQueryAsserts disabler; | 1974 DisableCompositingQueryAsserts disabler; |
| 1968 layer->updateLayerPositionsAfterOverflowScroll(); | 1975 layer->updateLayerPositionsAfterOverflowScroll(); |
| 1969 layoutObject->setMayNeedPaintInvalidationSubtree(); | 1976 layoutObject->setMayNeedPaintInvalidationSubtree(); |
| 1970 } | 1977 } |
| 1971 } | 1978 } |
| 1972 | 1979 |
| 1973 // If there fixed position elements, scrolling may cause compositing layers to | 1980 // If there fixed position elements, scrolling may cause compositing layers to |
| 1974 // change. Update widget and layer positions after scrolling, but only if | 1981 // change. Update widget and layer positions after scrolling, but only if |
| (...skipping 3208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5183 void FrameView::setAnimationHost( | 5190 void FrameView::setAnimationHost( |
| 5184 std::unique_ptr<CompositorAnimationHost> host) { | 5191 std::unique_ptr<CompositorAnimationHost> host) { |
| 5185 m_animationHost = std::move(host); | 5192 m_animationHost = std::move(host); |
| 5186 } | 5193 } |
| 5187 | 5194 |
| 5188 LayoutUnit FrameView::caretWidth() const { | 5195 LayoutUnit FrameView::caretWidth() const { |
| 5189 return LayoutUnit(getHostWindow()->windowToViewportScalar(1)); | 5196 return LayoutUnit(getHostWindow()->windowToViewportScalar(1)); |
| 5190 } | 5197 } |
| 5191 | 5198 |
| 5192 } // namespace blink | 5199 } // namespace blink |
| OLD | NEW |