OLD | NEW |
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 981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
992 #endif | 992 #endif |
993 | 993 |
994 bool ScrollingCoordinator::hasVisibleSlowRepaintViewportConstrainedObjects(Frame
View* frameView) const | 994 bool ScrollingCoordinator::hasVisibleSlowRepaintViewportConstrainedObjects(Frame
View* frameView) const |
995 { | 995 { |
996 const FrameView::ViewportConstrainedObjectSet* viewportConstrainedObjects =
frameView->viewportConstrainedObjects(); | 996 const FrameView::ViewportConstrainedObjectSet* viewportConstrainedObjects =
frameView->viewportConstrainedObjects(); |
997 if (!viewportConstrainedObjects) | 997 if (!viewportConstrainedObjects) |
998 return false; | 998 return false; |
999 | 999 |
1000 for (const LayoutObject* layoutObject : *viewportConstrainedObjects) { | 1000 for (const LayoutObject* layoutObject : *viewportConstrainedObjects) { |
1001 ASSERT(layoutObject->isBoxModelObject() && layoutObject->hasLayer()); | 1001 ASSERT(layoutObject->isBoxModelObject() && layoutObject->hasLayer()); |
1002 ASSERT(layoutObject->style()->position() == FixedPosition); | 1002 ASSERT(layoutObject->style()->position() == FixedPosition |
| 1003 || layoutObject->style()->position() == StickyPosition); |
1003 DeprecatedPaintLayer* layer = toLayoutBoxModelObject(layoutObject)->laye
r(); | 1004 DeprecatedPaintLayer* layer = toLayoutBoxModelObject(layoutObject)->laye
r(); |
1004 | 1005 |
1005 // Whether the Layer scrolls with the viewport is a tree-depenent | 1006 // Whether the Layer scrolls with the viewport is a tree-depenent |
1006 // property and our viewportConstrainedObjects collection is maintained | 1007 // property and our viewportConstrainedObjects collection is maintained |
1007 // with only LayoutObject-level information. | 1008 // with only LayoutObject-level information. |
1008 if (!layer->scrollsWithViewport()) | 1009 if (!layer->scrollsWithViewport()) |
1009 continue; | 1010 continue; |
1010 | 1011 |
1011 // If the whole subtree is invisible, there's no reason to scroll on | 1012 // If the whole subtree is invisible, there's no reason to scroll on |
1012 // the main thread because we don't need to generate invalidations | 1013 // the main thread because we don't need to generate invalidations |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1084 bool frameIsScrollable = frameView && frameView->isScrollable(); | 1085 bool frameIsScrollable = frameView && frameView->isScrollable(); |
1085 if (frameIsScrollable != m_wasFrameScrollable) | 1086 if (frameIsScrollable != m_wasFrameScrollable) |
1086 return true; | 1087 return true; |
1087 | 1088 |
1088 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll
ing()) : nullptr) | 1089 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll
ing()) : nullptr) |
1089 return WebSize(frameView->contentsSize()) != scrollLayer->bounds(); | 1090 return WebSize(frameView->contentsSize()) != scrollLayer->bounds(); |
1090 return false; | 1091 return false; |
1091 } | 1092 } |
1092 | 1093 |
1093 } // namespace blink | 1094 } // namespace blink |
OLD | NEW |