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

Side by Side Diff: third_party/WebKit/Source/core/layout/compositing/CompositingReasonFinder.cpp

Issue 2769353002: Only create sticky position constraints for constrained sticky position. (Closed)
Patch Set: Set dependent patch. Created 3 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/layout/compositing/CompositingReasonFinder.h" 5 #include "core/layout/compositing/CompositingReasonFinder.h"
6 6
7 #include "core/CSSPropertyNames.h" 7 #include "core/CSSPropertyNames.h"
8 #include "core/dom/Document.h" 8 #include "core/dom/Document.h"
9 #include "core/frame/FrameView.h" 9 #include "core/frame/FrameView.h"
10 #include "core/frame/Settings.h" 10 #include "core/frame/Settings.h"
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 bool CompositingReasonFinder::requiresCompositingForTransformAnimation( 209 bool CompositingReasonFinder::requiresCompositingForTransformAnimation(
210 const ComputedStyle& style) { 210 const ComputedStyle& style) {
211 return style.subtreeWillChangeContents() 211 return style.subtreeWillChangeContents()
212 ? style.isRunningTransformAnimationOnCompositor() 212 ? style.isRunningTransformAnimationOnCompositor()
213 : style.hasCurrentTransformAnimation(); 213 : style.hasCurrentTransformAnimation();
214 } 214 }
215 215
216 bool CompositingReasonFinder::requiresCompositingForScrollDependentPosition( 216 bool CompositingReasonFinder::requiresCompositingForScrollDependentPosition(
217 const PaintLayer* layer, 217 const PaintLayer* layer,
218 bool ignoreLCDText) const { 218 bool ignoreLCDText) const {
219 if (layer->layoutObject().style()->position() != EPosition::kFixed && 219 if (!layer->layoutObject().style()->hasViewportConstrainedPosition() &&
220 layer->layoutObject().style()->position() != EPosition::kSticky) 220 !layer->layoutObject().style()->hasStickyConstrainedPosition())
221 return false; 221 return false;
222 222
223 if (!(ignoreLCDText || 223 if (!(ignoreLCDText ||
224 (m_compositingTriggers & ViewportConstrainedPositionedTrigger)) && 224 (m_compositingTriggers & ViewportConstrainedPositionedTrigger)) &&
225 (!RuntimeEnabledFeatures::compositeOpaqueFixedPositionEnabled() || 225 (!RuntimeEnabledFeatures::compositeOpaqueFixedPositionEnabled() ||
226 !layer->backgroundIsKnownToBeOpaqueInRect( 226 !layer->backgroundIsKnownToBeOpaqueInRect(
227 LayoutRect(layer->boundingBoxForCompositing())) || 227 LayoutRect(layer->boundingBoxForCompositing())) ||
228 layer->compositesWithTransform() || layer->compositesWithOpacity())) { 228 layer->compositesWithTransform() || layer->compositesWithOpacity())) {
229 return false; 229 return false;
230 } 230 }
(...skipping 18 matching lines...) Expand all
249 249
250 // Don't promote sticky position elements that cannot move with scrolls. 250 // Don't promote sticky position elements that cannot move with scrolls.
251 if (!layer->sticksToScroller()) 251 if (!layer->sticksToScroller())
252 return false; 252 return false;
253 if (layer->ancestorOverflowLayer()->isRootLayer()) 253 if (layer->ancestorOverflowLayer()->isRootLayer())
254 return m_layoutView.frameView()->isScrollable(); 254 return m_layoutView.frameView()->isScrollable();
255 return layer->ancestorOverflowLayer()->scrollsOverflow(); 255 return layer->ancestorOverflowLayer()->scrollsOverflow();
256 } 256 }
257 257
258 } // namespace blink 258 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698