mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
DataTransferItem
: improve spec compliance (#35418)
* DataTransfer: remove PlainString and Binary structs Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> * add DataTransferItemList remove() test case Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> * bring datatransferitem closer to the spec Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> * queue a task to invoke the callback Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> --------- Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
This commit is contained in:
parent
0e9bebce0f
commit
966888615f
7 changed files with 198 additions and 125 deletions
2
tests/wpt/meta/MANIFEST.json
vendored
2
tests/wpt/meta/MANIFEST.json
vendored
|
@ -709557,7 +709557,7 @@
|
|||
]
|
||||
],
|
||||
"datatransferitemlist-remove.html": [
|
||||
"19316181c5fc61f6561054fa5d628d9285de1468",
|
||||
"89f8cfd320025540991f2532f47bab5c4700d1f7",
|
||||
[
|
||||
null,
|
||||
{}
|
||||
|
|
|
@ -20,4 +20,20 @@ test(() => {
|
|||
// Must not throw
|
||||
dt.items.remove(1);
|
||||
}, "remove()ing an out-of-bounds index does nothing");
|
||||
|
||||
test(() => {
|
||||
const file = new File(["🕺💃"], "test.png", {
|
||||
type: "image/png"
|
||||
});
|
||||
|
||||
const dt = new DataTransfer();
|
||||
dt.items.add(file);
|
||||
|
||||
let item = dt.items[0];
|
||||
dt.items.remove(0);
|
||||
|
||||
assert_equals(item.kind, "");
|
||||
assert_equals(item.type, "");
|
||||
assert_equals(item.getAsFile(), null);
|
||||
}, "remove()ing an item will put the associated DataTransferItem object in the disabled mode");
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue