I'd like to know why webkit-backface-visibility
is like that all-purpose aspirin that solves or makes worse all kinds of heterogeneous problems, mostly related to artifacts and flickering.
I have read and understand what really backface-visibility
is for: It controls wether 3D rotated objects are visible when not facing the screen. There's a nice, straighforward demo here
But I'm curious why, everytime I have strange glitches in the CSS world, totally unrelated to 3D rotations and their hidden backfaces, applying backface-visibility
to the problematic layer or one of its ancestors usually helps or make things worse, but rarely does nothing. I'm talking about things like
- Animations flickering
- Fixed layers Z-Index problems
- Display:none <> visible flicker and artifacts
- Scrolling flicker
Interestingly and always in my humble experience, backface-visibility:hidden
tends to solve fixed-positioning related stuff, and backface-visibility:visible
is "best" for flickering. Also interestingly, in Chrome and Safari the side-effects are different, but boy there are!
I am working in a Visual HTML creator, so the situations were I have flicker / artifacts are rather complex (ie. an animation over several layers, a scrolling div behind fixed elements, absolute over fixed with z-index ....)
Anybody can enlighten me?