diff --git a/Source/WebCore/Modules/WebGPU/GPUDevice.cpp b/Source/WebCore/Modules/WebGPU/GPUDevice.cpp index d13899c6d3389..e69870b01419f 100644 --- a/Source/WebCore/Modules/WebGPU/GPUDevice.cpp +++ b/Source/WebCore/Modules/WebGPU/GPUDevice.cpp @@ -281,6 +281,7 @@ ExceptionOr> GPUDevice::createSampler(const std::optional m_videoElement; WeakPtr m_gpuDevice; }; +#endif ExceptionOr> GPUDevice::importExternalTexture(const GPUExternalTextureDescriptor& externalTextureDescriptor) { +#if ENABLE(VIDEO) if (RefPtr externalTexture = externalTextureForDescriptor(externalTextureDescriptor)) { externalTexture->undestroy(); #if ENABLE(WEB_CODECS) @@ -346,6 +349,7 @@ ExceptionOr> GPUDevice::importExternalTexture(const GPUE m_videoElementToExternalTextureMap.remove(*videoElement.get()); return externalTexture.releaseNonNull(); } +#endif RefPtr texture = m_backing->importExternalTexture(externalTextureDescriptor.convertToBacking()); if (!texture) return Exception { ExceptionCode::InvalidStateError, "GPUDevice.importExternalTexture: Unable to import texture."_s }; diff --git a/Source/WebCore/Modules/WebGPU/GPUDevice.h b/Source/WebCore/Modules/WebGPU/GPUDevice.h index 1dd1a8927a481..6f7b91ed8133e 100644 --- a/Source/WebCore/Modules/WebGPU/GPUDevice.h +++ b/Source/WebCore/Modules/WebGPU/GPUDevice.h @@ -160,7 +160,10 @@ class GPUDevice : public RefCounted, public ActiveDOMObject, public E Ref m_queue; RefPtr m_autoPipelineLayout; WeakHashSet m_buffersToUnmap; + +#if ENABLE(VIDEO) GPUExternalTexture* externalTextureForDescriptor(const GPUExternalTextureDescriptor&); +#endif WeakHashMap> m_videoElementToExternalTextureMap; bool m_waitingForDeviceLostPromise { false }; diff --git a/Source/WebCore/css/SelectorChecker.cpp b/Source/WebCore/css/SelectorChecker.cpp index fda1729370736..dc16635ae13bf 100644 --- a/Source/WebCore/css/SelectorChecker.cpp +++ b/Source/WebCore/css/SelectorChecker.cpp @@ -1075,9 +1075,11 @@ bool SelectorChecker::checkOne(CheckingContext& checkingContext, const LocalCont return matchesAnimatingFullscreenTransitionPseudoClass(element); case CSSSelector::PseudoClass::InternalFullscreenDocument: return matchesFullscreenDocumentPseudoClass(element); +#if ENABLE(VIDEO) case CSSSelector::PseudoClass::InternalInWindowFullScreen: return matchesInWindowFullScreenPseudoClass(element); #endif +#endif #if ENABLE(PICTURE_IN_PICTURE_API) case CSSSelector::PseudoClass::PictureInPicture: return matchesPictureInPicturePseudoClass(element); diff --git a/Source/WebCore/css/SelectorCheckerTestFunctions.h b/Source/WebCore/css/SelectorCheckerTestFunctions.h index ad13eea0ced64..d8079261e6c50 100644 --- a/Source/WebCore/css/SelectorCheckerTestFunctions.h +++ b/Source/WebCore/css/SelectorCheckerTestFunctions.h @@ -428,6 +428,7 @@ ALWAYS_INLINE bool matchesFullscreenDocumentPseudoClass(const Element& element) return fullscreenManager && fullscreenManager->fullscreenElement(); } +#if ENABLE(VIDEO) ALWAYS_INLINE bool matchesInWindowFullScreenPseudoClass(const Element& element) { if (&element != element.document().fullscreenManager().currentFullscreenElement()) @@ -436,6 +437,7 @@ ALWAYS_INLINE bool matchesInWindowFullScreenPseudoClass(const Element& element) auto* mediaElement = dynamicDowncast(element); return mediaElement && mediaElement->fullscreenMode() == HTMLMediaElementEnums::VideoFullscreenModeInWindow; } +#endif #endif diff --git a/Source/WebCore/cssjit/SelectorCompiler.cpp b/Source/WebCore/cssjit/SelectorCompiler.cpp index 45e67695cb56c..4e161a4bf04f4 100644 --- a/Source/WebCore/cssjit/SelectorCompiler.cpp +++ b/Source/WebCore/cssjit/SelectorCompiler.cpp @@ -257,8 +257,10 @@ static JSC_DECLARE_JIT_OPERATION_WITHOUT_WTF_INTERNAL(operationMatchesLangPseudo static JSC_DECLARE_JIT_OPERATION_WITHOUT_WTF_INTERNAL(operationMatchesFullscreenPseudoClass, bool, (const Element&)); static JSC_DECLARE_JIT_OPERATION_WITHOUT_WTF_INTERNAL(operationMatchesFullscreenDocumentPseudoClass, bool, (const Element&)); static JSC_DECLARE_JIT_OPERATION_WITHOUT_WTF_INTERNAL(operationMatchesAnimatingFullscreenTransitionPseudoClass, bool, (const Element&)); +#if ENABLE(VIDEO) static JSC_DECLARE_JIT_OPERATION_WITHOUT_WTF_INTERNAL(operationMatchesInWindowFullScreenPseudoClass, bool, (const Element&)); #endif +#endif #if ENABLE(PICTURE_IN_PICTURE_API) static JSC_DECLARE_JIT_OPERATION_WITHOUT_WTF_INTERNAL(operationMatchesPictureInPicturePseudoClass, bool, (const Element&)); #endif @@ -909,6 +911,8 @@ JSC_DEFINE_JIT_OPERATION(operationMatchesAnimatingFullscreenTransitionPseudoClas COUNT_SELECTOR_OPERATION(operationMatchesAnimatingFullscreenTransitionPseudoClass); return matchesAnimatingFullscreenTransitionPseudoClass(element); } + +#if ENABLE(VIDEO) JSC_DEFINE_JIT_OPERATION(operationMatchesInWindowFullScreenPseudoClass, bool, (const Element& element)) { COUNT_SELECTOR_OPERATION(operationMatchesInWindowFullScreenPseudoClass); @@ -916,6 +920,8 @@ JSC_DEFINE_JIT_OPERATION(operationMatchesInWindowFullScreenPseudoClass, bool, (c } #endif +#endif + #if ENABLE(PICTURE_IN_PICTURE_API) JSC_DEFINE_JIT_OPERATION(operationMatchesPictureInPicturePseudoClass, bool, (const Element& element)) { @@ -1112,10 +1118,12 @@ static inline FunctionType addPseudoClassType(const CSSSelector& selector, Selec case CSSSelector::PseudoClass::InternalAnimatingFullscreenTransition: fragment.unoptimizedPseudoClasses.append(CodePtr(operationMatchesAnimatingFullscreenTransitionPseudoClass)); return FunctionType::SimpleSelectorChecker; +#if ENABLE(VIDEO) case CSSSelector::PseudoClass::InternalInWindowFullScreen: fragment.unoptimizedPseudoClasses.append(CodePtr(operationMatchesInWindowFullScreenPseudoClass)); return FunctionType::SimpleSelectorChecker; #endif +#endif #if ENABLE(PICTURE_IN_PICTURE_API) case CSSSelector::PseudoClass::PictureInPicture: diff --git a/Source/WebCore/dom/FullscreenManager.cpp b/Source/WebCore/dom/FullscreenManager.cpp index c26c2970bb5ca..15e82c8456ffc 100644 --- a/Source/WebCore/dom/FullscreenManager.cpp +++ b/Source/WebCore/dom/FullscreenManager.cpp @@ -529,9 +529,11 @@ bool FullscreenManager::willEnterFullscreen(Element& element, HTMLMediaElementEn INFO_LOG(LOGIDENTIFIER); ASSERT(page()->settings().fullScreenEnabled()); +#if ENABLE(VIDEO) if (RefPtr mediaElement = dynamicDowncast(element)) mediaElement->willBecomeFullscreenElement(mode); else +#endif element.willBecomeFullscreenElement(); ASSERT(&element == m_pendingFullscreenElement); diff --git a/Source/WebCore/dom/FullscreenManager.h b/Source/WebCore/dom/FullscreenManager.h index 4a2af1aaa2178..87f8823248400 100644 --- a/Source/WebCore/dom/FullscreenManager.h +++ b/Source/WebCore/dom/FullscreenManager.h @@ -31,6 +31,7 @@ #include "FrameDestructionObserverInlines.h" #include "GCReachableRef.h" #include "HTMLMediaElement.h" +#include "HTMLMediaElementEnums.h" #include "LayoutRect.h" #include "Page.h" #include diff --git a/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp b/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp index c11de477ed2c3..9d85a2d5829fb 100644 --- a/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp +++ b/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp @@ -3100,6 +3100,7 @@ Inspector::Protocol::ErrorStringOr InspectorDOMAgent::setAllowEditingUserA Inspector::Protocol::ErrorStringOr> InspectorDOMAgent::getMediaStats(Inspector::Protocol::DOM::NodeId nodeId) { +#if ENABLE(VIDEO) Inspector::Protocol::ErrorString errorString; auto* element = assertElement(errorString, nodeId); @@ -3176,6 +3177,10 @@ Inspector::Protocol::ErrorStringOr> In } return stats; +#else + UNUSED_PARAM(nodeId); + return makeUnexpected("no media support"_s); +#endif } } // namespace WebCore diff --git a/Source/WebKit/GPUProcess/graphics/WebGPU/RemoteDevice.cpp b/Source/WebKit/GPUProcess/graphics/WebGPU/RemoteDevice.cpp index 7e3fc50d5afa4..e0df6d93f74df 100644 --- a/Source/WebKit/GPUProcess/graphics/WebGPU/RemoteDevice.cpp +++ b/Source/WebKit/GPUProcess/graphics/WebGPU/RemoteDevice.cpp @@ -171,7 +171,6 @@ void RemoteDevice::setSharedVideoFrameMemory(WebCore::SharedMemory::Handle&& han #if PLATFORM(COCOA) && ENABLE(VIDEO) void RemoteDevice::importExternalTextureFromVideoFrame(const WebGPU::ExternalTextureDescriptor& descriptor, WebGPUIdentifier identifier) { -#if PLATFORM(COCOA) && ENABLE(VIDEO) std::optional sharedVideoFrame = descriptor.sharedFrame; RetainPtr pixelBuffer { nullptr }; if (sharedVideoFrame) { @@ -193,9 +192,6 @@ void RemoteDevice::importExternalTextureFromVideoFrame(const WebGPU::ExternalTex RELEASE_ASSERT(externalTexture); auto remoteExternalTexture = RemoteExternalTexture::create(*externalTexture, m_objectHeap, m_streamConnection.copyRef(), identifier); m_objectHeap->addObject(identifier, remoteExternalTexture); -#else - UNUSED_PARAM(identifier); -#endif } #endif // PLATFORM(COCOA) && ENABLE(VIDEO) diff --git a/Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in b/Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in index 9af2a3f8788c0..cc4c86cf5ad6a 100644 --- a/Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in +++ b/Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in @@ -7265,6 +7265,7 @@ header: [Nested] enum class WebCore::FontVisibility : bool; [Nested] enum class WebCore::FontIsOrientationFallback : bool; +#if ENABLE(VIDEO) header: enum class WebCore::CaptionUserPreferencesDisplayMode : uint8_t { Automatic, @@ -7272,6 +7273,7 @@ enum class WebCore::CaptionUserPreferencesDisplayMode : uint8_t { AlwaysOn, Manual, }; +#endif header: enum class WebCore::InspectorClientDeveloperPreference : uint8_t { @@ -7918,6 +7920,7 @@ header: SourceGraphic }; +#if ENABLE(VIDEO) class WebCore::SerializedPlatformDataCueValue { std::optional data() } @@ -7930,6 +7933,7 @@ class WebCore::SerializedPlatformDataCueValue { RetainPtr locale; std::variant, RetainPtr, RetainPtr, RetainPtr> value; #endif +#endif }; header: diff --git a/Source/WebKit/UIProcess/WebFullScreenManagerProxy.h b/Source/WebKit/UIProcess/WebFullScreenManagerProxy.h index f80c50913a060..be73b22c6d5a2 100644 --- a/Source/WebKit/UIProcess/WebFullScreenManagerProxy.h +++ b/Source/WebKit/UIProcess/WebFullScreenManagerProxy.h @@ -30,6 +30,7 @@ #include "FullScreenMediaDetails.h" #include "MessageReceiver.h" #include +#include #include #include #include diff --git a/Source/WebKit/WebProcess/FullScreen/WebFullScreenManager.h b/Source/WebKit/WebProcess/FullScreen/WebFullScreenManager.h index 2eddad1692e01..4de4ead03a10b 100644 --- a/Source/WebKit/WebProcess/FullScreen/WebFullScreenManager.h +++ b/Source/WebKit/WebProcess/FullScreen/WebFullScreenManager.h @@ -30,6 +30,7 @@ #include "WebCoreArgumentCoders.h" #include #include +#include #include #include #include diff --git a/Source/WebKit/WebProcess/InjectedBundle/InjectedBundlePageFullScreenClient.h b/Source/WebKit/WebProcess/InjectedBundle/InjectedBundlePageFullScreenClient.h index c440506a58c39..3401a7580ab0b 100644 --- a/Source/WebKit/WebProcess/InjectedBundle/InjectedBundlePageFullScreenClient.h +++ b/Source/WebKit/WebProcess/InjectedBundle/InjectedBundlePageFullScreenClient.h @@ -32,6 +32,7 @@ #include "FullScreenMediaDetails.h" #include "WKBundlePageFullScreenClient.h" #include +#include #include #include