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

Side by Side Diff: third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp

Issue 1308273010: Adapt and reland old position sticky implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Merge with master (removing horizontal-bt test) Created 5 years 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) 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after
977 #endif 977 #endif
978 978
979 bool ScrollingCoordinator::hasVisibleSlowRepaintViewportConstrainedObjects(Frame View* frameView) const 979 bool ScrollingCoordinator::hasVisibleSlowRepaintViewportConstrainedObjects(Frame View* frameView) const
980 { 980 {
981 const FrameView::ViewportConstrainedObjectSet* viewportConstrainedObjects = frameView->viewportConstrainedObjects(); 981 const FrameView::ViewportConstrainedObjectSet* viewportConstrainedObjects = frameView->viewportConstrainedObjects();
982 if (!viewportConstrainedObjects) 982 if (!viewportConstrainedObjects)
983 return false; 983 return false;
984 984
985 for (const LayoutObject* layoutObject : *viewportConstrainedObjects) { 985 for (const LayoutObject* layoutObject : *viewportConstrainedObjects) {
986 ASSERT(layoutObject->isBoxModelObject() && layoutObject->hasLayer()); 986 ASSERT(layoutObject->isBoxModelObject() && layoutObject->hasLayer());
987 ASSERT(layoutObject->style()->position() == FixedPosition); 987 ASSERT(layoutObject->style()->position() == FixedPosition
988 || layoutObject->style()->position() == StickyPosition);
988 PaintLayer* layer = toLayoutBoxModelObject(layoutObject)->layer(); 989 PaintLayer* layer = toLayoutBoxModelObject(layoutObject)->layer();
989 990
990 // Whether the Layer scrolls with the viewport is a tree-depenent 991 // Whether the Layer scrolls with the viewport is a tree-depenent
991 // property and our viewportConstrainedObjects collection is maintained 992 // property and our viewportConstrainedObjects collection is maintained
992 // with only LayoutObject-level information. 993 // with only LayoutObject-level information.
993 if (!layer->scrollsWithViewport()) 994 if (!layer->scrollsWithViewport())
994 continue; 995 continue;
995 996
996 // If the whole subtree is invisible, there's no reason to scroll on 997 // If the whole subtree is invisible, there's no reason to scroll on
997 // the main thread because we don't need to generate invalidations 998 // the main thread because we don't need to generate invalidations
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
1091 { 1092 {
1092 if (m_programmaticScrollAnimatorTimeline) { 1093 if (m_programmaticScrollAnimatorTimeline) {
1093 ASSERT(m_page); 1094 ASSERT(m_page);
1094 ASSERT(m_page->mainFrame()->isLocalFrame()); 1095 ASSERT(m_page->mainFrame()->isLocalFrame());
1095 m_page->chromeClient().detachCompositorAnimationTimeline(m_programmaticS crollAnimatorTimeline.get(), toLocalFrame(m_page->mainFrame())); 1096 m_page->chromeClient().detachCompositorAnimationTimeline(m_programmaticS crollAnimatorTimeline.get(), toLocalFrame(m_page->mainFrame()));
1096 m_programmaticScrollAnimatorTimeline.clear(); 1097 m_programmaticScrollAnimatorTimeline.clear();
1097 } 1098 }
1098 } 1099 }
1099 1100
1100 } // namespace blink 1101 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698