mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 00:50:22 +00:00
LibWeb: Stub MediaCapabilities IDL interface
This commit is contained in:
parent
1240aaa294
commit
4c5a176354
Notes:
github-actions[bot]
2024-09-05 13:53:37 +00:00
Author: https://github.com/jamierocks Commit: https://github.com/LadybirdBrowser/ladybird/commit/4c5a1763546 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1283 Reviewed-by: https://github.com/tcl3 ✅
8 changed files with 73 additions and 0 deletions
|
@ -4197,6 +4197,7 @@ static void generate_using_namespace_definitions(SourceGenerator& generator)
|
|||
using namespace Web::IndexedDB;
|
||||
using namespace Web::Internals;
|
||||
using namespace Web::IntersectionObserver;
|
||||
using namespace Web::MediaCapabilitiesAPI;
|
||||
using namespace Web::NavigationTiming;
|
||||
using namespace Web::PerformanceTimeline;
|
||||
using namespace Web::RequestIdleCallback;
|
||||
|
|
|
@ -206,6 +206,7 @@ KeyframeEffect
|
|||
Location
|
||||
Map
|
||||
MathMLElement
|
||||
MediaCapabilities
|
||||
MediaError
|
||||
MediaList
|
||||
MediaQueryList
|
||||
|
|
|
@ -548,6 +548,7 @@ set(SOURCES
|
|||
Loader/ResourceLoader.cpp
|
||||
MathML/MathMLElement.cpp
|
||||
MathML/TagNames.cpp
|
||||
MediaCapabilitiesAPI/MediaCapabilities.cpp
|
||||
MimeSniff/MimeType.cpp
|
||||
MimeSniff/Resource.cpp
|
||||
MixedContent/AbstractOperations.cpp
|
||||
|
|
|
@ -592,6 +592,10 @@ namespace Web::MathML {
|
|||
class MathMLElement;
|
||||
}
|
||||
|
||||
namespace Web::MediaCapabilitiesAPI {
|
||||
class MediaCapabilities;
|
||||
}
|
||||
|
||||
namespace Web::MimeSniff {
|
||||
class MimeType;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
* Copyright (c) 2024, Jamie Mansfield <jmansfield@cadixdev.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/Bindings/MediaCapabilitiesPrototype.h>
|
||||
#include <LibWeb/HTML/Window.h>
|
||||
#include <LibWeb/MediaCapabilitiesAPI/MediaCapabilities.h>
|
||||
|
||||
namespace Web::MediaCapabilitiesAPI {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(MediaCapabilities);
|
||||
|
||||
JS::NonnullGCPtr<MediaCapabilities> MediaCapabilities::create(JS::Realm& realm)
|
||||
{
|
||||
return realm.heap().allocate<MediaCapabilities>(realm, realm);
|
||||
}
|
||||
|
||||
MediaCapabilities::MediaCapabilities(JS::Realm& realm)
|
||||
: PlatformObject(realm)
|
||||
{
|
||||
}
|
||||
|
||||
void MediaCapabilities::initialize(JS::Realm& realm)
|
||||
{
|
||||
Base::initialize(realm);
|
||||
WEB_SET_PROTOTYPE_FOR_INTERFACE(MediaCapabilities);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
* Copyright (c) 2024, Jamie Mansfield <jmansfield@cadixdev.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibWeb/Bindings/PlatformObject.h>
|
||||
|
||||
namespace Web::MediaCapabilitiesAPI {
|
||||
|
||||
class MediaCapabilities final : public Bindings::PlatformObject {
|
||||
WEB_PLATFORM_OBJECT(MediaCapabilities, Bindings::PlatformObject);
|
||||
JS_DECLARE_ALLOCATOR(MediaCapabilities);
|
||||
|
||||
public:
|
||||
static JS::NonnullGCPtr<MediaCapabilities> create(JS::Realm&);
|
||||
virtual ~MediaCapabilities() override = default;
|
||||
|
||||
private:
|
||||
MediaCapabilities(JS::Realm&);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
};
|
||||
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
// https://w3c.github.io/media-capabilities/#mediacapabilities
|
||||
[Exposed=(Window, Worker)]
|
||||
interface MediaCapabilities {
|
||||
[FIXME, NewObject] Promise<MediaCapabilitiesDecodingInfo> decodingInfo(MediaDecodingConfiguration configuration);
|
||||
[FIXME, NewObject] Promise<MediaCapabilitiesEncodingInfo> encodingInfo(MediaEncodingConfiguration configuration);
|
||||
};
|
|
@ -242,6 +242,7 @@ libweb_js_bindings(Internals/Internals)
|
|||
libweb_js_bindings(IntersectionObserver/IntersectionObserver)
|
||||
libweb_js_bindings(IntersectionObserver/IntersectionObserverEntry)
|
||||
libweb_js_bindings(MathML/MathMLElement)
|
||||
libweb_js_bindings(MediaCapabilitiesAPI/MediaCapabilities)
|
||||
libweb_js_bindings(NavigationTiming/PerformanceNavigation)
|
||||
libweb_js_bindings(NavigationTiming/PerformanceTiming)
|
||||
libweb_js_bindings(PerformanceTimeline/PerformanceEntry)
|
||||
|
|
Loading…
Reference in a new issue