Skip to content
Permalink
Browse files
[Model] clean up compile-time flags and condition IDL methods behind …
…them

https://bugs.webkit.org/show_bug.cgi?id=233407

Reviewed by Tim Horton.

Source/WebCore:

We condition the availability of IDL methods recently added to HTMLModelElement by
the new set of ENABLE_MODEL_ELEMENT_XXX_CONTROL flags.

* Modules/model-element/HTMLModelElement.cpp:
* Modules/model-element/HTMLModelElement.h:
* Modules/model-element/HTMLModelElement.idl:
* Modules/model-element/ModelPlayer.h:
* Modules/model-element/dummy/DummyModelPlayer.cpp:
* Modules/model-element/dummy/DummyModelPlayer.h:
* Modules/model-element/scenekit/SceneKitModelPlayer.h:
* Modules/model-element/scenekit/SceneKitModelPlayer.mm:

Source/WebCore/PAL:

We adopt the changes made to flags in wtf/PlatformEnableCocoa.h and wtf/PlatformHave.h.
We also remove the use of existing flags in QuartzCoreSPI.h since they're not actually
valid.

* pal/spi/cocoa/QuartzCoreSPI.h:
* pal/spi/ios/SystemPreviewSPI.h:
* pal/spi/mac/SystemPreviewSPI.h:

Source/WebKit:

On top of adopting the changes made to flags in wtf/PlatformEnableCocoa.h and wtf/PlatformHave.h,
we condition the definition of code related to IDL methods recently added to HTMLModelElement by
the new set of ENABLE_MODEL_ELEMENT_XXX_CONTROL flags, uncluding WebPageProxy messages allowing
for this feature to work.

* Shared/ModelIdentifier.h:
(WebKit::ModelIdentifier::encode const):
(WebKit::ModelIdentifier::decode):
* UIProcess/Cocoa/ModelElementControllerCocoa.mm:
(WebKit::previewHasCameraSupport):
(WebKit::ModelElementController::getCameraForModelElement):
(WebKit::ModelElementController::setCameraForModelElement):
(WebKit::previewHasAnimationSupport):
(WebKit::ModelElementController::isPlayingAnimationForModelElement):
(WebKit::ModelElementController::setAnimationIsPlayingForModelElement):
(WebKit::ModelElementController::isLoopingAnimationForModelElement):
(WebKit::ModelElementController::setIsLoopingAnimationForModelElement):
(WebKit::ModelElementController::animationDurationForModelElement):
(WebKit::ModelElementController::animationCurrentTimeForModelElement):
(WebKit::ModelElementController::setAnimationCurrentTimeForModelElement):
(WebKit::previewHasAudioSupport):
(WebKit::ModelElementController::hasAudioForModelElement):
(WebKit::ModelElementController::isMutedForModelElement):
(WebKit::ModelElementController::setIsMutedForModelElement):
* UIProcess/ModelElementController.h:
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
(WebKit::RemoteLayerTreeHost::makeNode):
* UIProcess/WebPageProxy.cpp:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/WKModelInteractionGestureRecognizer.h:
* UIProcess/ios/WKModelInteractionGestureRecognizer.mm:
* UIProcess/ios/WKModelView.h:
* UIProcess/ios/WKModelView.mm:
* WebProcess/Model/ARKitInlinePreviewModelPlayer.h:
* WebProcess/Model/ARKitInlinePreviewModelPlayer.mm:
* WebProcess/Model/WebModelPlayerProvider.cpp:
(WebKit::WebModelPlayerProvider::createModelPlayer):
* WebProcess/Model/ios/ARKitInlinePreviewModelPlayerIOS.h:
* WebProcess/Model/ios/ARKitInlinePreviewModelPlayerIOS.mm:
* WebProcess/Model/mac/ARKitInlinePreviewModelPlayerMac.h:
* WebProcess/Model/mac/ARKitInlinePreviewModelPlayerMac.mm:
(WebKit::ARKitInlinePreviewModelPlayerMac::supportsMouseInteraction):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::setWebsiteDataStoreParameters):

Source/WTF:

We refactor and augment the flags related to the <model> element. First, we change the
following existing flags from ENABLE to HAVE since they are about the availability of
specific APIs in ARKit, and more specific ASVInlinePreview. The changes are as follows:

    ENABLE_ARKIT_INLINE_PREVIEW_IOS => HAVE_ASV_INLINE_PREVIEW_IOS
    ENABLE_ARKIT_INLINE_PREVIEW_MAC => HAVE_ASV_INLINE_PREVIEW_MAC
    ENABLE_ARKIT_INLINE_PREVIEW_CAMERA_TRANSFORM => HAVE_ASV_INLINE_PREVIEW_CAMERA_CONTROL
    ENABLE_ARKIT_INLINE_PREVIEW_ANIMATIONS_CONTROL => HAVE_ASV_INLINE_PREVIEW_ANIMATION_CONTROL
    ENABLE_ARKIT_INLINE_PREVIEW_AUDIO_CONTROL => HAVE_ASV_INLINE_PREVIEW_AUDIO_CONTROL

We retain the ENABLE_ARKIT_INLINE_PREVIEW flag however as, even when the ASVInlinePreview API is
available, we may elect to not use this API.

Then, we add three new flags to specify whether some <model> features exposed to the Web are enabled,
all currently conditioned by the matching HAVE_ASV_INLINE_PREVIEW_ flags, but those could be subject
to more complex rules when other <model> backends expose supporting APIs for these features.

    ENABLE_MODEL_ELEMENT_CAMERA_CONTROL
    ENABLE_MODEL_ELEMENT_ANIMATION_CONTROL
    ENABLE_MODEL_ELEMENT_AUDIO_CONTROL

Finally, we modify the macOS version used to define the HAVE_ASV_INLINE_PREVIEW_XXX_CONTROL flags.

* wtf/PlatformEnableCocoa.h:
* wtf/PlatformHave.h:


Canonical link: https://commits.webkit.org/244608@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@286227 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
graouts committed Nov 29, 2021
1 parent 7f15a95 commit f4e6767f2e4ee5d39b2306967d06f0d6fc19d26f
Showing with 309 additions and 93 deletions.
  1. +33 −0 Source/WTF/ChangeLog
  2. +8 −10 Source/WTF/wtf/PlatformEnableCocoa.h
  3. +15 −2 Source/WTF/wtf/PlatformHave.h
  4. +19 −0 Source/WebCore/ChangeLog
  5. +6 −0 Source/WebCore/Modules/model-element/HTMLModelElement.cpp
  6. +8 −0 Source/WebCore/Modules/model-element/HTMLModelElement.h
  7. +13 −13 Source/WebCore/Modules/model-element/HTMLModelElement.idl
  8. +6 −0 Source/WebCore/Modules/model-element/ModelPlayer.h
  9. +6 −0 Source/WebCore/Modules/model-element/dummy/DummyModelPlayer.cpp
  10. +6 −0 Source/WebCore/Modules/model-element/dummy/DummyModelPlayer.h
  11. +6 −0 Source/WebCore/Modules/model-element/scenekit/SceneKitModelPlayer.h
  12. +6 −0 Source/WebCore/Modules/model-element/scenekit/SceneKitModelPlayer.mm
  13. +15 −0 Source/WebCore/PAL/ChangeLog
  14. +0 −4 Source/WebCore/PAL/pal/spi/cocoa/QuartzCoreSPI.h
  15. +2 −2 Source/WebCore/PAL/pal/spi/ios/SystemPreviewSPI.h
  16. +3 −3 Source/WebCore/PAL/pal/spi/mac/SystemPreviewSPI.h
  17. +53 −0 Source/WebKit/ChangeLog
  18. +7 −7 Source/WebKit/Shared/ModelIdentifier.h
  19. +34 −23 Source/WebKit/UIProcess/Cocoa/ModelElementControllerCocoa.mm
  20. +11 −5 Source/WebKit/UIProcess/ModelElementController.h
  21. +2 −2 Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm
  22. +8 −2 Source/WebKit/UIProcess/WebPageProxy.cpp
  23. +8 −2 Source/WebKit/UIProcess/WebPageProxy.h
  24. +7 −3 Source/WebKit/UIProcess/WebPageProxy.messages.in
  25. +1 −1 Source/WebKit/UIProcess/ios/WKModelInteractionGestureRecognizer.h
  26. +1 −1 Source/WebKit/UIProcess/ios/WKModelInteractionGestureRecognizer.mm
  27. +1 −1 Source/WebKit/UIProcess/ios/WKModelView.h
  28. +1 −1 Source/WebKit/UIProcess/ios/WKModelView.mm
  29. +6 −0 Source/WebKit/WebProcess/Model/ARKitInlinePreviewModelPlayer.h
  30. +6 −0 Source/WebKit/WebProcess/Model/ARKitInlinePreviewModelPlayer.mm
  31. +4 −4 Source/WebKit/WebProcess/Model/WebModelPlayerProvider.cpp
  32. +1 −1 Source/WebKit/WebProcess/Model/ios/ARKitInlinePreviewModelPlayerIOS.h
  33. +1 −1 Source/WebKit/WebProcess/Model/ios/ARKitInlinePreviewModelPlayerIOS.mm
  34. +1 −1 Source/WebKit/WebProcess/Model/mac/ARKitInlinePreviewModelPlayerMac.h
  35. +2 −2 Source/WebKit/WebProcess/Model/mac/ARKitInlinePreviewModelPlayerMac.mm
  36. +2 −2 Source/WebKit/WebProcess/WebProcess.cpp
@@ -1,3 +1,36 @@
2021-11-24 Antoine Quint <graouts@webkit.org>

[Model] clean up compile-time flags and condition IDL methods behind them
https://bugs.webkit.org/show_bug.cgi?id=233407

Reviewed by Tim Horton.

We refactor and augment the flags related to the <model> element. First, we change the
following existing flags from ENABLE to HAVE since they are about the availability of
specific APIs in ARKit, and more specific ASVInlinePreview. The changes are as follows:

ENABLE_ARKIT_INLINE_PREVIEW_IOS => HAVE_ASV_INLINE_PREVIEW_IOS
ENABLE_ARKIT_INLINE_PREVIEW_MAC => HAVE_ASV_INLINE_PREVIEW_MAC
ENABLE_ARKIT_INLINE_PREVIEW_CAMERA_TRANSFORM => HAVE_ASV_INLINE_PREVIEW_CAMERA_CONTROL
ENABLE_ARKIT_INLINE_PREVIEW_ANIMATIONS_CONTROL => HAVE_ASV_INLINE_PREVIEW_ANIMATION_CONTROL
ENABLE_ARKIT_INLINE_PREVIEW_AUDIO_CONTROL => HAVE_ASV_INLINE_PREVIEW_AUDIO_CONTROL

We retain the ENABLE_ARKIT_INLINE_PREVIEW flag however as, even when the ASVInlinePreview API is
available, we may elect to not use this API.

Then, we add three new flags to specify whether some <model> features exposed to the Web are enabled,
all currently conditioned by the matching HAVE_ASV_INLINE_PREVIEW_ flags, but those could be subject
to more complex rules when other <model> backends expose supporting APIs for these features.

ENABLE_MODEL_ELEMENT_CAMERA_CONTROL
ENABLE_MODEL_ELEMENT_ANIMATION_CONTROL
ENABLE_MODEL_ELEMENT_AUDIO_CONTROL

Finally, we modify the macOS version used to define the HAVE_ASV_INLINE_PREVIEW_XXX_CONTROL flags.

* wtf/PlatformEnableCocoa.h:
* wtf/PlatformHave.h:

2021-11-29 Youenn Fablet <youenn@apple.com>

Apply WebPreferences on ServiceWorker settings
@@ -736,20 +736,18 @@
#define ENABLE_PREDEFINED_COLOR_SPACE_DISPLAY_P3 1
#endif

#if PLATFORM(IOS_FAMILY) && HAVE(ASV_INLINE_PREVIEW) && !ENABLE(SEPARATED_MODEL)
#define ENABLE_ARKIT_INLINE_PREVIEW_IOS 1
#if !defined(ENABLE_ARKIT_INLINE_PREVIEW) && HAVE(ASV_INLINE_PREVIEW) && !ENABLE(SEPARATED_MODEL)
#define ENABLE_ARKIT_INLINE_PREVIEW 1
#endif

#if PLATFORM(MAC) && HAVE(ASV_INLINE_PREVIEW)
#define ENABLE_ARKIT_INLINE_PREVIEW_MAC 1
#if !defined(ENABLE_MODEL_ELEMENT_CAMERA_CONTROL) && HAVE(ASV_INLINE_PREVIEW_CAMERA_CONTROL)
#define ENABLE_MODEL_ELEMENT_CAMERA_CONTROL 1
#endif

#if ENABLE(ARKIT_INLINE_PREVIEW_IOS) || ENABLE(ARKIT_INLINE_PREVIEW_MAC)
#define ENABLE_ARKIT_INLINE_PREVIEW 1
#if !defined(ENABLE_MODEL_ELEMENT_ANIMATION_CONTROL) && HAVE(ASV_INLINE_PREVIEW_ANIMATION_CONTROL)
#define ENABLE_MODEL_ELEMENT_ANIMATION_CONTROL 1
#endif

#if (ENABLE(ARKIT_INLINE_PREVIEW_MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 120400) || (ENABLE(ARKIT_INLINE_PREVIEW_IOS) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 150400)
#define ENABLE_ARKIT_INLINE_PREVIEW_CAMERA_TRANSFORM 1
#define ENABLE_ARKIT_INLINE_PREVIEW_ANIMATIONS_CONTROL 1
#define ENABLE_ARKIT_INLINE_PREVIEW_AUDIO_CONTROL 1
#if !defined(ENABLE_MODEL_ELEMENT_AUDIO_CONTROL) && HAVE(ASV_INLINE_PREVIEW_AUDIO_CONTROL)
#define ENABLE_MODEL_ELEMENT_AUDIO_CONTROL 1
#endif
@@ -957,11 +957,24 @@
#endif

#if (PLATFORM(IOS) && !PLATFORM(IOS_SIMULATOR) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 150000) \
|| (PLATFORM(MACCATALYST) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 150000) \
|| (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 120000)
|| (PLATFORM(MACCATALYST) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 150000)
#define HAVE_ASV_INLINE_PREVIEW_IOS 1
#endif

#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 120000)
#define HAVE_ASV_INLINE_PREVIEW_MAC 1
#endif

#if HAVE(ASV_INLINE_PREVIEW_IOS) || HAVE(ASV_INLINE_PREVIEW_MAC)
#define HAVE_ASV_INLINE_PREVIEW 1
#endif

#if (HAVE(ASV_INLINE_PREVIEW_MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 120300) || (HAVE(ASV_INLINE_PREVIEW_IOS) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 150400)
#define HAVE_ASV_INLINE_PREVIEW_CAMERA_CONTROL 1
#define HAVE_ASV_INLINE_PREVIEW_ANIMATION_CONTROL 1
#define HAVE_ASV_INLINE_PREVIEW_AUDIO_CONTROL 1
#endif

#if PLATFORM(IOS) || PLATFORM(MACCATALYST) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000)
#define HAVE_NSURLPROTOCOL_WITH_SKIPAPPSSO 1
#endif
@@ -1,3 +1,22 @@
2021-11-24 Antoine Quint <graouts@webkit.org>

[Model] clean up compile-time flags and condition IDL methods behind them
https://bugs.webkit.org/show_bug.cgi?id=233407

Reviewed by Tim Horton.

We condition the availability of IDL methods recently added to HTMLModelElement by
the new set of ENABLE_MODEL_ELEMENT_XXX_CONTROL flags.

* Modules/model-element/HTMLModelElement.cpp:
* Modules/model-element/HTMLModelElement.h:
* Modules/model-element/HTMLModelElement.idl:
* Modules/model-element/ModelPlayer.h:
* Modules/model-element/dummy/DummyModelPlayer.cpp:
* Modules/model-element/dummy/DummyModelPlayer.h:
* Modules/model-element/scenekit/SceneKitModelPlayer.h:
* Modules/model-element/scenekit/SceneKitModelPlayer.mm:

2021-11-29 Antti Koivisto <antti@apple.com>

[:has() pseudo-class] id invalidation support
@@ -358,6 +358,7 @@ void HTMLModelElement::dragDidEnd(MouseEvent& event)

// MARK: - Camera support.

#if ENABLE(MODEL_ELEMENT_CAMERA_CONTROL)
void HTMLModelElement::getCamera(CameraPromise&& promise)
{
if (!m_modelPlayer) {
@@ -387,9 +388,11 @@ void HTMLModelElement::setCamera(HTMLModelElementCamera camera, DOMPromiseDeferr
promise.reject();
});
}
#endif // ENABLE(MODEL_ELEMENT_CAMERA_CONTROL)

// MARK: - Animations support.

#if ENABLE(MODEL_ELEMENT_ANIMATION_CONTROL)
void HTMLModelElement::isPlayingAnimation(IsPlayingAnimationPromise&& promise)
{
if (!m_modelPlayer) {
@@ -504,9 +507,11 @@ void HTMLModelElement::setAnimationCurrentTime(double currentTime, DOMPromiseDef
promise.reject();
});
}
#endif // ENABLE(MODEL_ELEMENT_ANIMATION_CONTROL)

// MARK: - Audio support.

#if ENABLE(MODEL_ELEMENT_AUDIO_CONTROL)
void HTMLModelElement::hasAudio(HasAudioPromise&& promise)
{
if (!m_modelPlayer) {
@@ -551,6 +556,7 @@ void HTMLModelElement::setIsMuted(bool isMuted, DOMPromiseDeferred<void>&& promi
promise.reject();
});
}
#endif // ENABLE(MODEL_ELEMENT_AUDIO_CONTROL)

}

@@ -70,10 +70,13 @@ class HTMLModelElement final : public HTMLElement, private CachedRawResourceClie

void enterFullscreen();

#if ENABLE(MODEL_ELEMENT_CAMERA_CONTROL)
using CameraPromise = DOMPromiseDeferred<IDLDictionary<HTMLModelElementCamera>>;
void getCamera(CameraPromise&&);
void setCamera(HTMLModelElementCamera, DOMPromiseDeferred<void>&&);
#endif

#if ENABLE(MODEL_ELEMENT_ANIMATION_CONTROL)
using IsPlayingAnimationPromise = DOMPromiseDeferred<IDLBoolean>;
void isPlayingAnimation(IsPlayingAnimationPromise&&);
void playAnimation(DOMPromiseDeferred<void>&&);
@@ -88,12 +91,15 @@ class HTMLModelElement final : public HTMLElement, private CachedRawResourceClie
using CurrentTimePromise = DOMPromiseDeferred<IDLDouble>;
void animationCurrentTime(CurrentTimePromise&&);
void setAnimationCurrentTime(double, DOMPromiseDeferred<void>&&);
#endif

#if ENABLE(MODEL_ELEMENT_AUDIO_CONTROL)
using HasAudioPromise = DOMPromiseDeferred<IDLBoolean>;
void hasAudio(HasAudioPromise&&);
using IsMutedPromise = DOMPromiseDeferred<IDLBoolean>;
void isMuted(IsMutedPromise&&);
void setIsMuted(bool, DOMPromiseDeferred<void>&&);
#endif

bool isDraggableIgnoringAttributes() const final { return true; }

@@ -125,7 +131,9 @@ class HTMLModelElement final : public HTMLElement, private CachedRawResourceClie
void dragDidChange(MouseEvent&);
void dragDidEnd(MouseEvent&);

#if ENABLE(MODEL_ELEMENT_ANIMATION_CONTROL)
void setAnimationIsPlaying(bool, DOMPromiseDeferred<void>&&);
#endif

URL m_sourceURL;
CachedResourceHandle<CachedRawResource> m_resource;
@@ -34,21 +34,21 @@

undefined enterFullscreen();

Promise<HTMLModelElementCamera> getCamera();
Promise<undefined> setCamera(HTMLModelElementCamera camera);
[Conditional=MODEL_ELEMENT_CAMERA_CONTROL] Promise<HTMLModelElementCamera> getCamera();
[Conditional=MODEL_ELEMENT_CAMERA_CONTROL] Promise<undefined> setCamera(HTMLModelElementCamera camera);

Promise<boolean> isPlayingAnimation();
Promise<undefined> playAnimation();
Promise<undefined> pauseAnimation();
[Conditional=MODEL_ELEMENT_ANIMATION_CONTROL] Promise<boolean> isPlayingAnimation();
[Conditional=MODEL_ELEMENT_ANIMATION_CONTROL] Promise<undefined> playAnimation();
[Conditional=MODEL_ELEMENT_ANIMATION_CONTROL] Promise<undefined> pauseAnimation();

Promise<boolean> isLoopingAnimation();
Promise<undefined> setIsLoopingAnimation(boolean looping);
[Conditional=MODEL_ELEMENT_ANIMATION_CONTROL] Promise<boolean> isLoopingAnimation();
[Conditional=MODEL_ELEMENT_ANIMATION_CONTROL] Promise<undefined> setIsLoopingAnimation(boolean looping);

Promise<double> animationDuration();
Promise<double> animationCurrentTime();
Promise<undefined> setAnimationCurrentTime(double currentTime);
[Conditional=MODEL_ELEMENT_ANIMATION_CONTROL] Promise<double> animationDuration();
[Conditional=MODEL_ELEMENT_ANIMATION_CONTROL] Promise<double> animationCurrentTime();
[Conditional=MODEL_ELEMENT_ANIMATION_CONTROL] Promise<undefined> setAnimationCurrentTime(double currentTime);

Promise<boolean> hasAudio();
Promise<boolean> isMuted();
Promise<undefined> setIsMuted(boolean isMuted);
[Conditional=MODEL_ELEMENT_AUDIO_CONTROL] Promise<boolean> hasAudio();
[Conditional=MODEL_ELEMENT_AUDIO_CONTROL] Promise<boolean> isMuted();
[Conditional=MODEL_ELEMENT_AUDIO_CONTROL] Promise<undefined> setIsMuted(boolean isMuted);
};
@@ -50,18 +50,24 @@ class WEBCORE_EXPORT ModelPlayer : public RefCounted<ModelPlayer> {
virtual void handleMouseDown(const LayoutPoint&, MonotonicTime) = 0;
virtual void handleMouseMove(const LayoutPoint&, MonotonicTime) = 0;
virtual void handleMouseUp(const LayoutPoint&, MonotonicTime) = 0;
#if ENABLE(MODEL_ELEMENT_CAMERA_CONTROL)
virtual void getCamera(CompletionHandler<void(std::optional<HTMLModelElementCamera>&&)>&&) = 0;
virtual void setCamera(HTMLModelElementCamera, CompletionHandler<void(bool success)>&&) = 0;
#endif
#if ENABLE(MODEL_ELEMENT_ANIMATION_CONTROL)
virtual void isPlayingAnimation(CompletionHandler<void(std::optional<bool>&&)>&&) = 0;
virtual void setAnimationIsPlaying(bool, CompletionHandler<void(bool success)>&&) = 0;
virtual void isLoopingAnimation(CompletionHandler<void(std::optional<bool>&&)>&&) = 0;
virtual void setIsLoopingAnimation(bool, CompletionHandler<void(bool success)>&&) = 0;
virtual void animationDuration(CompletionHandler<void(std::optional<Seconds>&&)>&&) = 0;
virtual void animationCurrentTime(CompletionHandler<void(std::optional<Seconds>&&)>&&) = 0;
virtual void setAnimationCurrentTime(Seconds, CompletionHandler<void(bool success)>&&) = 0;
#endif
#if ENABLE(MODEL_ELEMENT_AUDIO_CONTROL)
virtual void hasAudio(CompletionHandler<void(std::optional<bool>&&)>&&) = 0;
virtual void isMuted(CompletionHandler<void(std::optional<bool>&&)>&&) = 0;
virtual void setIsMuted(bool, CompletionHandler<void(bool success)>&&) = 0;
#endif
};

}
@@ -70,14 +70,17 @@ void DummyModelPlayer::handleMouseUp(const LayoutPoint&, MonotonicTime)
{
}

#if ENABLE(MODEL_ELEMENT_CAMERA_CONTROL)
void DummyModelPlayer::getCamera(CompletionHandler<void(std::optional<WebCore::HTMLModelElementCamera>&&)>&&)
{
}

void DummyModelPlayer::setCamera(WebCore::HTMLModelElementCamera, CompletionHandler<void(bool success)>&&)
{
}
#endif

#if ENABLE(MODEL_ELEMENT_ANIMATION_CONTROL)
void DummyModelPlayer::isPlayingAnimation(CompletionHandler<void(std::optional<bool>&&)>&&)
{
}
@@ -105,7 +108,9 @@ void DummyModelPlayer::animationCurrentTime(CompletionHandler<void(std::optional
void DummyModelPlayer::setAnimationCurrentTime(Seconds, CompletionHandler<void(bool success)>&&)
{
}
#endif

#if ENABLE(MODEL_ELEMENT_AUDIO_CONTROL)
void DummyModelPlayer::hasAudio(CompletionHandler<void(std::optional<bool>&&)>&&)
{
}
@@ -117,5 +122,6 @@ void DummyModelPlayer::isMuted(CompletionHandler<void(std::optional<bool>&&)>&&)
void DummyModelPlayer::setIsMuted(bool, CompletionHandler<void(bool success)>&&)
{
}
#endif

}
@@ -47,18 +47,24 @@ class WEBCORE_EXPORT DummyModelPlayer final : public ModelPlayer {
void handleMouseDown(const LayoutPoint&, MonotonicTime) override;
void handleMouseMove(const LayoutPoint&, MonotonicTime) override;
void handleMouseUp(const LayoutPoint&, MonotonicTime) override;
#if ENABLE(MODEL_ELEMENT_CAMERA_CONTROL)
void getCamera(CompletionHandler<void(std::optional<WebCore::HTMLModelElementCamera>&&)>&&) override;
void setCamera(WebCore::HTMLModelElementCamera, CompletionHandler<void(bool success)>&&) override;
#endif
#if ENABLE(MODEL_ELEMENT_ANIMATION_CONTROL)
void isPlayingAnimation(CompletionHandler<void(std::optional<bool>&&)>&&) override;
void setAnimationIsPlaying(bool, CompletionHandler<void(bool success)>&&) override;
void isLoopingAnimation(CompletionHandler<void(std::optional<bool>&&)>&&) override;
void setIsLoopingAnimation(bool, CompletionHandler<void(bool success)>&&) override;
void animationDuration(CompletionHandler<void(std::optional<Seconds>&&)>&&) override;
void animationCurrentTime(CompletionHandler<void(std::optional<Seconds>&&)>&&) override;
void setAnimationCurrentTime(Seconds, CompletionHandler<void(bool success)>&&) override;
#endif
#if ENABLE(MODEL_ELEMENT_AUDIO_CONTROL)
void hasAudio(CompletionHandler<void(std::optional<bool>&&)>&&) override;
void isMuted(CompletionHandler<void(std::optional<bool>&&)>&&) override;
void setIsMuted(bool, CompletionHandler<void(bool success)>&&) override;
#endif

WeakPtr<ModelPlayerClient> m_client;
};
@@ -61,18 +61,24 @@ class WEBCORE_EXPORT SceneKitModelPlayer final : public ModelPlayer, public Scen
void handleMouseDown(const LayoutPoint&, MonotonicTime) override;
void handleMouseMove(const LayoutPoint&, MonotonicTime) override;
void handleMouseUp(const LayoutPoint&, MonotonicTime) override;
#if ENABLE(MODEL_ELEMENT_CAMERA_CONTROL)
void getCamera(CompletionHandler<void(std::optional<HTMLModelElementCamera>&&)>&&) override;
void setCamera(HTMLModelElementCamera, CompletionHandler<void(bool success)>&&) override;
#endif
#if ENABLE(MODEL_ELEMENT_ANIMATION_CONTROL)
void isPlayingAnimation(CompletionHandler<void(std::optional<bool>&&)>&&) override;
void setAnimationIsPlaying(bool, CompletionHandler<void(bool success)>&&) override;
void isLoopingAnimation(CompletionHandler<void(std::optional<bool>&&)>&&) override;
void setIsLoopingAnimation(bool, CompletionHandler<void(bool success)>&&) override;
void animationDuration(CompletionHandler<void(std::optional<Seconds>&&)>&&) override;
void animationCurrentTime(CompletionHandler<void(std::optional<Seconds>&&)>&&) override;
void setAnimationCurrentTime(Seconds, CompletionHandler<void(bool success)>&&) override;
#endif
#if ENABLE(MODEL_ELEMENT_AUDIO_CONTROL)
void hasAudio(CompletionHandler<void(std::optional<bool>&&)>&&) override;
void isMuted(CompletionHandler<void(std::optional<bool>&&)>&&) override;
void setIsMuted(bool, CompletionHandler<void(bool success)>&&) override;
#endif

// SceneKitModelLoaderClient overrides.
virtual void didFinishLoading(SceneKitModelLoader&, Ref<SceneKitModel>) override;
@@ -88,14 +88,17 @@
{
}

#if ENABLE(MODEL_ELEMENT_CAMERA_CONTROL)
void SceneKitModelPlayer::getCamera(CompletionHandler<void(std::optional<HTMLModelElementCamera>&&)>&&)
{
}

void SceneKitModelPlayer::setCamera(HTMLModelElementCamera, CompletionHandler<void(bool success)>&&)
{
}
#endif

#if ENABLE(MODEL_ELEMENT_ANIMATION_CONTROL)
void SceneKitModelPlayer::isPlayingAnimation(CompletionHandler<void(std::optional<bool>&&)>&&)
{
}
@@ -123,7 +126,9 @@
void SceneKitModelPlayer::setAnimationCurrentTime(Seconds, CompletionHandler<void(bool success)>&&)
{
}
#endif

#if ENABLE(MODEL_ELEMENT_AUDIO_CONTROL)
void SceneKitModelPlayer::hasAudio(CompletionHandler<void(std::optional<bool>&&)>&&)
{
}
@@ -135,6 +140,7 @@
void SceneKitModelPlayer::setIsMuted(bool, CompletionHandler<void(bool success)>&&)
{
}
#endif

// MARK: - SceneKitModelLoaderClient overrides.

@@ -1,3 +1,18 @@
2021-11-24 Antoine Quint <graouts@webkit.org>

[Model] clean up compile-time flags and condition IDL methods behind them
https://bugs.webkit.org/show_bug.cgi?id=233407

Reviewed by Tim Horton.

We adopt the changes made to flags in wtf/PlatformEnableCocoa.h and wtf/PlatformHave.h.
We also remove the use of existing flags in QuartzCoreSPI.h since they're not actually
valid.

* pal/spi/cocoa/QuartzCoreSPI.h:
* pal/spi/ios/SystemPreviewSPI.h:
* pal/spi/mac/SystemPreviewSPI.h:

2021-11-29 Myles C. Maxfield <mmaxfield@apple.com>

[WebGPU] IPC class refactorings

0 comments on commit f4e6767

Please sign in to comment.