# LayerTree
_Auto generated documentation for WebKit inspector
* Commands
* [enable](#layertreeenablecallback)
* [disable](#layertreedisablecallback)
* [layersForNode](#layertreelayersfornodedomnodeid-callback)
* [reasonsForCompositingLayer](#layertreereasonsforcompositinglayerlayerid-callback)
* Events
* [layerTreeDidChange](#event-layertreedidchange)
* Types
* [LayerId](#class-layerid)
* [PseudoElementId](#class-pseudoelementid)
* [IntRect](#class-intrect)
* [Layer](#class-layer)
* [CompositingReasons](#class-compositingreasons)
## Commands
### LayerTree.enable(callback)
Enables compositing tree inspection.
### Parameters
_**callback ( function )**_
### Results
_**error ( error )**_
### LayerTree.disable(callback)
Disables compositing tree inspection.
### Parameters
_**callback ( function )**_
### Results
_**error ( error )**_
### LayerTree.layersForNode([DOM.NodeId](DOM.md#class-nodeid), callback)
Returns the layer tree structure of the current page.
### Parameters
_**nodeId ( [DOM.NodeId](DOM.md#class-nodeid) )**_
> Root of the subtree for which we want to gather layers.
_**callback ( function )**_
### Results
_**error ( error )**_
_**layers ( array of [Layer](#class-layer) )**_
> Child layers.
### LayerTree.reasonsForCompositingLayer([LayerId](#class-layerid), callback)
Provides the reasons why the given layer was composited.
### Parameters
_**layerId ( [LayerId](#class-layerid) )**_
> The id of the layer for which we want to get the reasons it was composited.
_**callback ( function )**_
### Results
_**error ( error )**_
_**compositingReasons ( [CompositingReasons](#class-compositingreasons) )**_
> An object containing the reasons why the layer was composited as properties.
## Events
### Event: layerTreeDidChange
## Types
### Class: LayerId
_Type: string_
Unique RenderLayer identifier.
### Class: PseudoElementId
_Type: string_
Unique PseudoElement identifier.
### Class: IntRect
_Type: object_
A rectangle.
### Properties
_**x ( integer )**_
> The x position.
_**y ( integer )**_
> The y position.
_**width ( integer )**_
> The width metric.
_**height ( integer )**_
> The height metric.
### Class: Layer
_Type: object_
Information about a compositing layer.
### Properties
_**layerId ( [LayerId](#class-layerid) )**_
> The unique id for this layer.
_**nodeId ( [DOM.NodeId](DOM.md#class-nodeid) )**_
> The id for the node associated with this layer.
_**bounds ( [IntRect](#class-intrect) )**_
> Bounds of the layer in absolute page coordinates.
_**paintCount ( integer )**_
> Indicates how many time this layer has painted.
_**memory ( integer )**_
> Estimated memory used by this layer.
_**compositedBounds ( [IntRect](#class-intrect) )**_
> The bounds of the composited layer.
_**isInShadowTree ( optional boolean )**_
> Indicates whether this layer is associated with an element hosted in a shadow tree.
_**isReflection ( optional boolean )**_
> Indicates whether this layer was used to provide a reflection for the element.
_**isGeneratedContent ( optional boolean )**_
> Indicates whether the layer is attached to a pseudo element that is CSS generated content.
_**isAnonymous ( optional boolean )**_
> Indicates whether the layer was created for a CSS anonymous block or box.
_**pseudoElementId ( optional [PseudoElementId](#class-pseudoelementid) )**_
> The id for the pseudo element associated with this layer.
_**pseudoElement ( optional string )**_
> The name of the CSS pseudo-element that prompted the layer to be generated.
### Class: CompositingReasons
_Type: object_
An object containing the reasons why the layer was composited as properties.
### Properties
_**transform3D ( optional boolean )**_
> Composition due to association with an element with a CSS 3D transform.
_**video ( optional boolean )**_
> Composition due to association with a