[webkit-changes] [WebKit/WebKit] 96c4f6: Make TransformState changes to support transform-s...

mattwoodrow noreply at github.com
Tue Dec 6 13:54:44 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 96c4f6e9ec7c5d548021e4ec2d35d08329377654
      https://github.com/WebKit/WebKit/commit/96c4f6e9ec7c5d548021e4ec2d35d08329377654
  Author: Matt Woodrow <mattwoodrow at apple.com>
  Date:   2022-12-06 (Tue, 06 Dec 2022)

  Changed paths:
    M LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/3d-rendering-context-behavior-expected.txt
    M LayoutTests/platform/gtk/transforms/3d/point-mapping/3d-point-mapping-2-expected.txt
    A LayoutTests/platform/gtk/transforms/3d/point-mapping/3d-point-mapping-4-expected.txt
    M LayoutTests/platform/gtk/transforms/3d/point-mapping/3d-point-mapping-expected.txt
    M LayoutTests/platform/ios/transforms/3d/point-mapping/3d-point-mapping-2-expected.txt
    A LayoutTests/platform/ios/transforms/3d/point-mapping/3d-point-mapping-4-expected.txt
    M LayoutTests/platform/ios/transforms/3d/point-mapping/3d-point-mapping-expected.txt
    M LayoutTests/platform/mac/transforms/3d/point-mapping/3d-point-mapping-2-expected.txt
    A LayoutTests/platform/mac/transforms/3d/point-mapping/3d-point-mapping-4-expected.txt
    M LayoutTests/platform/mac/transforms/3d/point-mapping/3d-point-mapping-expected.txt
    M LayoutTests/transforms/3d/point-mapping/3d-point-mapping-3.html
    A LayoutTests/transforms/3d/point-mapping/3d-point-mapping-4.html
    M LayoutTests/transforms/3d/point-mapping/3d-point-mapping.html
    M LayoutTests/transforms/3d/preserve-3d-not-applied-to-ancestors-expected.txt
    M Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
    M Source/WebCore/platform/graphics/transforms/TransformState.cpp
    M Source/WebCore/platform/graphics/transforms/TransformState.h
    M Source/WebCore/rendering/LayerOverlapMap.cpp
    M Source/WebCore/rendering/RenderGeometryMap.cpp
    M Source/WebCore/rendering/RenderGeometryMap.h
    M Source/WebCore/rendering/RenderLayer.cpp
    M Source/WebCore/rendering/RenderObject.cpp
    M Source/WebCore/rendering/RenderObject.h
    M Source/WebCore/rendering/svg/RenderSVGRoot.cpp
    M Source/WebCore/rendering/svg/SVGLayerTransformComputation.h
    M Source/WebKit/WebProcess/WebPage/wc/GraphicsLayerWC.cpp

  Log Message:
  -----------
  Make TransformState changes to support transform-style:preserve-3d and perspective only apply to direct DOM children.
https://bugs.webkit.org/show_bug.cgi?id=248284
<rdar://problem/102632597>

Reviewed by Simon Fraser.

This changes TransformState to support applying the flattening both before and after the specified transform is accounted for,
and reverses which happens if 3d transform interop is enabled.

This is because flattening under interop is a property of the child rather than the parent. We flatten just that child if it isn't
accumulating its parent's transform, rather than flattening all children because we're not preserve-3d).

The existing TransformState only supported flattening after, which I believe was always incorrect if we were pushing transforms onto
the state from innermost to outermost. This happens for getBoundingClientRect/ApplyTransformDirection, and is why preserve-3d-not-applied-to-ancestors.html
failed (despite not being affected being interop changes). These changes make that test work correctly.

* LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/3d-rendering-context-behavior-expected.txt:
* LayoutTests/platform/gtk/transforms/3d/point-mapping/3d-point-mapping-2-expected.txt:
* LayoutTests/platform/gtk/transforms/3d/point-mapping/3d-point-mapping-4-expected.txt: Added.
* LayoutTests/platform/gtk/transforms/3d/point-mapping/3d-point-mapping-expected.txt:
* LayoutTests/platform/ios/transforms/3d/point-mapping/3d-point-mapping-2-expected.txt:
* LayoutTests/platform/ios/transforms/3d/point-mapping/3d-point-mapping-4-expected.txt: Added.
* LayoutTests/platform/ios/transforms/3d/point-mapping/3d-point-mapping-expected.txt:
* LayoutTests/platform/mac/transforms/3d/point-mapping/3d-point-mapping-2-expected.txt:
* LayoutTests/platform/mac/transforms/3d/point-mapping/3d-point-mapping-4-expected.png: Added.
* LayoutTests/platform/mac/transforms/3d/point-mapping/3d-point-mapping-4-expected.txt: Added.
* LayoutTests/platform/mac/transforms/3d/point-mapping/3d-point-mapping-expected.txt:
* LayoutTests/transforms/3d/point-mapping/3d-point-mapping-3.html:
* LayoutTests/transforms/3d/point-mapping/3d-point-mapping-4.html: Copied from LayoutTests/transforms/3d/point-mapping/3d-point-mapping-3.html.A

New test with spacers around preserve-3d, and confirming that point mapping works correctly.

* LayoutTests/transforms/3d/point-mapping/3d-point-mapping.html:
* LayoutTests/transforms/3d/preserve-3d-not-applied-to-ancestors-expected.txt:

Fixed due to supporting flattening on the right 'side' regardless of which order transforms are pushed to the
TransformState (innermost to outermost, or outermost to innermost).

* Source/WebCore/platform/graphics/transforms/TransformState.cpp:
(WebCore::TransformState::operator=):
(WebCore::TransformState::move):
(WebCore::TransformState::shouldFlattenBefore):
(WebCore::TransformState::shouldFlattenAfter):
(WebCore::TransformState::applyTransform):
* Source/WebCore/platform/graphics/transforms/TransformState.h:
(WebCore::TransformState::TransformState):
* Source/WebCore/rendering/LayerOverlapMap.cpp:
(WebCore::LayerOverlapMap::LayerOverlapMap):
* Source/WebCore/rendering/RenderGeometryMap.cpp:
(WebCore::RenderGeometryMap::RenderGeometryMap):
(WebCore::RenderGeometryMap::mapToContainer const):
* Source/WebCore/rendering/RenderGeometryMap.h:
* Source/WebCore/rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateLayerPositionsAfterLayout):
(WebCore::RenderLayer::updateLayerPositionsAfterOverflowScroll):
(WebCore::RenderLayer::updateLayerPositionsAfterDocumentScroll):
* Source/WebCore/rendering/RenderObject.cpp:
(WebCore::RenderObject::localToAbsolute const):
(WebCore::RenderObject::absoluteToLocal const):
(WebCore::RenderObject::absoluteToLocalQuad const):
(WebCore::RenderObject::pushOntoTransformState const):
(WebCore::RenderObject::pushOntoGeometryMap const):
(WebCore::RenderObject::localToContainerQuad const):
(WebCore::RenderObject::localToContainerPoint const):
(WebCore::RenderObject::participatesInPreserve3D const):
* Source/WebCore/rendering/RenderObject.h:
* Source/WebCore/rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::mapLocalToContainer const):
* Source/WebCore/rendering/svg/SVGLayerTransformComputation.h:
(WebCore::SVGLayerTransformComputation::computeAccumulatedTransform const):

Canonical link: https://commits.webkit.org/257432@main




More information about the webkit-changes mailing list