LibWeb: Implement the DataTransfer items attribute

This commit is contained in:
Timothy Flynn 2024-08-20 18:44:22 -04:00 committed by Andreas Kling
commit 1b70362954
Notes: github-actions[bot] 2024-08-22 12:23:05 +00:00
5 changed files with 43 additions and 3 deletions

View file

@ -49,6 +49,8 @@ public:
void set_effect_allowed(FlyString);
void set_effect_allowed_internal(FlyString);
JS::NonnullGCPtr<DataTransferItemList> items();
ReadonlySpan<String> types() const;
String get_data(String const& format) const;
JS::NonnullGCPtr<FileAPI::FileList> files() const;
@ -60,6 +62,7 @@ private:
DataTransfer(JS::Realm&);
virtual void initialize(JS::Realm&) override;
virtual void visit_edges(JS::Cell::Visitor&) override;
void update_data_transfer_types_list();
@ -69,6 +72,9 @@ private:
// https://html.spec.whatwg.org/multipage/dnd.html#dom-datatransfer-effectallowed
FlyString m_effect_allowed { DataTransferEffect::none };
// https://html.spec.whatwg.org/multipage/dnd.html#dom-datatransfer-items
JS::GCPtr<DataTransferItemList> m_items;
// https://html.spec.whatwg.org/multipage/dnd.html#concept-datatransfer-types
Vector<String> m_types;