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

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

Issue 2977273002: Promote fixed: position elements with composited descendants even if they don't scroll (Closed)
Patch Set: Created 3 years, 5 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) 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2014 Google Inc. All rights reserved. 3 * Copyright (C) 2014 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 // FIXME: This should move into 187 // FIXME: This should move into
188 // CompositingReasonFinder::potentialCompositingReasonsFromStyle, but theres 188 // CompositingReasonFinder::potentialCompositingReasonsFromStyle, but theres
189 // a poor interaction with LayoutTextControlSingleLine, which sets this 189 // a poor interaction with LayoutTextControlSingleLine, which sets this
190 // hasOverflowClip directly. 190 // hasOverflowClip directly.
191 if (layer->GetLayoutObject().HasClipRelatedProperty()) 191 if (layer->GetLayoutObject().HasClipRelatedProperty())
192 subtree_reasons |= kCompositingReasonClipsCompositingDescendants; 192 subtree_reasons |= kCompositingReasonClipsCompositingDescendants;
193 193
194 // We ignore LCD text here because we are required to composite 194 // We ignore LCD text here because we are required to composite
195 // scroll-dependant fixed position elements with composited descendants for 195 // scroll-dependant fixed position elements with composited descendants for
196 // correctness - even if we lose LCD. 196 // correctness - even if we lose LCD.
197 //
198 // TODO(smcgruer): Only composite fixed if needed (http://crbug.com/742213)
197 const bool ignore_lcd_text = true; 199 const bool ignore_lcd_text = true;
198 if (compositing_reason_finder.RequiresCompositingForScrollDependentPosition( 200 if (layer->GetLayoutObject().Style()->GetPosition() == EPosition::kFixed ||
201 compositing_reason_finder.RequiresCompositingForScrollDependentPosition(
199 layer, ignore_lcd_text)) { 202 layer, ignore_lcd_text)) {
200 subtree_reasons |= 203 subtree_reasons |=
201 kCompositingReasonPositionFixedOrStickyWithCompositedDescendants; 204 kCompositingReasonPositionFixedOrStickyWithCompositedDescendants;
202 } 205 }
203 } 206 }
204 207
205 // A layer with preserve-3d or perspective only needs to be composited if 208 // A layer with preserve-3d or perspective only needs to be composited if
206 // there are descendant layers that will be affected by the preserve-3d or 209 // there are descendant layers that will be affected by the preserve-3d or
207 // perspective. 210 // perspective.
208 if (has3d_transformed_descendants) { 211 if (has3d_transformed_descendants) {
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 descendant_has3d_transform |= 569 descendant_has3d_transform |=
567 any_descendant_has3d_transform || layer->Has3DTransform(); 570 any_descendant_has3d_transform || layer->Has3DTransform();
568 } 571 }
569 572
570 // At this point we have finished collecting all reasons to composite this 573 // At this point we have finished collecting all reasons to composite this
571 // layer. 574 // layer.
572 layer->SetCompositingReasons(reasons_to_composite); 575 layer->SetCompositingReasons(reasons_to_composite);
573 } 576 }
574 577
575 } // namespace blink 578 } // namespace blink
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