mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
LibWeb: Add an empty DataTransferItem IDL implementation
This commit is contained in:
committed by
Andreas Kling
parent
b6c99c27af
commit
9e3c6921ab
@@ -74,6 +74,7 @@ DOMStringList
|
|||||||
DOMStringMap
|
DOMStringMap
|
||||||
DOMTokenList
|
DOMTokenList
|
||||||
DataTransfer
|
DataTransfer
|
||||||
|
DataTransferItem
|
||||||
DataView
|
DataView
|
||||||
Date
|
Date
|
||||||
DisposableStack
|
DisposableStack
|
||||||
|
|||||||
@@ -275,6 +275,7 @@ set(SOURCES
|
|||||||
HTML/CustomElements/CustomElementReactionNames.cpp
|
HTML/CustomElements/CustomElementReactionNames.cpp
|
||||||
HTML/CustomElements/CustomElementRegistry.cpp
|
HTML/CustomElements/CustomElementRegistry.cpp
|
||||||
HTML/DataTransfer.cpp
|
HTML/DataTransfer.cpp
|
||||||
|
HTML/DataTransferItem.cpp
|
||||||
HTML/Dates.cpp
|
HTML/Dates.cpp
|
||||||
HTML/DecodedImageData.cpp
|
HTML/DecodedImageData.cpp
|
||||||
HTML/DedicatedWorkerGlobalScope.cpp
|
HTML/DedicatedWorkerGlobalScope.cpp
|
||||||
|
|||||||
@@ -353,6 +353,7 @@ class CloseWatcher;
|
|||||||
class CloseWatcherManager;
|
class CloseWatcherManager;
|
||||||
class CustomElementDefinition;
|
class CustomElementDefinition;
|
||||||
class CustomElementRegistry;
|
class CustomElementRegistry;
|
||||||
|
class DataTransferItem;
|
||||||
class DecodedImageData;
|
class DecodedImageData;
|
||||||
class DocumentState;
|
class DocumentState;
|
||||||
class DOMParser;
|
class DOMParser;
|
||||||
|
|||||||
34
Userland/Libraries/LibWeb/HTML/DataTransferItem.cpp
Normal file
34
Userland/Libraries/LibWeb/HTML/DataTransferItem.cpp
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2024, Tim Flynn <trflynn89@serenityos.org>
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <LibJS/Runtime/Realm.h>
|
||||||
|
#include <LibWeb/Bindings/DataTransferItemPrototype.h>
|
||||||
|
#include <LibWeb/Bindings/Intrinsics.h>
|
||||||
|
#include <LibWeb/HTML/DataTransferItem.h>
|
||||||
|
|
||||||
|
namespace Web::HTML {
|
||||||
|
|
||||||
|
JS_DEFINE_ALLOCATOR(DataTransferItem);
|
||||||
|
|
||||||
|
JS::NonnullGCPtr<DataTransferItem> DataTransferItem::construct_impl(JS::Realm& realm)
|
||||||
|
{
|
||||||
|
return realm.heap().allocate<DataTransferItem>(realm, realm);
|
||||||
|
}
|
||||||
|
|
||||||
|
DataTransferItem::DataTransferItem(JS::Realm& realm)
|
||||||
|
: PlatformObject(realm)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
DataTransferItem::~DataTransferItem() = default;
|
||||||
|
|
||||||
|
void DataTransferItem::initialize(JS::Realm& realm)
|
||||||
|
{
|
||||||
|
Base::initialize(realm);
|
||||||
|
WEB_SET_PROTOTYPE_FOR_INTERFACE(DataTransferItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
29
Userland/Libraries/LibWeb/HTML/DataTransferItem.h
Normal file
29
Userland/Libraries/LibWeb/HTML/DataTransferItem.h
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2024, Tim Flynn <trflynn89@serenityos.org>
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <LibJS/Forward.h>
|
||||||
|
#include <LibWeb/Bindings/PlatformObject.h>
|
||||||
|
|
||||||
|
namespace Web::HTML {
|
||||||
|
|
||||||
|
// https://html.spec.whatwg.org/multipage/dnd.html#the-datatransferitem-interface
|
||||||
|
class DataTransferItem : public Bindings::PlatformObject {
|
||||||
|
WEB_PLATFORM_OBJECT(DataTransferItem, Bindings::PlatformObject);
|
||||||
|
JS_DECLARE_ALLOCATOR(DataTransferItem);
|
||||||
|
|
||||||
|
public:
|
||||||
|
static JS::NonnullGCPtr<DataTransferItem> construct_impl(JS::Realm&);
|
||||||
|
virtual ~DataTransferItem() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
DataTransferItem(JS::Realm&);
|
||||||
|
|
||||||
|
virtual void initialize(JS::Realm&) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
12
Userland/Libraries/LibWeb/HTML/DataTransferItem.idl
Normal file
12
Userland/Libraries/LibWeb/HTML/DataTransferItem.idl
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
#import <FileAPI/File.idl>
|
||||||
|
|
||||||
|
callback FunctionStringCallback = undefined (DOMString data);
|
||||||
|
|
||||||
|
// https://html.spec.whatwg.org/multipage/dnd.html#datatransferitem
|
||||||
|
[Exposed=Window]
|
||||||
|
interface DataTransferItem {
|
||||||
|
[FIXME] readonly attribute DOMString kind;
|
||||||
|
[FIXME] readonly attribute DOMString type;
|
||||||
|
[FIXME] undefined getAsString(FunctionStringCallback? _callback);
|
||||||
|
[FIXME] File? getAsFile();
|
||||||
|
};
|
||||||
@@ -102,6 +102,7 @@ libweb_js_bindings(HTML/CloseEvent)
|
|||||||
libweb_js_bindings(HTML/CloseWatcher)
|
libweb_js_bindings(HTML/CloseWatcher)
|
||||||
libweb_js_bindings(HTML/CustomElements/CustomElementRegistry)
|
libweb_js_bindings(HTML/CustomElements/CustomElementRegistry)
|
||||||
libweb_js_bindings(HTML/DataTransfer)
|
libweb_js_bindings(HTML/DataTransfer)
|
||||||
|
libweb_js_bindings(HTML/DataTransferItem)
|
||||||
libweb_js_bindings(HTML/DedicatedWorkerGlobalScope GLOBAL)
|
libweb_js_bindings(HTML/DedicatedWorkerGlobalScope GLOBAL)
|
||||||
libweb_js_bindings(HTML/DOMParser)
|
libweb_js_bindings(HTML/DOMParser)
|
||||||
libweb_js_bindings(HTML/DOMStringList)
|
libweb_js_bindings(HTML/DOMStringList)
|
||||||
|
|||||||
Reference in New Issue
Block a user