Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 051c3dbad0e7886fdd233ce3fac5bdfe1d967a8c
      
https://github.com/WebKit/WebKit/commit/051c3dbad0e7886fdd233ce3fac5bdfe1d967a8c
  Author: Etienne Segonzac <[email protected]>
  Date:   2026-09-10 (Thu, 10 Sep 2026)

  Changed paths:
    M LayoutTests/spatial-css/resources/spatial-portal-utils.js
    M 
LayoutTests/spatial-css/spatial-portal-action-requires-auto-transform-expected.txt
    M LayoutTests/spatial-css/spatial-portal-action-requires-auto-transform.html
    A LayoutTests/spatial-css/spatial-portal-transform-expected.txt
    M LayoutTests/spatial-css/spatial-portal-transform-off-expected.txt
    M LayoutTests/spatial-css/spatial-portal-transform-off.html
    M LayoutTests/spatial-css/spatial-portal-transform-parsing-expected.txt
    M LayoutTests/spatial-css/spatial-portal-transform-parsing.html
    A LayoutTests/spatial-css/spatial-portal-transform-transition-expected.txt
    A LayoutTests/spatial-css/spatial-portal-transform-transition.html
    A LayoutTests/spatial-css/spatial-portal-transform.html
    M Source/WebCore/Modules/model-element/ModelPlayer.cpp
    M Source/WebCore/Modules/model-element/ModelPlayer.h
    M Source/WebCore/Modules/model-element/PortalTransform.h
    M Source/WebCore/Modules/model-element/SpatialPortalController.cpp
    M Source/WebCore/Modules/model-element/SpatialPortalController.h
    M Source/WebCore/css/CSSProperties.json
    M Source/WebCore/css/parser/CSSPropertyParserConsumer+Transform.cpp
    M Source/WebCore/css/parser/CSSPropertyParserConsumer+Transform.h
    M Source/WebCore/rendering/RenderBox.cpp
    M Source/WebCore/style/values/transforms/StylePortalTransform.cpp
    M Source/WebCore/style/values/transforms/StylePortalTransform.h
    M Source/WebKit/ModelProcess/cocoa/ModelProcessModelPlayerProxy.h
    M Source/WebKit/ModelProcess/cocoa/ModelProcessModelPlayerProxy.messages.in
    M Source/WebKit/ModelProcess/cocoa/ModelProcessModelPlayerProxy.mm
    M Source/WebKit/Scripts/webkit/messages.py
    M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in
    M Source/WebKit/WebProcess/Model/ModelProcessModelPlayer.cpp
    M Source/WebKit/WebProcess/Model/ModelProcessModelPlayer.h
    M Source/WebKit/WebProcess/WebPage/Cocoa/PositionInformationForWebPage.mm

  Log Message:
  -----------
  Complete the `portal-transform` support
https://bugs.webkit.org/show_bug.cgi?id=321849
<rdar://182292652>

Reviewed by Antti Koivisto and Sam Weinig.

Add support for transform-lists in `portal-transform`. We only supported
none / auto previously.
But the spec proposal is
> none | auto | auto? <transform-list> | <transform-list> auto <transform-list>?

This property is now also animatable.

Tests: spatial-css/spatial-portal-transform-parsing.html
       spatial-css/spatial-portal-transform-transition.html
       spatial-css/spatial-portal-transform.html

* LayoutTests/spatial-css/resources/spatial-portal-utils.js:
(const.assert_3d_matrix_is_uniform_scale_and_translation):
(const.resolvedTransformForPortal.async test):
(const.resolvedTransformForPortal):
* 
LayoutTests/spatial-css/spatial-portal-action-requires-auto-transform-expected.txt:
* LayoutTests/spatial-css/spatial-portal-action-requires-auto-transform.html:
* LayoutTests/spatial-css/spatial-portal-transform-expected.txt: Added.
* LayoutTests/spatial-css/spatial-portal-transform-off-expected.txt:
* LayoutTests/spatial-css/spatial-portal-transform-off.html:
* LayoutTests/spatial-css/spatial-portal-transform-parsing-expected.txt:
* LayoutTests/spatial-css/spatial-portal-transform-parsing.html:
* LayoutTests/spatial-css/spatial-portal-transform-transition-expected.txt: 
Added.
* LayoutTests/spatial-css/spatial-portal-transform-transition.html: Added.
* LayoutTests/spatial-css/spatial-portal-transform.html: Added.
Complete the existing tests for the new supported syntax and introduce
new tests covering the global transform computation based on the `auto`
position and animations.

* Source/WebCore/Modules/model-element/ModelPlayer.cpp:
(WebCore::ModelPlayer::setPortalTransform):
* Source/WebCore/Modules/model-element/ModelPlayer.h:
* Source/WebCore/Modules/model-element/PortalTransform.h:
(WebCore::UsedPortalTransform::contentTransform const):
(WebCore::UsedPortalTransform::hasContentTransform const):
* Source/WebCore/Modules/model-element/SpatialPortalController.cpp:
(WebCore::SpatialPortalController::updatePortalTransform):
(WebCore::SpatialPortalController::sizeMayHaveChanged):
(WebCore::SpatialPortalController::setPortalTransform): Deleted.
* Source/WebCore/Modules/model-element/SpatialPortalController.h:
* Source/WebKit/ModelProcess/cocoa/ModelProcessModelPlayerProxy.h:
* Source/WebKit/ModelProcess/cocoa/ModelProcessModelPlayerProxy.messages.in:
Upgrade the PortalTransform type from a simple enum to a struct
encoding:
- the 2 transforms (before or after auto fit)
- the auto fit status

* Source/WebCore/css/CSSProperties.json:
* Source/WebCore/css/parser/CSSPropertyParserConsumer+Transform.cpp:
(WebCore::CSSPropertyParserHelpers::appendTransformFunctions):
(WebCore::CSSPropertyParserHelpers::consumePortalTransform):
(WebCore::CSSPropertyParserHelpers::flattenTransformListValues):
* Source/WebCore/css/parser/CSSPropertyParserConsumer+Transform.h:
* Source/WebCore/rendering/RenderBox.cpp:
(WebCore::usedPortalActionKind):
(WebCore::pushSpatialPortalProperties):
(WebCore::portalTransformKind): Deleted.
(WebCore::updateSpatialPortalController):
(WebCore::RenderBox::styleDidChange):
* Source/WebCore/style/values/transforms/StylePortalTransform.cpp:
(WebCore::Style::transformListSlice):
(WebCore::Style::isAutoKeyword):
(WebCore::Style::CSSValueConversion<PortalTransform>::operator):
(WebCore::Style::appendTransformFunctionValues):
(WebCore::Style::CSSValueCreation<PortalTransform>::operator):
(WebCore::Style::Serialize<PortalTransform>::operator):
(WebCore::Style::Blending<PortalTransform>::hasMatchingAutoFit):
(WebCore::Style::Blending<PortalTransform>::canBlend):
(WebCore::Style::Blending<PortalTransform>::blend):
(WebCore::Style::operator<<):
(WebCore::Style::hasMatchingAutoFit):
(WebCore::Style::emptyTransformList):
(WebCore::Style::PortalTransform::withAutoFit):
(WebCore::Style::PortalTransform::withoutAutoFit):
(WebCore::Style::PortalTransform::hasAuto const):
(WebCore::Style::PortalTransform::beforeAutoList const):
(WebCore::Style::PortalTransform::afterAutoList const):
(WebCore::Style::PortalTransform::applyBeforeAuto const):
(WebCore::Style::PortalTransform::applyAfterAuto const):
* Source/WebCore/style/values/transforms/StylePortalTransform.h:
(WebCore::Style::PortalTransform::PortalTransform):
(WebCore::Style::PortalTransform::hasAuto const):
(WebCore::Style::PortalTransform::isNone const):
(WebCore::Style::PortalTransform::applyBeforeAuto const):
(WebCore::Style::PortalTransform::applyAfterAuto const):
(WebCore::Style::Blending<PortalTransform>::requiresInterpolationForAccumulativeIteration):
(WebCore::Style::PortalTransform::switchOn const): Deleted.
(WebCore::Style::PortalTransform::withAutoFit):
(WebCore::Style::PortalTransform::withoutAutoFit):
(WebCore::Style::get):
Update the parser for `portal-transform` to support the full syntax and
make it blend-able (animation support).

* Source/WebKit/ModelProcess/cocoa/ModelProcessModelPlayerProxy.mm:
(WebKit::transformBoundingBox):
(WebKit::maximumScale):
(WebKit::ModelProcessModelPlayerProxy::computeTransform):
(WebKit::ModelProcessModelPlayerProxy::notifyModelPlayerOfTransformChange):
(WebKit::ModelProcessModelPlayerProxy::updateTransform):
(WebKit::ModelProcessModelPlayerProxy::setPortalTransform):
(WebKit::ModelProcessModelPlayerProxy::modelStandardizedTransformSRT const):
(WebKit::ModelProcessModelPlayerProxy::modelLocalizedTransformSRT const):
(WebKit::contentTransformedEntitySRT):
(WebKit::ModelProcessModelPlayerProxy::contentTransformMatrix const):
(WebKit::ModelProcessModelPlayerProxy::modelStandardizedTransformSRT): Deleted.
(WebKit::ModelProcessModelPlayerProxy::modelLocalizedTransformSRT): Deleted.
(WebKit::ModelProcessModelPlayerProxy::childEntityTransformSRT const):
* Source/WebKit/Scripts/webkit/messages.py:
(headers_for_type):
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
* Source/WebKit/WebProcess/Model/ModelProcessModelPlayer.cpp:
(WebKit::ModelProcessModelPlayer::setPortalTransform):
* Source/WebKit/WebProcess/Model/ModelProcessModelPlayer.h:
Update the `ModelProcessModelPlayer` to support all
`portal-transform` values when computing the final global transform.

* Source/WebKit/WebProcess/WebPage/Cocoa/PositionInformationForWebPage.mm:
(WebKit::positionInformationForWebPage):
Drive-by style fix.

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to