| 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 bool frameIsScrollable = frameView && frameView->isScrollable(); | 144 bool frameIsScrollable = frameView && frameView->isScrollable(); |
| 145 if (m_shouldScrollOnMainThreadDirty || m_wasFrameScrollable != frameIsScroll
able) { | 145 if (m_shouldScrollOnMainThreadDirty || m_wasFrameScrollable != frameIsScroll
able) { |
| 146 setShouldUpdateScrollLayerPositionOnMainThread(mainThreadScrollingReason
s()); | 146 setShouldUpdateScrollLayerPositionOnMainThread(mainThreadScrollingReason
s()); |
| 147 m_shouldScrollOnMainThreadDirty = false; | 147 m_shouldScrollOnMainThreadDirty = false; |
| 148 } | 148 } |
| 149 m_wasFrameScrollable = frameIsScrollable; | 149 m_wasFrameScrollable = frameIsScrollable; |
| 150 | 150 |
| 151 // The mainFrame view doesn't get included in the FrameTree below, so we | 151 // The mainFrame view doesn't get included in the FrameTree below, so we |
| 152 // update its size separately. | 152 // update its size separately. |
| 153 if (WebLayer* scrollingWebLayer = frameView ? toWebLayer(frameView->layerFor
Scrolling()) : 0) { | 153 if (WebLayer* scrollingWebLayer = frameView ? toWebLayer(frameView->layerFor
Scrolling()) : 0) { |
| 154 scrollingWebLayer->setBounds(frameView->contentsSize()); | 154 scrollingWebLayer->setBounds(frameView->size()); |
| 155 scrollingWebLayer->setScrollClipLayer(toWebLayer(frameView->layerForCont
ainer())); | |
| 156 } | 155 } |
| 157 } | 156 } |
| 158 | 157 |
| 159 void ScrollingCoordinator::setLayerIsContainerForFixedPositionLayers(GraphicsLay
er* layer, bool enable) | 158 void ScrollingCoordinator::setLayerIsContainerForFixedPositionLayers(GraphicsLay
er* layer, bool enable) |
| 160 { | 159 { |
| 161 if (WebLayer* scrollableLayer = toWebLayer(layer)) | 160 if (WebLayer* scrollableLayer = toWebLayer(layer)) |
| 162 scrollableLayer->setIsContainerForFixedPositionLayers(enable); | 161 scrollableLayer->setIsContainerForFixedPositionLayers(enable); |
| 163 } | 162 } |
| 164 | 163 |
| 165 static void clearPositionConstraintExceptForLayer(GraphicsLayer* layer, Graphics
Layer* except) | 164 static void clearPositionConstraintExceptForLayer(GraphicsLayer* layer, Graphics
Layer* except) |
| (...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 750 ASSERT(m_page); | 749 ASSERT(m_page); |
| 751 | 750 |
| 752 if (!coordinatesScrollingForFrameView(frameView)) | 751 if (!coordinatesScrollingForFrameView(frameView)) |
| 753 return; | 752 return; |
| 754 | 753 |
| 755 m_shouldScrollOnMainThreadDirty = true; | 754 m_shouldScrollOnMainThreadDirty = true; |
| 756 } | 755 } |
| 757 | 756 |
| 758 bool ScrollingCoordinator::isForMainFrame(ScrollableArea* scrollableArea) const | 757 bool ScrollingCoordinator::isForMainFrame(ScrollableArea* scrollableArea) const |
| 759 { | 758 { |
| 760 return scrollableArea == m_page->mainFrame()->view(); | 759 // FIXME(sky): Remove |
| 760 return false; |
| 761 } | 761 } |
| 762 | 762 |
| 763 void ScrollingCoordinator::frameViewRootLayerDidChange(FrameView* frameView) | 763 void ScrollingCoordinator::frameViewRootLayerDidChange(FrameView* frameView) |
| 764 { | 764 { |
| 765 ASSERT(isMainThread()); | 765 ASSERT(isMainThread()); |
| 766 ASSERT(m_page); | 766 ASSERT(m_page); |
| 767 | 767 |
| 768 if (!coordinatesScrollingForFrameView(frameView)) | 768 if (!coordinatesScrollingForFrameView(frameView)) |
| 769 return; | 769 return; |
| 770 | 770 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 851 } | 851 } |
| 852 | 852 |
| 853 String ScrollingCoordinator::mainThreadScrollingReasonsAsText() const | 853 String ScrollingCoordinator::mainThreadScrollingReasonsAsText() const |
| 854 { | 854 { |
| 855 ASSERT(m_page->mainFrame()->document()->lifecycle().state() >= DocumentLifec
ycle::CompositingClean); | 855 ASSERT(m_page->mainFrame()->document()->lifecycle().state() >= DocumentLifec
ycle::CompositingClean); |
| 856 return mainThreadScrollingReasonsAsText(m_lastMainThreadScrollingReasons); | 856 return mainThreadScrollingReasonsAsText(m_lastMainThreadScrollingReasons); |
| 857 } | 857 } |
| 858 | 858 |
| 859 bool ScrollingCoordinator::frameViewIsDirty() const | 859 bool ScrollingCoordinator::frameViewIsDirty() const |
| 860 { | 860 { |
| 861 FrameView* frameView = m_page->mainFrame()->view(); | 861 // FIXME(sky): Remove |
| 862 bool frameIsScrollable = frameView && frameView->isScrollable(); | |
| 863 if (frameIsScrollable != m_wasFrameScrollable) | |
| 864 return true; | |
| 865 | |
| 866 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll
ing()) : 0) | |
| 867 return blink::WebSize(frameView->contentsSize()) != scrollLayer->bounds(
); | |
| 868 return false; | 862 return false; |
| 869 } | 863 } |
| 870 | 864 |
| 871 } // namespace blink | 865 } // namespace blink |
| OLD | NEW |