Chromium Code Reviews| Index: third_party/WebKit/Source/core/animation/CompositorAnimations.cpp |
| diff --git a/third_party/WebKit/Source/core/animation/CompositorAnimations.cpp b/third_party/WebKit/Source/core/animation/CompositorAnimations.cpp |
| index 0179f6125b962d1e985b8e32604043ca309fc759..7b2c1ea26302936149a29143f88714e313985ff6 100644 |
| --- a/third_party/WebKit/Source/core/animation/CompositorAnimations.cpp |
| +++ b/third_party/WebKit/Source/core/animation/CompositorAnimations.cpp |
| @@ -446,15 +446,16 @@ void CompositorAnimations::AttachCompositedLayers(Element& element, |
| return; |
| if (!element.GetLayoutObject() || |
|
wkorman
2017/05/18 00:45:58
nit: consider local var for element.GetLayoutObjec
|
| - !element.GetLayoutObject()->IsBoxModelObject()) |
| + !element.GetLayoutObject()->IsBoxModelObject() || |
| + !element.GetLayoutObject()->HasLayer()) |
| return; |
| + PaintLayer* layer = |
| + ToLayoutBoxModelObject(element.GetLayoutObject())->Layer(); |
| + |
| // Composited animations do not depend on a composited layer mapping for SPv2. |
| if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
| - PaintLayer* layer = |
| - ToLayoutBoxModelObject(element.GetLayoutObject())->Layer(); |
| - |
| - if (!layer || !layer->IsAllowedToQueryCompositingState() || |
| + if (!layer->IsAllowedToQueryCompositingState() || |
| !layer->GetCompositedLayerMapping() || |
| !layer->GetCompositedLayerMapping()->MainGraphicsLayer()) |
| return; |
| @@ -466,8 +467,8 @@ void CompositorAnimations::AttachCompositedLayers(Element& element, |
| } |
| CompositorAnimationPlayer* compositor_player = animation.CompositorPlayer(); |
| - compositor_player->AttachElement(CompositorElementIdFromDOMNodeId( |
| - DOMNodeIds::IdForNode(&element), CompositorElementIdNamespace::kPrimary)); |
| + compositor_player->AttachElement(CompositorElementIdFromPaintLayerId( |
| + layer->UniqueId(), CompositorElementIdNamespace::kPrimary)); |
| } |
| bool CompositorAnimations::ConvertTimingForCompositor( |