mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-19 14:40:18 +00:00
LibWeb: Implement DataTransferItemList.clear()
This commit is contained in:
parent
0c1532626f
commit
3fc7613bf1
Notes:
github-actions[bot]
2025-09-12 10:31:38 +00:00
Author: https://github.com/tcl3
Commit: 3fc7613bf1
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6088
Reviewed-by: https://github.com/gmta
3 changed files with 11 additions and 1 deletions
|
@ -125,6 +125,15 @@ WebIDL::ExceptionOr<void> DataTransferItemList::remove(WebIDL::UnsignedLong inde
|
|||
return {};
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/dnd.html#dom-datatransferitemlist-clear
|
||||
void DataTransferItemList::clear()
|
||||
{
|
||||
// The clear() method, if the DataTransferItemList object is in the read/write mode, must remove all the items from
|
||||
// the drag data store. Otherwise, it must do nothing.
|
||||
if (m_data_transfer->mode() == DragDataStore::Mode::ReadWrite)
|
||||
m_data_transfer->clear_data();
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/dnd.html#dom-datatransferitemlist-item
|
||||
Optional<JS::Value> DataTransferItemList::item_value(size_t index) const
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue