mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-19 15:32:31 +00:00
LibWeb: Implement the DataTransferItemList length attribute
This commit is contained in:
parent
74d9cfbf2a
commit
843f8f04a5
Notes:
github-actions[bot]
2024-08-22 12:22:32 +00:00
Author: https://github.com/trflynn89
Commit: 843f8f04a5
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1158
Reviewed-by: https://github.com/shannonbooth
8 changed files with 31 additions and 5 deletions
|
@ -41,6 +41,14 @@ void DataTransferItemList::visit_edges(JS::Cell::Visitor& visitor)
|
|||
visitor.visit(m_data_transfer);
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/dnd.html#dom-datatransferitemlist-length
|
||||
WebIDL::UnsignedLong DataTransferItemList::length() const
|
||||
{
|
||||
// The length attribute must return zero if the object is in the disabled mode; otherwise it must return the number
|
||||
// of items in the drag data store item list.
|
||||
return m_data_transfer->length();
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/dnd.html#dom-datatransferitemlist-add
|
||||
WebIDL::ExceptionOr<JS::GCPtr<DataTransferItem>> DataTransferItemList::add(String const& data, String const& type)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue