A page of ours is prerendered HTML, a stylesheet and some text. I assumed Chrome drew it in one layer. It does not: our FAQ page runs on 10 compositing layers , and the reasons are all readable from outside with the DevTools protocol.
await page . cdp ( "LayerTree.enable" , { } ) ; // scroll once, because the tree is only reported when it changes const ev = await page . events ( ) ; const layers = ev . filter ( e => e . method === "LayerTree.layerTreeDidChange" ) . pop ( ) . params . layers ; for ( const l of layers ) { const r = await page . cdp ( "LayerTree.compositingReasons" , { layerId : l . layerId } ) ; console . log ( l . width , l . height , l . paintCount , r .…