WICG / cookie-store

Asynchronous access to cookies from JavaScript
https://wicg.github.io/cookie-store/
Apache License 2.0
144 stars 35 forks source link

CookieChangeEvent cannot have CookieList attributes #156

Closed domenic closed 4 years ago

domenic commented 4 years ago

CookieList is defined as a sequence<CookieListItem>.

However, attributes cannot be of sequence type.

I think these should instead be FrozenArray<CookieListItem>.

Additionally, it would be good to add web platform tests that event.changed === event.changed, and event.deleted === event.deleted. (This is a common failure mode for array-valued IDL attributes.)

ayuishii commented 4 years ago

Thanks for catching this!

Instead of updating CookieList to use FrozenArray, I updated CookieChangeEvent to use FrozenArray<CookieListItem> so the other instances can continue using sequence<CookieListItem>. Some discussion on this can be found on the PR, but let me know if that sounds ok.

Will track implementation changes in Chrome here.

domenic commented 4 years ago

The spec looks good now! I might remove the indirection of the CookieList typedef, personally, but that's a style choice. Happy to close this.