Compositing Reasons

96 views
Skip to first unread message

Pea Wyllie

unread,
Nov 14, 2022, 2:48:41 PM11/14/22
to blink-dev
Hello, I've got a use case in which I need to get certain DOM elements into their own layer. I've added a new HTML attribute for this purpose, and added a new Compositing Reason to the layers that have this attribute. However, when I go to a test site on my Chromium build running with --show-composited-layer-borders, I do not see my elements in their own compositing layer. Is there an allowlist elsewhere that is necessary to pick up those changes? Or is compositing reasons just for metrics or something and the actual logic resides elsewhere? Thanks!

Philip Rogers

unread,
Nov 14, 2022, 4:49:15 PM11/14/22
to blink-dev, Pea Wyllie
Would it work to just add "will-change: transform;" (either in the html, or as an implementation detail in blink itself)? This can change paint order because it causes a stacking context, but it's the simplest way to ensure a cc::Layer is created that it set up for moving content.

Pea Wyllie

unread,
Nov 14, 2022, 5:35:51 PM11/14/22
to blink-dev, Philip Rogers, Pea Wyllie
I did do that for testing and how I knew to use the Compositing Reasons; but for my use case I need these layers to be specifically identifiable, so I was using the attribute.

Philip Rogers

unread,
Nov 15, 2022, 11:11:15 PM11/15/22
to blink-dev, Pea Wyllie, Philip Rogers
kViewTransitionPseudoElement was needed for the same purpose (making layers identifiable) and might be a good pattern to copy (e.g., see view_transition_shared_element_id).
Reply all
Reply to author
Forward
0 new messages