Index: third_party/WebKit/Source/platform/graphics/paint/PropertyTreeState.cpp |
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PropertyTreeState.cpp b/third_party/WebKit/Source/platform/graphics/paint/PropertyTreeState.cpp |
index 852b5243edb25b2eb73911ebda9fa37f3370faaf..c350165afdf9f5b5e9b38841ea35bf4682d9d76d 100644 |
--- a/third_party/WebKit/Source/platform/graphics/paint/PropertyTreeState.cpp |
+++ b/third_party/WebKit/Source/platform/graphics/paint/PropertyTreeState.cpp |
@@ -29,6 +29,36 @@ bool isAncestorOf(const PropertyNode* ancestor, const PropertyNode* child) { |
return child == ancestor; |
} |
+const CompositorElementId PropertyTreeState::compositorElementId() const { |
+// Zero or more of the scroll, effect or transform nodes could have a |
+// compositor element id. The order doesn't matter as the element id should be |
+// the same on all that have a non-default CompositorElementId. |
+#if DCHECK_IS_ON() |
+ CompositorElementId expectedElementId; |
+ if (CompositorElementId actualElementId = effect()->compositorElementId()) { |
+ expectedElementId = actualElementId; |
+ } |
+ if (CompositorElementId actualElementId = scroll()->compositorElementId()) { |
+ if (!expectedElementId) |
+ expectedElementId = actualElementId; |
+ else |
+ DCHECK_EQ(expectedElementId, actualElementId); |
+ } |
+ if (CompositorElementId actualElementId = |
+ transform()->compositorElementId()) { |
+ if (expectedElementId) |
+ DCHECK_EQ(expectedElementId, actualElementId); |
+ } |
+#endif |
+ if (effect()->compositorElementId()) |
+ return effect()->compositorElementId(); |
+ if (scroll()->compositorElementId()) |
+ return scroll()->compositorElementId(); |
+ if (transform()->compositorElementId()) |
+ return transform()->compositorElementId(); |
+ return CompositorElementId(); |
+} |
+ |
PropertyTreeState::InnermostNode PropertyTreeState::innermostNode() const { |
// TODO(chrishtr): this is very inefficient when innermostNode() is called |
// repeatedly. |