| Index: cc/trees/tree_synchronizer.cc
|
| diff --git a/cc/trees/tree_synchronizer.cc b/cc/trees/tree_synchronizer.cc
|
| index 1c1c7e164ad00244f0faa253432ccde7fc497202..27f9dab38d868f9d5a82a661b7d21481fa2360f8 100644
|
| --- a/cc/trees/tree_synchronizer.cc
|
| +++ b/cc/trees/tree_synchronizer.cc
|
| @@ -25,13 +25,6 @@
|
| if (!layer_impl)
|
| return;
|
|
|
| - layer_impl->ClearScrollbars();
|
| - if (ScrollbarLayerImplBase* scrollbar_layer =
|
| - layer_impl->ToScrollbarLayer()) {
|
| - scrollbar_layer->ClearClipLayer();
|
| - scrollbar_layer->ClearScrollLayer();
|
| - }
|
| -
|
| OwnedLayerImplList& children = layer_impl->children();
|
| for (OwnedLayerImplList::iterator it = children.begin();
|
| it != children.end();
|
| @@ -118,6 +111,11 @@
|
| new_layers, old_layers, layer->mask_layer(), tree_impl));
|
| layer_impl->SetReplicaLayer(SynchronizeTreesRecursiveInternal(
|
| new_layers, old_layers, layer->replica_layer(), tree_impl));
|
| +
|
| + // Remove all dangling pointers. The pointers will be setup later in
|
| + // UpdateScrollbarLayerPointersRecursive phase
|
| + layer_impl->SetHorizontalScrollbarLayer(NULL);
|
| + layer_impl->SetVerticalScrollbarLayer(NULL);
|
|
|
| return layer_impl.Pass();
|
| }
|
| @@ -162,9 +160,17 @@
|
| iter != new_layers->end()
|
| ? static_cast<ScrollbarLayerImplBase*>(iter->second)
|
| : NULL;
|
| + iter = new_layers->find(scrollbar_layer->ScrollLayerId());
|
| + LayerImpl* scroll_layer_impl =
|
| + iter != new_layers->end() ? iter->second : NULL;
|
| +
|
| DCHECK(scrollbar_layer_impl);
|
| -
|
| - scrollbar_layer->PushScrollClipPropertiesTo(scrollbar_layer_impl);
|
| + DCHECK(scroll_layer_impl);
|
| +
|
| + if (scrollbar_layer->orientation() == HORIZONTAL)
|
| + scroll_layer_impl->SetHorizontalScrollbarLayer(scrollbar_layer_impl);
|
| + else
|
| + scroll_layer_impl->SetVerticalScrollbarLayer(scrollbar_layer_impl);
|
| }
|
|
|
| void UpdateScrollbarLayerPointersRecursive(const RawPtrLayerImplMap* new_layers,
|
| @@ -199,8 +205,6 @@
|
|
|
| if (push_layer)
|
| layer->PushPropertiesTo(layer_impl);
|
| - else if (layer->ToScrollbarLayer())
|
| - layer->ToScrollbarLayer()->PushScrollClipPropertiesTo(layer_impl);
|
|
|
| size_t num_dependents_need_push_properties = 0;
|
| if (recurse_on_children_and_dependents) {
|
|
|