mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 00:25:12 +00:00
LibWeb: Add an empty DataTransfer IDL implementation
This does not implement any of the IDL methods, but GitHub requires the interface exists to upload files via an <input type="file"> element. Their JS handles uploads via this element and via drag-and-drop in one function, and check if the uploaded file is `instanceof DataTransfer` to decide how to handle it.
This commit is contained in:
committed by
Andreas Kling
parent
7681772b9f
commit
c2ef506b4a
28
Userland/Libraries/LibWeb/HTML/DataTransfer.h
Normal file
28
Userland/Libraries/LibWeb/HTML/DataTransfer.h
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* 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 {
|
||||
|
||||
class DataTransfer : public Bindings::PlatformObject {
|
||||
WEB_PLATFORM_OBJECT(DataTransfer, Bindings::PlatformObject);
|
||||
JS_DECLARE_ALLOCATOR(DataTransfer);
|
||||
|
||||
public:
|
||||
static JS::NonnullGCPtr<DataTransfer> construct_impl(JS::Realm&);
|
||||
virtual ~DataTransfer() override;
|
||||
|
||||
private:
|
||||
DataTransfer(JS::Realm&);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user