Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/compositing/CompositingRequirementsUpdater.cpp |
| diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositingRequirementsUpdater.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositingRequirementsUpdater.cpp |
| index 617d570621a6d956d6561ac1812f287b02760740..955411e1ba9edc27c0cc34af55079816a4e9935f 100644 |
| --- a/third_party/WebKit/Source/core/layout/compositing/CompositingRequirementsUpdater.cpp |
| +++ b/third_party/WebKit/Source/core/layout/compositing/CompositingRequirementsUpdater.cpp |
| @@ -166,6 +166,7 @@ static bool RequiresCompositingOrSquashing(CompositingReasons reasons) { |
| } |
| static CompositingReasons SubtreeReasonsForCompositing( |
| + const CompositingReasonFinder& compositing_reason_finder, |
| PaintLayer* layer, |
| bool has_composited_descendants, |
| bool has3d_transformed_descendants) { |
| @@ -190,9 +191,11 @@ static CompositingReasons SubtreeReasonsForCompositing( |
| if (layer->GetLayoutObject().HasClipRelatedProperty()) |
| subtree_reasons |= kCompositingReasonClipsCompositingDescendants; |
| - if (layer->GetLayoutObject().Style()->GetPosition() == EPosition::kFixed) |
| + if (compositing_reason_finder.RequiresCompositingForScrollDependentPosition( |
| + layer, true)) { |
|
flackr
2017/04/26 15:42:36
nit: the style, depending on where blink is at now
smcgruer
2017/04/26 18:05:46
Done.
|
| subtree_reasons |= |
| - kCompositingReasonPositionFixedWithCompositedDescendants; |
| + kCompositingReasonPositionFixedOrStickyWithCompositedDescendants; |
| + } |
| } |
| // A layer with preserve-3d or perspective only needs to be composited if |
| @@ -497,7 +500,8 @@ void CompositingRequirementsUpdater::UpdateRecursive( |
| // descendant layers. |
| CompositingReasons subtree_compositing_reasons = |
| SubtreeReasonsForCompositing( |
| - layer, child_recursion_data.subtree_is_compositing_, |
| + compositing_reason_finder_, layer, |
| + child_recursion_data.subtree_is_compositing_, |
| any_descendant_has3d_transform); |
| reasons_to_composite |= subtree_compositing_reasons; |
| if (!will_be_composited_or_squashed && can_be_composited && |