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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 // Composited layers that inherit a fixed position state will be positio
ned with respect to the nearest compositedLayerMapping's GraphicsLayer. | 205 // Composited layers that inherit a fixed position state will be positio
ned with respect to the nearest compositedLayerMapping's GraphicsLayer. |
206 // So, once we find a layer that has its own compositedLayerMapping, we
can stop searching for a fixed position RenderObject. | 206 // So, once we find a layer that has its own compositedLayerMapping, we
can stop searching for a fixed position RenderObject. |
207 } while (layer && !layer->hasCompositedLayerMapping()); | 207 } while (layer && !layer->hasCompositedLayerMapping()); |
208 return WebLayerPositionConstraint(); | 208 return WebLayerPositionConstraint(); |
209 } | 209 } |
210 | 210 |
211 void ScrollingCoordinator::updateLayerPositionConstraint(RenderLayer* layer) | 211 void ScrollingCoordinator::updateLayerPositionConstraint(RenderLayer* layer) |
212 { | 212 { |
213 ASSERT(layer->hasCompositedLayerMapping()); | 213 ASSERT(layer->hasCompositedLayerMapping()); |
214 CompositedLayerMapping* compositedLayerMapping = layer->compositedLayerMappi
ng(); | 214 CompositedLayerMapping* compositedLayerMapping = layer->compositedLayerMappi
ng(); |
215 GraphicsLayer* mainLayer = compositedLayerMapping->localRootForOwningLayer()
; | 215 GraphicsLayer* mainLayer = compositedLayerMapping->childForSuperlayers(); |
216 | 216 |
217 // Avoid unnecessary commits | 217 // Avoid unnecessary commits |
| 218 clearPositionConstraintExceptForLayer(compositedLayerMapping->squashingConta
inmentLayer(), mainLayer); |
218 clearPositionConstraintExceptForLayer(compositedLayerMapping->ancestorClippi
ngLayer(), mainLayer); | 219 clearPositionConstraintExceptForLayer(compositedLayerMapping->ancestorClippi
ngLayer(), mainLayer); |
219 clearPositionConstraintExceptForLayer(compositedLayerMapping->mainGraphicsLa
yer(), mainLayer); | 220 clearPositionConstraintExceptForLayer(compositedLayerMapping->mainGraphicsLa
yer(), mainLayer); |
220 | 221 |
221 if (WebLayer* scrollableLayer = toWebLayer(mainLayer)) | 222 if (WebLayer* scrollableLayer = toWebLayer(mainLayer)) |
222 scrollableLayer->setPositionConstraint(computePositionConstraint(layer))
; | 223 scrollableLayer->setPositionConstraint(computePositionConstraint(layer))
; |
223 } | 224 } |
224 | 225 |
225 void ScrollingCoordinator::willDestroyScrollableArea(ScrollableArea* scrollableA
rea) | 226 void ScrollingCoordinator::willDestroyScrollableArea(ScrollableArea* scrollableA
rea) |
226 { | 227 { |
227 removeWebScrollbarLayer(scrollableArea, HorizontalScrollbar); | 228 removeWebScrollbarLayer(scrollableArea, HorizontalScrollbar); |
(...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
947 bool frameIsScrollable = frameView && frameView->isScrollable(); | 948 bool frameIsScrollable = frameView && frameView->isScrollable(); |
948 if (frameIsScrollable != m_wasFrameScrollable) | 949 if (frameIsScrollable != m_wasFrameScrollable) |
949 return true; | 950 return true; |
950 | 951 |
951 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll
ing()) : 0) | 952 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll
ing()) : 0) |
952 return blink::WebSize(frameView->contentsSize()) != scrollLayer->bounds(
); | 953 return blink::WebSize(frameView->contentsSize()) != scrollLayer->bounds(
); |
953 return false; | 954 return false; |
954 } | 955 } |
955 | 956 |
956 } // namespace blink | 957 } // namespace blink |
OLD | NEW |