TL;DR: Don't add new dependencies on animation layer ids or scrolling layer ids, use element ids.
ElementIds are a stable identifier for the compositor that represent the html node[1] responsible for effects like animations and scrolling. The paint team is moving towards using these stable element ids for tracking animations and scrolling instead of relying on layers. This will let blink make more general layerization decisions such as splitting up a scrollable area into multiple Layers, in addition to moving more logic off Layer.
I'm in the middle of refactoring composited scrolling (
https://crbug.com/693740) to be based on element ids (e.g., tracking the currently scrolling element id instead of the currently scrolling layer id). This decouples Layers from scrolling which will be primarily handled in the scroll property tree where scroll geometry is also needed.
This refactoring has the following implications:
* Removes the reference from ScrollNode to Layer (ScrollNode's owning_layer_id) though there will be a reference from Layer to ScrollNode (Layer's scroll_tree_index).
* Keeps the 1:1 relationship between ScrollNode and ElementId (ScrollTree's element_id_to_scroll_node_index and ScrollNode's element_id).
* Removes the the 1:1 mapping from ElementId to Layer, replacing it with a 1:N relationship so LayerTreeImpl::LayerByElementId will need to become LayersByElementId (or similar).
Lots of folks are also working in this space. Weiliang Chen is working on using element ids to tick animations in
http://crbug.com/702774. Jayadev Dasika is removing the need to use Layers for property tree nodes. Walter "The Animator" Korman is refactoring composited animations to not use layer ids in
http://crbug.com/709137.
These are pretty big conceptual change so we wanted to share the motivation and details.
[1] For most cases you can think of ElementId as representing a single blink element but it's actually slightly more. ElementId is backed by a primary id (the element) and a secondary id for when there are multiple effects from a single element. See cc's
element_id.h and blink's
CompositorElementId.h.