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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 if (layer && layer != except && toWebLayer(layer)) | 181 if (layer && layer != except && toWebLayer(layer)) |
182 toWebLayer(layer)->setPositionConstraint(WebLayerPositionConstraint()); | 182 toWebLayer(layer)->setPositionConstraint(WebLayerPositionConstraint()); |
183 } | 183 } |
184 | 184 |
185 static WebLayerPositionConstraint computePositionConstraint(const RenderLayer* l
ayer) | 185 static WebLayerPositionConstraint computePositionConstraint(const RenderLayer* l
ayer) |
186 { | 186 { |
187 ASSERT(layer->hasCompositedLayerMapping()); | 187 ASSERT(layer->hasCompositedLayerMapping()); |
188 do { | 188 do { |
189 if (layer->renderer()->style()->position() == FixedPosition) { | 189 if (layer->renderer()->style()->position() == FixedPosition) { |
190 const RenderObject* fixedPositionObject = layer->renderer(); | 190 const RenderObject* fixedPositionObject = layer->renderer(); |
191 bool fixedToRight = !fixedPositionObject->style()->right().isAuto(); | 191 bool fixedToRight = !fixedPositionObject->style()->right().isAuto()
&& fixedPositionObject->style()->left().isAuto(); |
192 bool fixedToBottom = !fixedPositionObject->style()->bottom().isAuto(
); | 192 bool fixedToBottom = !fixedPositionObject->style()->bottom().isAuto(
) && fixedPositionObject->style()->top().isAuto(); |
193 return WebLayerPositionConstraint::fixedPosition(fixedToRight, fixed
ToBottom); | 193 return WebLayerPositionConstraint::fixedPosition(fixedToRight, fixed
ToBottom); |
194 } | 194 } |
195 | 195 |
196 layer = layer->parent(); | 196 layer = layer->parent(); |
197 | 197 |
198 // Composited layers that inherit a fixed position state will be positio
ned with respect to the nearest compositedLayerMapping's GraphicsLayer. | 198 // Composited layers that inherit a fixed position state will be positio
ned with respect to the nearest compositedLayerMapping's GraphicsLayer. |
199 // So, once we find a layer that has its own compositedLayerMapping, we
can stop searching for a fixed position RenderObject. | 199 // So, once we find a layer that has its own compositedLayerMapping, we
can stop searching for a fixed position RenderObject. |
200 } while (layer && !layer->hasCompositedLayerMapping()); | 200 } while (layer && !layer->hasCompositedLayerMapping()); |
201 return WebLayerPositionConstraint(); | 201 return WebLayerPositionConstraint(); |
202 } | 202 } |
(...skipping 740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
943 bool frameIsScrollable = frameView && frameView->isScrollable(); | 943 bool frameIsScrollable = frameView && frameView->isScrollable(); |
944 if (frameIsScrollable != m_wasFrameScrollable) | 944 if (frameIsScrollable != m_wasFrameScrollable) |
945 return true; | 945 return true; |
946 | 946 |
947 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll
ing()) : 0) | 947 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll
ing()) : 0) |
948 return blink::WebSize(frameView->contentsSize()) != scrollLayer->bounds(
); | 948 return blink::WebSize(frameView->contentsSize()) != scrollLayer->bounds(
); |
949 return false; | 949 return false; |
950 } | 950 } |
951 | 951 |
952 } // namespace WebCore | 952 } // namespace WebCore |
OLD | NEW |