WebKit
WebKit copied to clipboard
CSS perspective should only affect direct DOM children.
1f51474223ec6ae7e7cc1ede9c68baeb6b0ea3ab
CSS perspective should only affect direct DOM children. https://bugs.webkit.org/show_bug.cgi?id=73268 <rdar://problem/100834757> Reviewed by NOBODY (OOPS!). CSS perspective should only be combined into the transform of direct DOM children, and shouldn't result in any intersections in 3d coordinate space. We currently create a GraphicsLayer for the RenderLayer with perspective, which applies the perspective to all RenderLayer children (even if they belong to a descendant that isn't a child), and enables intersections. This change instead creates a wrapper GraphicsLayer for each transformed RenderLayer which should inherit perspective from its parent. This ensures that we only apply perspective when correct, and no intersections can happens since the perspective wrapper only has a single child. The downside is that we create extra GraphicsLayers, but there's no other way to get the desired CSS behaviour with the current API. The perspective layer is sized the same as the parent layer, since the computed perspective transform gets applied relative to the anchor point of the layer, and it's expected to be in the middle of the layer, so we need them to be the same size. * LayoutTests/TestExpectations: * LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/3d-rendering-context-behavior-expected.txt: * Source/WebCore/rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::destroyGraphicsLayers): (WebCore::RenderLayerBacking::updateChildrenTransformAndAnchorPoint): (WebCore::RenderLayerBacking::updateConfiguration): (WebCore::RenderLayerBacking::updateInternalHierarchy): (WebCore::RenderLayerBacking::updatePerspectiveLayer): (WebCore::RenderLayerBacking::childForSuperlayers const): * Source/WebCore/rendering/RenderLayerBacking.h: * Source/WebCore/rendering/RenderLayerCompositor.cpp: (WebCore::recompositeChangeRequiresGeometryUpdate): (WebCore::recompositeChangeRequiresChildrenGeometryUpdate): (WebCore::RenderLayerCompositor::layerStyleChanged): * Source/WebCore/rendering/RenderObject.cpp: (WebCore::RenderObject::getTransformFromContainer const):
https://github.com/WebKit/WebKit/commit/1f51474223ec6ae7e7cc1ede9c68baeb6b0ea3ab
EWS run on previous version of this PR (hash https://github.com/WebKit/WebKit/commit/a037d68aea20c816cb7b7a297f4f1538ee308788)
EWS run on previous version of this PR (hash https://github.com/WebKit/WebKit/commit/e91fb2eb8e82793961e5e0be3254025da2b00552)
EWS run on current version of this PR (hash https://github.com/WebKit/WebKit/commit/1f51474223ec6ae7e7cc1ede9c68baeb6b0ea3ab)
I couple of thoughts before I do a full review.
-
perspective
can be animated; do we map this to a hardware animation now? With your patch, do we correctly animate perspective on all the right layers? - There's a parallax scrolling thing where
perspective
on anoverflow:scroll
affects the transform on scrolled, transformed layers, and this needs to continue to work.