Chromium Code Reviews| Index: third_party/WebKit/Source/core/animation/Animation.cpp |
| diff --git a/third_party/WebKit/Source/core/animation/Animation.cpp b/third_party/WebKit/Source/core/animation/Animation.cpp |
| index af5fdce15eb55b9ed1d6e028a1e8068be0649b55..6950a9261e13653e1fdaef41837d5532bad0322a 100644 |
| --- a/third_party/WebKit/Source/core/animation/Animation.cpp |
| +++ b/third_party/WebKit/Source/core/animation/Animation.cpp |
| @@ -43,6 +43,7 @@ |
| #include "core/events/AnimationPlaybackEvent.h" |
| #include "core/frame/UseCounter.h" |
| #include "core/inspector/InspectorTraceEvents.h" |
| +#include "core/paint/PaintLayer.h" |
| #include "core/probe/CoreProbes.h" |
| #include "platform/RuntimeEnabledFeatures.h" |
| #include "platform/ScriptForbiddenScope.h" |
| @@ -752,11 +753,19 @@ bool Animation::CanStartAnimationOnCompositor( |
| if (!target_element) |
| return false; |
| - CompositorElementId target_element_id = CompositorElementIdFromDOMNodeId( |
| - DOMNodeIds::IdForNode(target_element), |
| - CompositorElementIdNamespace::kPrimary); |
| - if (!composited_element_ids->Contains(target_element_id)) |
| + if (target_element->GetLayoutObject() && |
|
wkorman
2017/05/18 00:45:58
nit: pulling target_element->GetLayoutObject() int
|
| + target_element->GetLayoutObject()->IsBoxModelObject() && |
| + target_element->GetLayoutObject()->HasLayer()) { |
| + PaintLayer* paint_layer = |
| + ToLayoutBoxModelObject(target_element->GetLayoutObject())->Layer(); |
| + CompositorElementId target_element_id = |
| + CompositorElementIdFromPaintLayerId( |
| + paint_layer->UniqueId(), CompositorElementIdNamespace::kPrimary); |
| + if (!composited_element_ids->Contains(target_element_id)) |
| + return false; |
| + } else { |
|
wkorman
2017/05/18 00:45:58
nit: maybe more readable if we add
if (!composite
|
| return false; |
| + } |
| } |
| return Playing(); |