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 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1030 // calculations below. | 1030 // calculations below. |
1031 if (toLocalFrame(frame)->localFrameRoot() != m_page->mainFrame()) | 1031 if (toLocalFrame(frame)->localFrameRoot() != m_page->mainFrame()) |
1032 continue; | 1032 continue; |
1033 | 1033 |
1034 FrameView* frameView = toLocalFrame(frame)->view(); | 1034 FrameView* frameView = toLocalFrame(frame)->view(); |
1035 if (!frameView || frameView->shouldThrottleRendering()) | 1035 if (!frameView || frameView->shouldThrottleRendering()) |
1036 continue; | 1036 continue; |
1037 | 1037 |
1038 if (frameView->hasBackgroundAttachmentFixedObjects()) | 1038 if (frameView->hasBackgroundAttachmentFixedObjects()) |
1039 reasons |= MainThreadScrollingReason::kHasBackgroundAttachmentFixedO
bjects; | 1039 reasons |= MainThreadScrollingReason::kHasBackgroundAttachmentFixedO
bjects; |
1040 if (frameView->hasStickyPositionObjects()) | |
1041 reasons |= MainThreadScrollingReason::kHasStickyPositionObjects; | |
1042 FrameView::ScrollingReasons scrollingReasons = frameView->getScrollingRe
asons(); | 1040 FrameView::ScrollingReasons scrollingReasons = frameView->getScrollingRe
asons(); |
1043 const bool mayBeScrolledByInput = (scrollingReasons == FrameView::Scroll
able); | 1041 const bool mayBeScrolledByInput = (scrollingReasons == FrameView::Scroll
able); |
1044 const bool mayBeScrolledByScript = mayBeScrolledByInput || (scrollingRea
sons == | 1042 const bool mayBeScrolledByScript = mayBeScrolledByInput || (scrollingRea
sons == |
1045 FrameView::NotScrollableExplicitlyDisabled); | 1043 FrameView::NotScrollableExplicitlyDisabled); |
1046 | 1044 |
1047 // TODO(awoloszyn) Currently crbug.com/304810 will let certain | 1045 // TODO(awoloszyn) Currently crbug.com/304810 will let certain |
1048 // overflow:hidden elements scroll on the compositor thread, so we shoul
d | 1046 // overflow:hidden elements scroll on the compositor thread, so we shoul
d |
1049 // not let this move there path as an optimization, when we have slow-re
paint | 1047 // not let this move there path as an optimization, when we have slow-re
paint |
1050 // elements. | 1048 // elements. |
1051 if (mayBeScrolledByScript && hasVisibleSlowRepaintViewportConstrainedObj
ects(frameView)) { | 1049 if (mayBeScrolledByScript && hasVisibleSlowRepaintViewportConstrainedObj
ects(frameView)) { |
(...skipping 22 matching lines...) Expand all Loading... |
1074 bool frameIsScrollable = frameView && frameView->isScrollable(); | 1072 bool frameIsScrollable = frameView && frameView->isScrollable(); |
1075 if (frameIsScrollable != m_wasFrameScrollable) | 1073 if (frameIsScrollable != m_wasFrameScrollable) |
1076 return true; | 1074 return true; |
1077 | 1075 |
1078 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll
ing()) : nullptr) | 1076 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll
ing()) : nullptr) |
1079 return WebSize(frameView->contentsSize()) != scrollLayer->bounds(); | 1077 return WebSize(frameView->contentsSize()) != scrollLayer->bounds(); |
1080 return false; | 1078 return false; |
1081 } | 1079 } |
1082 | 1080 |
1083 } // namespace blink | 1081 } // namespace blink |
OLD | NEW |