mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
LibWeb: Add an empty DataTransferItem IDL implementation
This commit is contained in:
parent
b6c99c27af
commit
9e3c6921ab
Notes:
github-actions[bot]
2024-08-19 11:31:06 +00:00
Author: https://github.com/trflynn89 Commit: https://github.com/LadybirdBrowser/ladybird/commit/9e3c6921ab5 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1111
7 changed files with 79 additions and 0 deletions
|
@ -74,6 +74,7 @@ DOMStringList
|
|||
DOMStringMap
|
||||
DOMTokenList
|
||||
DataTransfer
|
||||
DataTransferItem
|
||||
DataView
|
||||
Date
|
||||
DisposableStack
|
||||
|
|
|
@ -275,6 +275,7 @@ set(SOURCES
|
|||
HTML/CustomElements/CustomElementReactionNames.cpp
|
||||
HTML/CustomElements/CustomElementRegistry.cpp
|
||||
HTML/DataTransfer.cpp
|
||||
HTML/DataTransferItem.cpp
|
||||
HTML/Dates.cpp
|
||||
HTML/DecodedImageData.cpp
|
||||
HTML/DedicatedWorkerGlobalScope.cpp
|
||||
|
|
|
@ -353,6 +353,7 @@ class CloseWatcher;
|
|||
class CloseWatcherManager;
|
||||
class CustomElementDefinition;
|
||||
class CustomElementRegistry;
|
||||
class DataTransferItem;
|
||||
class DecodedImageData;
|
||||
class DocumentState;
|
||||
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/CustomElements/CustomElementRegistry)
|
||||
libweb_js_bindings(HTML/DataTransfer)
|
||||
libweb_js_bindings(HTML/DataTransferItem)
|
||||
libweb_js_bindings(HTML/DedicatedWorkerGlobalScope GLOBAL)
|
||||
libweb_js_bindings(HTML/DOMParser)
|
||||
libweb_js_bindings(HTML/DOMStringList)
|
||||
|
|
Loading…
Reference in a new issue