Closed foolip closed 6 years ago
I had them as callback functions until https://github.com/WICG/entries-api/commit/34fc21ff4abe66caa204626ea0cf7d95a71231e1 but smaug____ requested changing them to callback interfaces. Perhaps there was a good reason...
It would be well worth testing if these actually behave like callback interfaces in Chrome/Blink, I suspect that they do not. I've tried to do it myself, but I'm honestly unable to figure out how to get to one of these APIs using <input type=file multiple webkitdirectory>
or <div webkitdropzone>
.
@foolip - I added slightly more fleshed out examples for webkitEntries
and webkitRelativePath
.
Part of the weirdness is that webkitEntries
is only populated in Chrome if you D&D onto an HTMLInputElement without webkitdirectory. If you click/select instead it doesn't populate it, and if you have webkitdirectory it doesn't populate it either (but it does fill in webkitRelativePath on the File instances). Wheee.
Per IRC (#whatwg), smaug____ indicates the change was requested just to match Blink. I guess the onus is on Blink to try changing.
re: testing - per @domenic Blink doesn't actually support callback interfaces (except for event handlers and nodeFilter). Matches my local testing.
Promises please. :x Always.
Promises please.
For a new API, obviously. But this is documenting an existing API. The question is how to accurately describe the existing behavior to support interop.
Ping this issue? Other implementers looking at the current IDL would probably think that window.ErrorCallback
should exist, but it actually shouldn't.
PRs welcome (spec and test). :)
Seriously though - remind me after the US holiday if I forget again. Easy change to spec/test/Blink impl.
https://wicg.github.io/entries-api/#callbackdef-errorcallback https://wicg.github.io/entries-api/#callbackdef-entrycallback https://wicg.github.io/entries-api/#callbackdef-entriescallback https://wicg.github.io/entries-api/#callbackdef-filecallback
These looks like callback interfaces in Blink's IDL files, but probably don't actually work like that, see https://bugs.chromium.org/p/chromium/issues/detail?id=630986
Even if it currently works like callback interfaces in Blink, it's probably worth attempting to switch to callback functions, because it's a quirk that it's unlikely that content depends on and
handleEvent
makes no sense as a name here.