Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0a2f1dc58ef4988d8790951481df1854c5c3b2fc
      
https://github.com/WebKit/WebKit/commit/0a2f1dc58ef4988d8790951481df1854c5c3b2fc
  Author: Aleksei Marchenko <[email protected]>
  Date:   2026-08-02 (Sun, 02 Aug 2026)

  Changed paths:
    A LayoutTests/spatial-css/resources/spatial-portal-utils.js
    A LayoutTests/spatial-css/spatial-portal-multi-model-error-expected.txt
    A LayoutTests/spatial-css/spatial-portal-multi-model-error.html
    A LayoutTests/spatial-css/spatial-portal-multi-model-expected.txt
    A 
LayoutTests/spatial-css/spatial-portal-multi-model-insert-remove-expected.txt
    A LayoutTests/spatial-css/spatial-portal-multi-model-insert-remove.html
    A LayoutTests/spatial-css/spatial-portal-multi-model-move-expected.txt
    A LayoutTests/spatial-css/spatial-portal-multi-model-move.html
    A 
LayoutTests/spatial-css/spatial-portal-multi-model-source-change-expected.txt
    A
LayoutTests/spatial-css/spatial-portal-multi-model-source-change.html
    A LayoutTests/spatial-css/spatial-portal-multi-model.html
    M LayoutTests/spatial-css/spatial-portal-scroll-to-load.html
    M Source/WebCore/Modules/model-element/HTMLModelElement.cpp
    M Source/WebCore/Modules/model-element/SpatialPortalController.cpp
    M Source/WebCore/Modules/model-element/SpatialPortalController.h
    M Source/WebCore/testing/Internals.cpp
    M Source/WebCore/testing/Internals.h
    M Source/WebCore/testing/Internals.idl
    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/WebKitSwift/RealityKit/WKRKEntity.h
    M Source/WebKit/WebKitSwift/RealityKit/WKRKEntity.swift
    M Source/WebKit/WebProcess/Model/ModelProcessModelPlayer.cpp
    M
Source/WebKit/WebProcess/Model/ModelProcessModelPlayer.h
    M Tools/TestWebKitAPI/Resources/spatial-portal-two-models-page.html

  Log Message:
  -----------
  Implement child model loading IPC for spatial portals
https://bugs.webkit.org/show_bug.cgi?id=320724
rdar://182292429

Reviewed by Etienne Segonzac.

Let a spatial portal host more than one <model> child. SpatialPortalController
tracks its children in a map keyed by NodeIdentifier, loading each one and
routing callbacks back to the right child. The Model process keeps one entity
per node, and a new UnloadModel message removes one without tearing down the
player the other models share.

The container transform fits the union of every hosted model's bounding box.
The first model to load still owns stage mode, animation reporting and the
environment map, so the single-model case is unchanged.

Tests: spatial-css/spatial-portal-multi-model-error.html
      
spatial-css/spatial-portal-multi-model-insert-remove.html
       spatial-css/spatial-portal-multi-model-move.html
       spatial-css/spatial-portal-multi-model-source-change.html
       spatial-css/spatial-portal-multi-model.html

* LayoutTests/spatial-css/resources/spatial-portal-utils.js: Added.
(const.appendModel):
* LayoutTests/spatial-css/spatial-portal-multi-model-error-expected.txt: Added.
* LayoutTests/spatial-css/spatial-portal-multi-model-error.html: Added.
* LayoutTests/spatial-css/spatial-portal-multi-model-expected.txt: Added.
* 
LayoutTests/spatial-css/spatial-portal-multi-model-insert-remove-expected.txt: 
Added.
* LayoutTests/spatial-css/spatial-portal-multi-model-insert-remove.html: Added.
* LayoutTests/spatial-css/spatial-portal-multi-model-move-expected.txt: Added.
* LayoutTests/spatial-css/spatial-portal-multi-model-move.html: Added.
* 
LayoutTests/spatial-css/spatial-portal-multi-model-source-change-expected.txt: 
Added.
*
LayoutTests/spatial-css/spatial-portal-multi-model-source-change.html: Added.
* LayoutTests/spatial-css/spatial-portal-multi-model.html: Added.
* Source/WebCore/Modules/model-element/HTMLModelElement.cpp:
(WebCore::HTMLModelElement::setSourceURL):
* Source/WebCore/Modules/model-element/SpatialPortalController.cpp:
(WebCore::SpatialPortalController::~SpatialPortalController):
(WebCore::SpatialPortalController::hostedModelElement
const):
(WebCore::SpatialPortalController::unregisterChildModel):
(WebCore::SpatialPortalController::registerChildModel):
(WebCore::SpatialPortalController::childModelDidChange):
(WebCore::SpatialPortalController::loadChildModelsIfReady):
(WebCore::SpatialPortalController::loadChildModelIfReady):
(WebCore::SpatialPortalController::viewportIntersectionChanged):
(WebCore::SpatialPortalController::deleteModelPlayer):
(WebCore::SpatialPortalController::unloadChildModel):
(WebCore::SpatialPortalController::configureGraphicsLayer):
(WebCore::SpatialPortalController::modelDidFinishLoading):
(WebCore::SpatialPortalController::modelDidFailLoading):
(WebCore::SpatialPortalController::modelDidUnload):
(WebCore::SpatialPortalController::unloadModel): Deleted.
* Source/WebCore/Modules/model-element/SpatialPortalController.h:
(WebCore::SpatialPortalController::numberOfHostedModels const):
* Source/WebKit/ModelProcess/cocoa/ModelProcessModelPlayerProxy.h:
*
Source/WebKit/ModelProcess/cocoa/ModelProcessModelPlayerProxy.messages.in:
* Source/WebKit/ModelProcess/cocoa/ModelProcessModelPlayerProxy.mm:
(WebKit::ModelProcessModelPlayerProxy::~ModelProcessModelPlayerProxy):
(WebKit::ModelProcessModelPlayerProxy::loadModel):
(WebKit::ModelProcessModelPlayerProxy::reloadModel):
(WebKit::ModelProcessModelPlayerProxy::unloadModelTimerFired):
(WebKit::ModelProcessModelPlayerProxy::computeTransform):
(WebKit::ModelProcessModelPlayerProxy::updateTransform):
(WebKit::ModelProcessModelPlayerProxy::updateOpacity):
(WebKit::ModelProcessModelPlayerProxy::didFinishLoading):
(WebKit::ModelProcessModelPlayerProxy::didFailLoading):
(WebKit::ModelProcessModelPlayerProxy::load):
(WebKit::ModelProcessModelPlayerProxy::unloadModel):
(WebKit::ModelProcessModelPlayerProxy::clearReportingModelIfNeeded):
(WebKit::ModelProcessModelPlayerProxy::reportingModelScale
const):
(WebKit::ModelProcessModelPlayerProxy::findHostedEntityForLoader):
(WebKit::ModelProcessModelPlayerProxy::cancelAllLoaders):
(WebKit::ModelProcessModelPlayerProxy::setUpLoadedEntity):
(WebKit::ModelProcessModelPlayerProxy::sizeDidChange):
(WebKit::ModelProcessModelPlayerProxy::updateForCurrentStageMode):
(WebKit::ModelProcessModelPlayerProxy::updateTransformSRT):
(WebKit::ModelProcessModelPlayerProxy::teardownEntity):
(WebKit::ModelProcessModelPlayerProxy::ensureImmersivePresentation):
(WebKit::ModelProcessModelPlayerProxy::exitImmersivePresentation):
(WebKit::ModelProcessModelPlayerProxy::startAnimating): Deleted.
* Source/WebKit/WebKitSwift/RealityKit/WKRKEntity.h:
* Source/WebKit/WebKitSwift/RealityKit/WKRKEntity.swift:
(WKRKEntity.removeFromParentEntity):
* Source/WebKit/WebProcess/Model/ModelProcessModelPlayer.cpp:
(WebKit::ModelProcessModelPlayer::unload):
* Source/WebKit/WebProcess/Model/ModelProcessModelPlayer.h:
*
Tools/TestWebKitAPI/Resources/spatial-portal-two-models-page.html:

Canonical link: 
https://flagged.apple.com:443/proxy?t2=DR3P5j2ra7&o=aHR0cHM6Ly9jb21taXRzLndlYmtpdC5vcmcvMzE4NDA2QG1haW4=&emid=72dbdfce-e6f8-4750-9fd4-25b4fc69c967&c=11



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

Reply via email to