Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(241)

Side by Side Diff: Source/core/page/scrolling/ScrollingCoordinator.cpp

Issue 206093004: Modify condition for fixedToRight and fixedToBottom Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698