enclosingLayer() walks the entire parent chain, making it slow for deep trees
It makes repaint/layout samples account for about 30% of:
(which I'm not suggesting is either a good or bad benchmark, merely one which triggers this condition.)
I assume you mean "slow for deep, layer-sparse trees"?
Yes, deep, layer-sparse. :)