mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 01:29:17 +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: dcb76572e4
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1111
7 changed files with 79 additions and 0 deletions
|
@ -75,6 +75,7 @@ DOMStringMap
|
||||||
DOMTokenList
|
DOMTokenList
|
||||||
DataTransfer
|
DataTransfer
|
||||||
DataTransferItem
|
DataTransferItem
|
||||||
|
DataTransferItemList
|
||||||
DataView
|
DataView
|
||||||
Date
|
Date
|
||||||
DisposableStack
|
DisposableStack
|
||||||
|
|
|
@ -276,6 +276,7 @@ set(SOURCES
|
||||||
HTML/CustomElements/CustomElementRegistry.cpp
|
HTML/CustomElements/CustomElementRegistry.cpp
|
||||||
HTML/DataTransfer.cpp
|
HTML/DataTransfer.cpp
|
||||||
HTML/DataTransferItem.cpp
|
HTML/DataTransferItem.cpp
|
||||||
|
HTML/DataTransferItemList.cpp
|
||||||
HTML/Dates.cpp
|
HTML/Dates.cpp
|
||||||
HTML/DecodedImageData.cpp
|
HTML/DecodedImageData.cpp
|
||||||
HTML/DedicatedWorkerGlobalScope.cpp
|
HTML/DedicatedWorkerGlobalScope.cpp
|
||||||
|
|
|
@ -354,6 +354,7 @@ class CloseWatcherManager;
|
||||||
class CustomElementDefinition;
|
class CustomElementDefinition;
|
||||||
class CustomElementRegistry;
|
class CustomElementRegistry;
|
||||||
class DataTransferItem;
|
class DataTransferItem;
|
||||||
|
class DataTransferItemList;
|
||||||
class DecodedImageData;
|
class DecodedImageData;
|
||||||
class DocumentState;
|
class DocumentState;
|
||||||
class DOMParser;
|
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/CustomElements/CustomElementRegistry)
|
||||||
libweb_js_bindings(HTML/DataTransfer)
|
libweb_js_bindings(HTML/DataTransfer)
|
||||||
libweb_js_bindings(HTML/DataTransferItem)
|
libweb_js_bindings(HTML/DataTransferItem)
|
||||||
|
libweb_js_bindings(HTML/DataTransferItemList)
|
||||||
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)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue