Bug 1800977 Comment 4 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

(In reply to Hiroyuki Ikezoe (:hiro) from comment #3)
> 1) we can detect style changes that it can be run on the compositor if it's changed by CSS animations

The detection should be done in [nsDOMCSSAttributeDeclaration::MutationClosureFunction](https://searchfox.org/mozilla-central/rev/d7d2cc647772de15c4c5aa47f74d25d0e379e404/layout/style/nsDOMCSSAttrDeclaration.cpp#250) by checking [nsDOMCSSAttributeDeclaration::MutationClosureFunction](https://searchfox.org/mozilla-central/rev/d7d2cc647772de15c4c5aa47f74d25d0e379e404/layout/style/nsCSSPropertyIDSet.h#71)

> 2) then we can skip restyling for the style changes

A relevant part is here in [RestyleManager::AttributeChanged](https://searchfox.org/mozilla-central/rev/d7d2cc647772de15c4c5aa47f74d25d0e379e404/layout/style/nsCSSPropertyIDSet.h#71), we need to skip calling `Servo_NoteExplicitHints`.

> 3) and then it can be propagated into the corresponding webrender display items directly (by adding a new route to do it)

I believe gfx people is  more familiar with this part.

Of course there will be more involving stuff something like in this case we shouldn't apply this optimization or we should forcibly flush the style changes, etc. etc.
(In reply to Hiroyuki Ikezoe (:hiro) from comment #3)
> 1) we can detect style changes that it can be run on the compositor if it's changed by CSS animations

The detection should be done in [nsDOMCSSAttributeDeclaration::MutationClosureFunction](https://searchfox.org/mozilla-central/rev/d7d2cc647772de15c4c5aa47f74d25d0e379e404/layout/style/nsDOMCSSAttrDeclaration.cpp#250) by checking [nsDOMCSSAttributeDeclaration::MutationClosureFunction](https://searchfox.org/mozilla-central/rev/d7d2cc647772de15c4c5aa47f74d25d0e379e404/layout/style/nsCSSPropertyIDSet.h#71)

> 2) then we can skip restyling for the style changes

A relevant part is here in [RestyleManager::AttributeChanged](https://searchfox.org/mozilla-central/rev/2f47e3dacf0d773e9c7f363cecf10cfbea490679/layout/base/RestyleManager.cpp#3497), we need to skip calling `Servo_NoteExplicitHints`.

> 3) and then it can be propagated into the corresponding webrender display items directly (by adding a new route to do it)

I believe gfx people is  more familiar with this part.

Of course there will be more involving stuff something like in this case we shouldn't apply this optimization or we should forcibly flush the style changes, etc. etc.

Back to Bug 1800977 Comment 4