[webkit-changes] [WebKit/WebKit] 77f023: [visionOS] Introduce experimental controls API for...

Commit Queue noreply at github.com
Fri Oct 18 20:05:55 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 77f02397ad6c9e34e93941a9967b2d6c21e4c1a7
      https://github.com/WebKit/WebKit/commit/77f02397ad6c9e34e93941a9967b2d6c21e4c1a7
  Author: Yoel Hawa <yoel at apple.com>
  Date:   2024-10-18 (Fri, 18 Oct 2024)

  Changed paths:
    M LayoutTests/TestExpectations
    A LayoutTests/fast/images/resources/spatial.heic
    A LayoutTests/fast/images/spatial-image-controls-expected.html
    A LayoutTests/fast/images/spatial-image-controls.html
    M Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml
    M Source/WTF/wtf/PlatformEnableCocoa.h
    M Source/WebCore/DerivedSources-input.xcfilelist
    M Source/WebCore/DerivedSources.make
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/html/HTMLButtonElement.cpp
    M Source/WebCore/html/HTMLImageElement.cpp
    M Source/WebCore/html/HTMLImageElement.idl
    A Source/WebCore/html/shadow/SpatialImageControls.cpp
    A Source/WebCore/html/shadow/SpatialImageControls.h
    A Source/WebCore/html/shadow/spatialImageControls.css
    M Source/WebCore/loader/ImageLoader.cpp
    M Source/WebCore/rendering/RenderImage.cpp

  Log Message:
  -----------
  [visionOS] Introduce experimental controls API for spatial images
https://bugs.webkit.org/show_bug.cgi?id=281347
<rdar://134260482>

Reviewed by Ryosuke Niwa.

Introduce an experimental feature flag for a declarative API for
viewing spatial photos on the web, by adding a `controls` attribute on
the `<img>` element. When enabled and used, this should add a button
only to a spatial photo that when tapped brings the image into
fullscreen to be viewed spatially.

* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml:
* Source/WTF/wtf/PlatformEnableCocoa.h:
Add the experimental feature flag.

* Source/WebCore/DerivedSources-input.xcfilelist:
* Source/WebCore/DerivedSources.make:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/dom/SpatialImageControls.cpp: Added.
(WebCore::SpatialImageControls::spatialImageControlsElementIdentifier):
(WebCore::SpatialImageControls::spatialImageControlsButtonIdentifier):
(WebCore::SpatialImageControls::hasSpatialImageControls):
(WebCore::SpatialImageControls::spatialImageControlsHost):
(WebCore::SpatialImageControls::isSpatialImageControlsButtonElement):
(WebCore::SpatialImageControls::shouldHaveSpatialControls):
(WebCore::SpatialImageControls::addShadowRootForSpatialImageControls):
(WebCore::SpatialImageControls::ensureSpatialControls):
(WebCore::SpatialImageControls::handleEvent):
(WebCore::SpatialImageControls::destroySpatialImageControls):
(WebCore::SpatialImageControls::updateSpatialImageControls):
* Source/WebCore/dom/SpatialImageControls.h: Added.
* Source/WebCore/html/HTMLButtonElement.cpp:
(WebCore::HTMLButtonElement::defaultEventHandler):
* Source/WebCore/html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::attributeChanged):
(WebCore::HTMLImageElement::didAttachRenderers):
(WebCore::HTMLImageElement::didAddUserAgentShadowRoot):
* Source/WebCore/html/HTMLImageElement.h:
* Source/WebCore/html/HTMLImageElement.idl:
* Source/WebCore/html/shadow/spatialImageControls.css: Added.
(#if defined(ENABLE_SPATIAL_IMAGE_CONTROLS) && ENABLE_SPATIAL_IMAGE_CONTROLS):
* Source/WebCore/loader/ImageLoader.cpp:
(WebCore::ImageLoader::notifyFinished):
* Source/WebCore/rendering/RenderImage.cpp:
Implement functionality for `controls` attribute on `<img>` element.

* LayoutTests/TestExpectations:
* LayoutTests/fast/images/resources/spatial.heic: Added.
* LayoutTests/fast/images/spatial-image-controls-expected.html: Added.
* LayoutTests/fast/images/spatial-image-controls.html: Added.
Add new layout tests.

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



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


More information about the webkit-changes mailing list