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 1893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1904 ASSERT(!layoutSizeFixedToFrameSize()); | 1904 ASSERT(!layoutSizeFixedToFrameSize()); |
1905 | 1905 |
1906 setLayoutSizeInternal(size); | 1906 setLayoutSizeInternal(size); |
1907 } | 1907 } |
1908 | 1908 |
1909 void FrameView::didScrollTimerFired(TimerBase*) { | 1909 void FrameView::didScrollTimerFired(TimerBase*) { |
1910 if (m_frame->document() && !m_frame->document()->layoutViewItem().isNull()) | 1910 if (m_frame->document() && !m_frame->document()->layoutViewItem().isNull()) |
1911 m_frame->document()->fetcher()->updateAllImageResourcePriorities(); | 1911 m_frame->document()->fetcher()->updateAllImageResourcePriorities(); |
1912 } | 1912 } |
1913 | 1913 |
1914 void FrameView::updateLayersAndCompositingAfterScrollIfNeeded( | 1914 void FrameView::updateLayersAndCompositingAfterScrollIfNeeded() { |
1915 const ScrollOffset& scrollDelta) { | |
1916 // Nothing to do after scrolling if there are no fixed position elements. | 1915 // Nothing to do after scrolling if there are no fixed position elements. |
1917 if (!hasViewportConstrainedObjects()) | 1916 if (!hasViewportConstrainedObjects()) |
1918 return; | 1917 return; |
1919 | 1918 |
1920 // Update sticky position objects which are stuck to the viewport. | 1919 // Update sticky position objects which are stuck to the viewport. |
1921 for (const auto& viewportConstrainedObject : *m_viewportConstrainedObjects) { | 1920 for (const auto& viewportConstrainedObject : *m_viewportConstrainedObjects) { |
1922 LayoutObject* layoutObject = viewportConstrainedObject; | 1921 LayoutObject* layoutObject = viewportConstrainedObject; |
1923 PaintLayer* layer = toLayoutBoxModelObject(layoutObject)->layer(); | 1922 PaintLayer* layer = toLayoutBoxModelObject(layoutObject)->layer(); |
1924 if (layoutObject->style()->position() == StickyPosition) { | 1923 if (layoutObject->style()->position() == StickyPosition) { |
1925 // TODO(skobes): Resolve circular dependency between scroll offset and | 1924 // TODO(skobes): Resolve circular dependency between scroll offset and |
1926 // compositing state, and remove this disabler. https://crbug.com/420741 | 1925 // compositing state, and remove this disabler. https://crbug.com/420741 |
1927 DisableCompositingQueryAsserts disabler; | 1926 DisableCompositingQueryAsserts disabler; |
1928 layer->updateLayerPositionsAfterOverflowScroll(scrollDelta); | 1927 layer->updateLayerPositionsAfterOverflowScroll(); |
| 1928 layoutObject->setMayNeedPaintInvalidationSubtree(); |
1929 } | 1929 } |
1930 } | 1930 } |
1931 | 1931 |
1932 // If there fixed position elements, scrolling may cause compositing layers to | 1932 // If there fixed position elements, scrolling may cause compositing layers to |
1933 // change. Update widget and layer positions after scrolling, but only if | 1933 // change. Update widget and layer positions after scrolling, but only if |
1934 // we're not inside of layout. | 1934 // we're not inside of layout. |
1935 if (!m_nestedLayoutCount) { | 1935 if (!m_nestedLayoutCount) { |
1936 updateWidgetGeometries(); | 1936 updateWidgetGeometries(); |
1937 LayoutViewItem layoutViewItem = this->layoutViewItem(); | 1937 LayoutViewItem layoutViewItem = this->layoutViewItem(); |
1938 if (!layoutViewItem.isNull()) | 1938 if (!layoutViewItem.isNull()) |
(...skipping 1858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3797 ASSERT_NOT_REACHED(); | 3797 ASSERT_NOT_REACHED(); |
3798 } | 3798 } |
3799 | 3799 |
3800 m_scrollOffset = offset; | 3800 m_scrollOffset = offset; |
3801 | 3801 |
3802 if (!scrollbarsSuppressed()) | 3802 if (!scrollbarsSuppressed()) |
3803 m_pendingScrollDelta += scrollDelta; | 3803 m_pendingScrollDelta += scrollDelta; |
3804 | 3804 |
3805 if (scrollTypeClearsFragmentAnchor(scrollType)) | 3805 if (scrollTypeClearsFragmentAnchor(scrollType)) |
3806 clearFragmentAnchor(); | 3806 clearFragmentAnchor(); |
3807 updateLayersAndCompositingAfterScrollIfNeeded(scrollDelta); | 3807 updateLayersAndCompositingAfterScrollIfNeeded(); |
3808 | 3808 |
3809 Document* document = m_frame->document(); | 3809 Document* document = m_frame->document(); |
3810 document->enqueueScrollEventForNode(document); | 3810 document->enqueueScrollEventForNode(document); |
3811 | 3811 |
3812 m_frame->eventHandler().dispatchFakeMouseMoveEventSoon(); | 3812 m_frame->eventHandler().dispatchFakeMouseMoveEventSoon(); |
3813 Page* page = frame().page(); | 3813 Page* page = frame().page(); |
3814 if (page) | 3814 if (page) |
3815 page->chromeClient().clearToolTip(*m_frame); | 3815 page->chromeClient().clearToolTip(*m_frame); |
3816 | 3816 |
3817 LayoutViewItem layoutViewItem = document->layoutViewItem(); | 3817 LayoutViewItem layoutViewItem = document->layoutViewItem(); |
(...skipping 1075 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4893 reason < MainThreadScrollingReason::kMainThreadScrollingReasonCount; | 4893 reason < MainThreadScrollingReason::kMainThreadScrollingReasonCount; |
4894 ++reason) { | 4894 ++reason) { |
4895 if (m_mainThreadScrollingReasonsCounter[reason] > 0) { | 4895 if (m_mainThreadScrollingReasonsCounter[reason] > 0) { |
4896 reasons |= 1 << (reason - 1); | 4896 reasons |= 1 << (reason - 1); |
4897 } | 4897 } |
4898 } | 4898 } |
4899 return reasons; | 4899 return reasons; |
4900 } | 4900 } |
4901 | 4901 |
4902 } // namespace blink | 4902 } // namespace blink |
OLD | NEW |