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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 Region shouldHandleScrollGestureOnMainThreadRegion = computeShouldHandle
ScrollGestureOnMainThreadRegion(m_page->mainFrame(), IntPoint()); | 145 Region shouldHandleScrollGestureOnMainThreadRegion = computeShouldHandle
ScrollGestureOnMainThreadRegion(m_page->mainFrame(), IntPoint()); |
146 setShouldHandleScrollGestureOnMainThreadRegion(shouldHandleScrollGesture
OnMainThreadRegion); | 146 setShouldHandleScrollGestureOnMainThreadRegion(shouldHandleScrollGesture
OnMainThreadRegion); |
147 m_scrollGestureRegionIsDirty = false; | 147 m_scrollGestureRegionIsDirty = false; |
148 } | 148 } |
149 | 149 |
150 if (m_touchEventTargetRectsAreDirty) { | 150 if (m_touchEventTargetRectsAreDirty) { |
151 updateTouchEventTargetRectsIfNeeded(); | 151 updateTouchEventTargetRectsIfNeeded(); |
152 m_touchEventTargetRectsAreDirty = false; | 152 m_touchEventTargetRectsAreDirty = false; |
153 } | 153 } |
154 | 154 |
155 FrameView* frameView = m_page->mainFrame()->view(); | 155 if (frameViewIsScrollableIsDirty()) |
156 bool frameIsScrollable = frameView && frameView->isScrollable(); | |
157 if (m_wasFrameScrollable != frameIsScrollable) | |
158 updateShouldUpdateScrollLayerPositionOnMainThread(); | 156 updateShouldUpdateScrollLayerPositionOnMainThread(); |
159 m_wasFrameScrollable = frameIsScrollable; | 157 |
| 158 updateMainFrameIsScrollable(); |
160 | 159 |
161 const FrameTree& tree = m_page->mainFrame()->tree(); | 160 const FrameTree& tree = m_page->mainFrame()->tree(); |
162 for (const Frame* child = tree.firstChild(); child; child = child->tree().ne
xtSibling()) { | 161 for (const Frame* child = tree.firstChild(); child; child = child->tree().ne
xtSibling()) { |
163 if (WebLayer* scrollLayer = scrollingWebLayerForScrollableArea(child->vi
ew())) | 162 if (WebLayer* scrollLayer = scrollingWebLayerForScrollableArea(child->vi
ew())) |
164 scrollLayer->setBounds(child->view()->contentsSize()); | 163 scrollLayer->setBounds(child->view()->contentsSize()); |
165 } | 164 } |
166 } | 165 } |
167 | 166 |
168 void ScrollingCoordinator::setLayerIsContainerForFixedPositionLayers(GraphicsLay
er* layer, bool enable) | 167 void ScrollingCoordinator::setLayerIsContainerForFixedPositionLayers(GraphicsLay
er* layer, bool enable) |
169 { | 168 { |
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
922 return mainThreadScrollingReasonsAsText(m_lastMainThreadScrollingReasons); | 921 return mainThreadScrollingReasonsAsText(m_lastMainThreadScrollingReasons); |
923 } | 922 } |
924 | 923 |
925 bool ScrollingCoordinator::frameViewIsScrollableIsDirty() const | 924 bool ScrollingCoordinator::frameViewIsScrollableIsDirty() const |
926 { | 925 { |
927 FrameView* frameView = m_page->mainFrame()->view(); | 926 FrameView* frameView = m_page->mainFrame()->view(); |
928 bool frameIsScrollable = frameView && frameView->isScrollable(); | 927 bool frameIsScrollable = frameView && frameView->isScrollable(); |
929 return frameIsScrollable != m_wasFrameScrollable; | 928 return frameIsScrollable != m_wasFrameScrollable; |
930 } | 929 } |
931 | 930 |
| 931 void ScrollingCoordinator::updateMainFrameIsScrollable() |
| 932 { |
| 933 FrameView* frameView = m_page->mainFrame()->view(); |
| 934 bool frameIsScrollable = frameView && frameView->isScrollable(); |
| 935 m_wasFrameScrollable = frameIsScrollable; |
| 936 |
| 937 if (!frameView) |
| 938 return; |
| 939 |
| 940 if (WebLayer* scrollingWebLayer = scrollingWebLayerForScrollableArea(frameVi
ew)) |
| 941 scrollingWebLayer->setScrollable(frameIsScrollable); |
| 942 } |
| 943 |
932 } // namespace WebCore | 944 } // namespace WebCore |
OLD | NEW |