Index: third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp |
diff --git a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp |
index e61d98d7d9afa174a98d946ae9132cedf2e53e79..13f21dc1ef2318e2d34684d85a9e6bd55ce5bf08 100644 |
--- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp |
+++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp |
@@ -72,12 +72,11 @@ static bool UpdateContentClip( |
return true; |
} |
-static CompositorElementId CreateDomNodeBasedCompositorElementId( |
+static CompositorElementId CreatePaintLayereBasedCompositorElementId( |
const LayoutObject& object) { |
- // TODO(wkorman): Centralize this implementation with similar across |
- // animation, scrolling and compositing logic. |
- return CompositorElementIdFromDOMNodeId( |
- DOMNodeIds::IdForNode(object.GetNode()), |
+ DCHECK(object.IsBoxModelObject() && object.HasLayer()); |
+ return CompositorElementIdFromPaintLayerId( |
+ ToLayoutBoxModelObject(object).Layer()->UniqueId(), |
CompositorElementIdNamespace::kPrimary); |
} |
@@ -97,7 +96,7 @@ static bool UpdateScrollTranslation( |
WebLayerScrollClient* scroll_client) { |
DCHECK(!RuntimeEnabledFeatures::rootLayerScrollingEnabled()); |
CompositorElementId compositor_element_id = |
- CreateDomNodeBasedCompositorElementId(*frame_view.GetLayoutView()); |
+ CreatePaintLayereBasedCompositorElementId(*frame_view.GetLayoutView()); |
if (auto* existing_scroll_translation = frame_view.ScrollTranslation()) { |
auto existing_reasons = existing_scroll_translation->ScrollNode() |
->GetMainThreadScrollingReasons(); |
@@ -1195,9 +1194,9 @@ void PaintPropertyTreeBuilder::UpdatePaintProperties( |
if (needs_paint_properties && !had_paint_properties) { |
ObjectPaintProperties& paint_properties = |
object.GetMutableForPainting().EnsurePaintProperties(); |
- if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
+ if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() && object.HasLayer()) { |
paint_properties.SetCompositorElementId( |
- CreateDomNodeBasedCompositorElementId(object)); |
+ CreatePaintLayereBasedCompositorElementId(object)); |
} |
} else if (!needs_paint_properties && had_paint_properties) { |
object.GetMutableForPainting().ClearPaintProperties(); |