mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
LibWeb: Add an empty DataTransferItemList IDL implementation
This commit is contained in:
parent
9e3c6921ab
commit
dcb76572e4
Notes:
github-actions[bot]
2024-08-19 11:31:01 +00:00
Author: https://github.com/trflynn89 Commit: https://github.com/LadybirdBrowser/ladybird/commit/dcb76572e4d Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1111
7 changed files with 79 additions and 0 deletions
|
@ -75,6 +75,7 @@ DOMStringMap
|
|||
DOMTokenList
|
||||
DataTransfer
|
||||
DataTransferItem
|
||||
DataTransferItemList
|
||||
DataView
|
||||
Date
|
||||
DisposableStack
|
||||
|
|
|
@ -276,6 +276,7 @@ set(SOURCES
|
|||
HTML/CustomElements/CustomElementRegistry.cpp
|
||||
HTML/DataTransfer.cpp
|
||||
HTML/DataTransferItem.cpp
|
||||
HTML/DataTransferItemList.cpp
|
||||
HTML/Dates.cpp
|
||||
HTML/DecodedImageData.cpp
|
||||
HTML/DedicatedWorkerGlobalScope.cpp
|
||||
|
|
|
@ -354,6 +354,7 @@ class CloseWatcherManager;
|
|||
class CustomElementDefinition;
|
||||
class CustomElementRegistry;
|
||||
class DataTransferItem;
|
||||
class DataTransferItemList;
|
||||
class DecodedImageData;
|
||||
class DocumentState;
|
||||
class DOMParser;
|
||||
|
|
34
Userland/Libraries/LibWeb/HTML/DataTransferItemList.cpp
Normal file
34
Userland/Libraries/LibWeb/HTML/DataTransferItemList.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/DataTransferItemListPrototype.h>
|
||||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/HTML/DataTransferItemList.h>
|
||||
|
||||
namespace Web::HTML {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(DataTransferItemList);
|
||||
|
||||
JS::NonnullGCPtr<DataTransferItemList> DataTransferItemList::construct_impl(JS::Realm& realm)
|
||||
{
|
||||
return realm.heap().allocate<DataTransferItemList>(realm, realm);
|
||||
}
|
||||
|
||||
DataTransferItemList::DataTransferItemList(JS::Realm& realm)
|
||||
: PlatformObject(realm)
|
||||
{
|
||||
}
|
||||
|
||||
DataTransferItemList::~DataTransferItemList() = default;
|
||||
|
||||
void DataTransferItemList::initialize(JS::Realm& realm)
|
||||
{
|
||||
Base::initialize(realm);
|
||||
WEB_SET_PROTOTYPE_FOR_INTERFACE(DataTransferItemList);
|
||||
}
|
||||
|
||||
}
|
29
Userland/Libraries/LibWeb/HTML/DataTransferItemList.h
Normal file
29
Userland/Libraries/LibWeb/HTML/DataTransferItemList.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-datatransferitemlist-interface
|
||||
class DataTransferItemList : public Bindings::PlatformObject {
|
||||
WEB_PLATFORM_OBJECT(DataTransferItemList, Bindings::PlatformObject);
|
||||
JS_DECLARE_ALLOCATOR(DataTransferItemList);
|
||||
|
||||
public:
|
||||
static JS::NonnullGCPtr<DataTransferItemList> construct_impl(JS::Realm&);
|
||||
virtual ~DataTransferItemList() override;
|
||||
|
||||
private:
|
||||
DataTransferItemList(JS::Realm&);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
};
|
||||
|
||||
}
|
12
Userland/Libraries/LibWeb/HTML/DataTransferItemList.idl
Normal file
12
Userland/Libraries/LibWeb/HTML/DataTransferItemList.idl
Normal file
|
@ -0,0 +1,12 @@
|
|||
#import <HTML/DataTransferItem.idl>
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/dnd.html#datatransferitemlist
|
||||
[Exposed=Window]
|
||||
interface DataTransferItemList {
|
||||
[FIXME] readonly attribute unsigned long length;
|
||||
[FIXME] getter DataTransferItem (unsigned long index);
|
||||
[FIXME] DataTransferItem? add(DOMString data, DOMString type);
|
||||
[FIXME] DataTransferItem? add(File data);
|
||||
[FIXME] undefined remove(unsigned long index);
|
||||
[FIXME] undefined clear();
|
||||
};
|
|
@ -103,6 +103,7 @@ 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/DataTransferItemList)
|
||||
libweb_js_bindings(HTML/DedicatedWorkerGlobalScope GLOBAL)
|
||||
libweb_js_bindings(HTML/DOMParser)
|
||||
libweb_js_bindings(HTML/DOMStringList)
|
||||
|
|
Loading…
Reference in a new issue