Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 177b2bf532ad755ef536697b9659df5d3801a3b8
      
https://github.com/WebKit/WebKit/commit/177b2bf532ad755ef536697b9659df5d3801a3b8
  Author: Etienne Segonzac <[email protected]>
  Date:   2026-07-19 (Sun, 19 Jul 2026)

  Changed paths:
    M LayoutTests/TestExpectations
    A LayoutTests/spatial-css/spatial-portal-creation-off-expected.txt
    A LayoutTests/spatial-css/spatial-portal-creation-off.html
    A LayoutTests/spatial-css/spatial-portal-graphics-layers-expected.txt
    A LayoutTests/spatial-css/spatial-portal-graphics-layers.html
    M Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml
    M Source/WTF/wtf/PlatformEnable.h
    M Source/WTF/wtf/PlatformEnableCocoa.h
    M Source/WebCore/Headers.cmake
    A Source/WebCore/Modules/model-element/SpatialPortalController.cpp
    A Source/WebCore/Modules/model-element/SpatialPortalController.h
    M Source/WebCore/Sources.txt
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/css/CSSProperties.json
    M Source/WebCore/css/CSSValueKeywords.in
    M Source/WebCore/dom/Element.cpp
    M Source/WebCore/dom/Element.h
    M Source/WebCore/dom/ElementRareData.cpp
    M Source/WebCore/dom/ElementRareData.h
    M Source/WebCore/rendering/RenderBox.cpp
    M Source/WebCore/rendering/RenderLayerCompositor.cpp
    M Source/WebCore/rendering/RenderLayerCompositor.h
    M Source/WebCore/rendering/style/RenderStyleConstants.cpp
    M Source/WebCore/rendering/style/RenderStyleConstants.h
    M Source/WebCore/style/StyleAdjuster.cpp
    M Source/WebCore/style/computed/data/StyleNonInheritedRareData.cpp
    M Source/WebCore/style/computed/data/StyleNonInheritedRareData.h
    M Source/WebCore/style/values/primitives/StyleKeyword+Mappings.h
    M Source/WebKit/SourcesCocoa.txt
    R Source/WebKit/UIProcess/Model/ModelPresentationManagerProxy.h
    R Source/WebKit/UIProcess/Model/ModelPresentationManagerProxy.mm
    A Source/WebKit/UIProcess/Model/PortalPresentationManagerProxy.h
    A Source/WebKit/UIProcess/Model/PortalPresentationManagerProxy.mm
    M Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm
    M Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Source/WebKit/UIProcess/WebPageProxy.h
    M Source/WebKit/UIProcess/WebPageProxyInternals.h
    M Source/WebKit/UIProcess/ios/WKContentView.mm
    M Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
    R Source/WebKit/UIProcess/ios/WKPageHostedModelView.h
    R Source/WebKit/UIProcess/ios/WKPageHostedModelView.mm
    A Source/WebKit/UIProcess/ios/WKPageHostedPortalView.h
    A Source/WebKit/UIProcess/ios/WKPageHostedPortalView.mm
    M Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm
    M Source/WebKit/WebKit.xcodeproj/project.pbxproj
    M Source/cmake/WebKitFeatures.cmake

  Log Message:
  -----------
  Introduce the feature flag/preference/scaffolding for Spatial Portals
https://bugs.webkit.org/show_bug.cgi?id=319671
<rdar://182292632>

Reviewed by Mike Wyrzykowski.

Introduce the compile time `ENABLE_SPATIAL_PORTAL` flag and the
`SpatialPortalEnabled` feature flag to gate CSS Spatial Portals
development.

Add the CSS scaffolding to enable the `spatial: portal` syntax, and
implement the minimal observable change: setting up the 2 compositing
layers structure to render the DOM content "on the glass" and the
upcoming models in a StereoLayer.

Tests: spatial-css/spatial-portal-creation-off.html
       spatial-css/spatial-portal-graphics-layers.html

* LayoutTests/TestExpectations:
* LayoutTests/spatial-css/spatial-portal-creation-off-expected.txt: Added.
* LayoutTests/spatial-css/spatial-portal-creation-off.html: Added.
* LayoutTests/spatial-css/spatial-portal-graphics-layers-expected.txt: Added.
* LayoutTests/spatial-css/spatial-portal-graphics-layers.html: Added.
Add basic layout tests.

* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml:
* Source/WTF/wtf/PlatformEnable.h:
* Source/WTF/wtf/PlatformEnableCocoa.h:
Introduce the flags.

* Source/WebCore/Headers.cmake:
* Source/WebCore/Modules/model-element/SpatialPortalController.cpp: Added.
* Source/WebCore/Modules/model-element/SpatialPortalController.h: Added.
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
Introduce the SpatialPortalController that will manage the portal /
ModelPlayer for `spatial: portal` elements.

* Source/WebCore/css/CSSProperties.json:
* Source/WebCore/css/CSSValueKeywords.in:
Introduce the CSS property and keywords.

* Source/WebCore/dom/Element.cpp:
(WebCore::Element::ensureSpatialPortalController):
(WebCore::Element::spatialPortalController const):
(WebCore::Element::clearSpatialPortalController):
* Source/WebCore/dom/Element.h:
* Source/WebCore/dom/ElementRareData.cpp:
* Source/WebCore/dom/ElementRareData.h:
(WebCore::ElementRareData::spatialPortalController const):
(WebCore::ElementRareData::setSpatialPortalController):
Add SpatialPortalController support to Element.

* Source/WebCore/rendering/RenderBox.cpp:
(WebCore::spatialPortalStyleDidChange):
(WebCore::RenderBox::styleDidChange):
(WebCore::RenderBox::requiresLayer const):
Detect CSS spatial changes, create/destroy the SpatialPortalController
as needed, and force a RenderLayer the `spatial: portal` elements.

* Source/WebCore/rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
(WebCore::RenderLayerCompositor::requiresCompositingLayer const):
(WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
(WebCore::RenderLayerCompositor::reasonsForCompositing const):
(WebCore::compositingReasonToString):
(WebCore::RenderLayerCompositor::requiresCompositingForSpatialPortal const):
(WebCore::RenderLayerCompositor::needsContentsCompositingLayer const):
* Source/WebCore/rendering/RenderLayerCompositor.h:
`spatial: portal` elements require compositing and 2 graphic layers for
the stereo content and the DOM content "on the glass".

* Source/WebCore/rendering/style/RenderStyleConstants.cpp:
(WebCore::operator<<):
* Source/WebCore/rendering/style/RenderStyleConstants.h:
* Source/WebCore/style/StyleAdjuster.cpp:
(WebCore::Style::shouldTreatAutoZIndexAsZero):
* Source/WebCore/style/computed/data/StyleNonInheritedRareData.cpp:
(WebCore::Style::NonInheritedRareData::NonInheritedRareData):
(WebCore::Style::NonInheritedRareData::operator== const):
(WebCore::Style::NonInheritedRareData::dumpDifferences const):
* Source/WebCore/style/computed/data/StyleNonInheritedRareData.h:
* Source/WebCore/style/values/primitives/StyleKeyword+Mappings.h:
`spatial: portal` support in RenderStyle.

* Source/WebKit/SourcesCocoa.txt:
* Source/WebKit/UIProcess/Model/PortalPresentationManagerProxy.h: Renamed from 
Source/WebKit/UIProcess/Model/ModelPresentationManagerProxy.h.
(WebKit::PortalPresentationManagerProxy::create):
* Source/WebKit/UIProcess/Model/PortalPresentationManagerProxy.mm: Renamed from 
Source/WebKit/UIProcess/Model/ModelPresentationManagerProxy.mm.
(WebKit::PortalPresentationManagerProxy::PortalPresentationManagerProxy):
(WebKit::PortalPresentationManagerProxy::setUpModelView):
(WebKit::PortalPresentationManagerProxy::startDragForModel):
(WebKit::PortalPresentationManagerProxy::doneWithCurrentDragSession):
(WebKit::PortalPresentationManagerProxy::pageScaleDidChange):
(WebKit::PortalPresentationManagerProxy::invalidateModel):
(WebKit::PortalPresentationManagerProxy::invalidateAllModels):
(WebKit::PortalPresentationManagerProxy::ensurePortalPresentation):
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::layerWillBeRemoved):
* Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
(WebKit::RemoteLayerTreeHost::makeNode):
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didAttachToRunningProcess):
(WebKit::WebPageProxy::resetState):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/WebPageProxyInternals.h:
* Source/WebKit/UIProcess/ios/WKContentView.mm:
(-[WKContentView _setTransform3DForModelViews:]):
* Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _startDrag:item:nodeID:]):
(-[WKContentView cleanUpDragSourceSessionState]):
* Source/WebKit/UIProcess/ios/WKPageHostedPortalView.h: Renamed from 
Source/WebKit/UIProcess/ios/WKPageHostedModelView.h.
* Source/WebKit/UIProcess/ios/WKPageHostedPortalView.mm: Renamed from 
Source/WebKit/UIProcess/ios/WKPageHostedModelView.mm.
(+[WKPageHostedPortalView _usesStereoContent]):
(-[WKPageHostedPortalView init]):
(-[WKPageHostedPortalView dealloc]):
(-[WKPageHostedPortalView remoteModelView]):
(-[WKPageHostedPortalView setRemoteModelView:]):
(-[WKPageHostedPortalView setShouldDisablePortal:]):
(-[WKPageHostedPortalView applyBackgroundColor:]):
(-[WKPageHostedPortalView layoutSubviews]):
(-[WKPageHostedPortalView setPortalCrossing:]):
* Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::portalPresentationManagerProxy const):
(WebKit::WebPageProxy::modelPresentationManagerProxy const): Deleted.
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:
On the UI Process side, mechanically rename the PageHostedModelView to
PageHostedPortalView. It will be shared between standalone model
elements and `spatial: portal` elements. And intrinsically represents the
portal itself.

* Source/cmake/WebKitFeatures.cmake:
Declare the ENABLE_SPATIAL_PORTAL flag.

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



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

Reply via email to