Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5957)

Unified Diff: cc/layers/layer.cc

Issue 2816063003: Replace layer id with Element id for tracking scrollbar animation controllers (Closed)
Patch Set: Address reviewer comments, pull element_id.h change to another patch Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: cc/layers/layer.cc
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc
index 72a530a3bf3f15434f20742c1e569175560f6963..15760beb1a6149b48a69cf00890dbd4675ba5ad9 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -1129,6 +1129,9 @@ void Layer::PushPropertiesTo(LayerImpl* layer) {
bool use_paint_properties = paint_properties_.source_frame_number ==
layer_tree_host_->SourceFrameNumber();
+ // The ElementId should be set first because other setters depend on it such
+ // as LayerImpl::SetScrollClipLayer.
+ layer->SetElementId(inputs_.element_id);
layer->SetBackgroundColor(inputs_.background_color);
layer->SetSafeOpaqueBackgroundColor(safe_opaque_background_color_);
layer->SetBounds(use_paint_properties ? paint_properties_.bounds
@@ -1169,7 +1172,6 @@ void Layer::PushPropertiesTo(LayerImpl* layer) {
layer->SetScrollClipLayer(inputs_.scroll_clip_layer_id);
layer->set_user_scrollable_horizontal(inputs_.user_scrollable_horizontal);
layer->set_user_scrollable_vertical(inputs_.user_scrollable_vertical);
- layer->SetElementId(inputs_.element_id);
layer->SetMutableProperties(inputs_.mutable_properties);
// When a scroll offset animation is interrupted the new scroll position on

Powered by Google App Engine
This is Rietveld 408576698