Element is visible even if backface-visibility is 'hidden' and the back is facing towards the viewer.
Created attachment 28574 [details] Test case for backface visibility A simple test case for -webkit-backface-visibility property
Created attachment 28575 [details] Patch to enable backface visibility property to have effect This small patch enables -webkit-backface-visibility CSS property to have effect and fixes the test case.
backface-visibility isn't supported unless you have rendering that supports 3d transforms. The fix is also incorrect, because you need to compute a transform relative to the root, and not just the container.
Comment on attachment 28575 [details] Patch to enable backface visibility property to have effect > Index: WebCore/rendering/RenderLayer.cpp > =================================================================== > --- WebCore/rendering/RenderLayer.cpp (revision 41663) > +++ WebCore/rendering/RenderLayer.cpp (working copy) > @@ -1955,6 +1955,12 @@ RenderLayer::paintLayer(RenderLayer* roo > TransformationMatrix transform; > transform.translate(x, y); > transform = *m_transform * transform; > + > + // Don't paint anything if backface-visibility is 'hidden' and the back is facing towards the viewer. > + if (renderer()->style()->backfaceVisibility() == BackfaceVisibilityHidden) { > + if (transform.inverse().m33() < 0) > + return; > + } This is wrong; backface-visibility has to take into account the transform to the root, not just the parent layer. It really needs to be implemented by the GraphicsLayer machinery.
backface-visibility is only supported when ACCELERATED_COMPOSITING is enabled, and in that situation it works. If you have a 3d rendering path that does not rely on ACCELERATED_COMPOSITING, then it presumably requires a bunch of extra changes which would also need to be committed.
*** Bug 37460 has been marked as a duplicate of this bug. ***