Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(533)

Side by Side Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 2667493002: Changed EPosition to an enum class and renamed its members (Closed)
Patch Set: Rebase Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1936 matching lines...) Expand 10 before | Expand all | Expand 10 after
1947 1947
1948 void FrameView::updateLayersAndCompositingAfterScrollIfNeeded() { 1948 void FrameView::updateLayersAndCompositingAfterScrollIfNeeded() {
1949 // Nothing to do after scrolling if there are no fixed position elements. 1949 // Nothing to do after scrolling if there are no fixed position elements.
1950 if (!hasViewportConstrainedObjects()) 1950 if (!hasViewportConstrainedObjects())
1951 return; 1951 return;
1952 1952
1953 // Update sticky position objects which are stuck to the viewport. 1953 // Update sticky position objects which are stuck to the viewport.
1954 for (const auto& viewportConstrainedObject : *m_viewportConstrainedObjects) { 1954 for (const auto& viewportConstrainedObject : *m_viewportConstrainedObjects) {
1955 LayoutObject* layoutObject = viewportConstrainedObject; 1955 LayoutObject* layoutObject = viewportConstrainedObject;
1956 PaintLayer* layer = toLayoutBoxModelObject(layoutObject)->layer(); 1956 PaintLayer* layer = toLayoutBoxModelObject(layoutObject)->layer();
1957 if (layoutObject->style()->position() == StickyPosition) { 1957 if (layoutObject->style()->position() == EPosition::kSticky) {
1958 // TODO(skobes): Resolve circular dependency between scroll offset and 1958 // TODO(skobes): Resolve circular dependency between scroll offset and
1959 // compositing state, and remove this disabler. https://crbug.com/420741 1959 // compositing state, and remove this disabler. https://crbug.com/420741
1960 DisableCompositingQueryAsserts disabler; 1960 DisableCompositingQueryAsserts disabler;
1961 layer->updateLayerPositionsAfterOverflowScroll(); 1961 layer->updateLayerPositionsAfterOverflowScroll();
1962 layoutObject->setMayNeedPaintInvalidationSubtree(); 1962 layoutObject->setMayNeedPaintInvalidationSubtree();
1963 } 1963 }
1964 } 1964 }
1965 1965
1966 // If there fixed position elements, scrolling may cause compositing layers to 1966 // If there fixed position elements, scrolling may cause compositing layers to
1967 // change. Update widget and layer positions after scrolling, but only if 1967 // change. Update widget and layer positions after scrolling, but only if
(...skipping 2945 matching lines...) Expand 10 before | Expand all | Expand 10 after
4913 DCHECK(m_frame->isMainFrame()); 4913 DCHECK(m_frame->isMainFrame());
4914 return m_initialViewportSize.height(); 4914 return m_initialViewportSize.height();
4915 } 4915 }
4916 4916
4917 bool FrameView::hasVisibleSlowRepaintViewportConstrainedObjects() const { 4917 bool FrameView::hasVisibleSlowRepaintViewportConstrainedObjects() const {
4918 if (!viewportConstrainedObjects()) 4918 if (!viewportConstrainedObjects())
4919 return false; 4919 return false;
4920 4920
4921 for (const LayoutObject* layoutObject : *viewportConstrainedObjects()) { 4921 for (const LayoutObject* layoutObject : *viewportConstrainedObjects()) {
4922 DCHECK(layoutObject->isBoxModelObject() && layoutObject->hasLayer()); 4922 DCHECK(layoutObject->isBoxModelObject() && layoutObject->hasLayer());
4923 DCHECK(layoutObject->style()->position() == FixedPosition || 4923 DCHECK(layoutObject->style()->position() == EPosition::kFixed ||
4924 layoutObject->style()->position() == StickyPosition); 4924 layoutObject->style()->position() == EPosition::kSticky);
4925 PaintLayer* layer = toLayoutBoxModelObject(layoutObject)->layer(); 4925 PaintLayer* layer = toLayoutBoxModelObject(layoutObject)->layer();
4926 4926
4927 // Whether the Layer sticks to the viewport is a tree-depenent 4927 // Whether the Layer sticks to the viewport is a tree-depenent
4928 // property and our viewportConstrainedObjects collection is maintained 4928 // property and our viewportConstrainedObjects collection is maintained
4929 // with only LayoutObject-level information. 4929 // with only LayoutObject-level information.
4930 if (!layer->sticksToViewport()) 4930 if (!layer->sticksToViewport())
4931 continue; 4931 continue;
4932 4932
4933 // If the whole subtree is invisible, there's no reason to scroll on 4933 // If the whole subtree is invisible, there's no reason to scroll on
4934 // the main thread because we don't need to generate invalidations 4934 // the main thread because we don't need to generate invalidations
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
5168 std::unique_ptr<CompositorAnimationTimeline> timeline) { 5168 std::unique_ptr<CompositorAnimationTimeline> timeline) {
5169 m_animationTimeline = std::move(timeline); 5169 m_animationTimeline = std::move(timeline);
5170 } 5170 }
5171 5171
5172 void FrameView::setAnimationHost( 5172 void FrameView::setAnimationHost(
5173 std::unique_ptr<CompositorAnimationHost> host) { 5173 std::unique_ptr<CompositorAnimationHost> host) {
5174 m_animationHost = std::move(host); 5174 m_animationHost = std::move(host);
5175 } 5175 }
5176 5176
5177 } // namespace blink 5177 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698