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 928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
939 reasons |= ThreadedScrollingDisabled; | 939 reasons |= ThreadedScrollingDisabled; |
940 | 940 |
941 if (!m_page->mainFrame()->isLocalFrame()) | 941 if (!m_page->mainFrame()->isLocalFrame()) |
942 return reasons; | 942 return reasons; |
943 FrameView* frameView = m_page->deprecatedLocalMainFrame()->view(); | 943 FrameView* frameView = m_page->deprecatedLocalMainFrame()->view(); |
944 if (!frameView) | 944 if (!frameView) |
945 return reasons; | 945 return reasons; |
946 | 946 |
947 if (frameView->hasSlowRepaintObjects()) | 947 if (frameView->hasSlowRepaintObjects()) |
948 reasons |= HasSlowRepaintObjects; | 948 reasons |= HasSlowRepaintObjects; |
949 if (frameView->isScrollable() && hasVisibleSlowRepaintViewportConstrainedObj ects(frameView)) | 949 FrameView::ScrollingReasons scrollingReasons = frameView->scrollingReasons() ; |
950 const bool mayBeScrolledByInput = (scrollingReasons == FrameView::Scrollable ); | |
951 const bool mayBeScrolledByScript = (scrollingReasons == | |
skobes
2014/11/05 21:05:22
Anything scrollable by input is also scrollable by
awoloszyn
2014/11/05 21:33:43
Done.
| |
952 FrameView::NotScrollableExplicitlyDisabled); | |
953 const bool canScroll = mayBeScrolledByInput || mayBeScrolledByScript; | |
954 // TODO(awoloszyn) Currently crbug.com/304810 will let certain | |
955 // overflow:hidden elements scroll on the fast path, so we should not let | |
skobes
2014/11/05 21:05:22
Nit: I think this comment should say "...scroll on
awoloszyn
2014/11/05 21:33:43
Done.
| |
956 // this move to the fast-path as an optimization, when we have slow-repaint | |
957 // elements. | |
958 if (canScroll && hasVisibleSlowRepaintViewportConstrainedObjects(frameView)) { | |
950 reasons |= HasNonLayerViewportConstrainedObjects; | 959 reasons |= HasNonLayerViewportConstrainedObjects; |
960 } | |
951 | 961 |
952 return reasons; | 962 return reasons; |
953 } | 963 } |
954 | 964 |
955 String ScrollingCoordinator::mainThreadScrollingReasonsAsText(MainThreadScrollin gReasons reasons) | 965 String ScrollingCoordinator::mainThreadScrollingReasonsAsText(MainThreadScrollin gReasons reasons) |
956 { | 966 { |
957 StringBuilder stringBuilder; | 967 StringBuilder stringBuilder; |
958 | 968 |
959 if (reasons & ScrollingCoordinator::HasSlowRepaintObjects) | 969 if (reasons & ScrollingCoordinator::HasSlowRepaintObjects) |
960 stringBuilder.appendLiteral("Has slow repaint objects, "); | 970 stringBuilder.appendLiteral("Has slow repaint objects, "); |
(...skipping 21 matching lines...) Expand all Loading... | |
982 bool frameIsScrollable = frameView && frameView->isScrollable(); | 992 bool frameIsScrollable = frameView && frameView->isScrollable(); |
983 if (frameIsScrollable != m_wasFrameScrollable) | 993 if (frameIsScrollable != m_wasFrameScrollable) |
984 return true; | 994 return true; |
985 | 995 |
986 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll ing()) : nullptr) | 996 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll ing()) : nullptr) |
987 return blink::WebSize(frameView->contentsSize()) != scrollLayer->bounds( ); | 997 return blink::WebSize(frameView->contentsSize()) != scrollLayer->bounds( ); |
988 return false; | 998 return false; |
989 } | 999 } |
990 | 1000 |
991 } // namespace blink | 1001 } // namespace blink |
OLD | NEW |