This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 20535 - consider removing indexed property setters, creators and deleters
Summary: consider removing indexed property setters, creators and deleters
Status: RESOLVED MOVED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: WebIDL (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Cameron McCormack
QA Contact: public-webapps-bugzilla
URL:
Whiteboard: [v1]
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-31 00:28 UTC by Cameron McCormack
Modified: 2017-12-06 11:15 UTC (History)
6 users (show)

See Also:


Attachments

Description Cameron McCormack 2012-12-31 00:28:03 UTC
Array-like interfaces defined using indexed property setters, creators and/or deleters don't behave nicely.  They can't be used in conjunction with Array.prototype functions unless we require the interface to support sparse array indexes.  They also don't seem to be used (there are plenty of indexed property getters on the other hand).

There is at least this use of an indexed property deleter:

http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#the-datatransferitemlist-interface

but that is pretty weird and bad design anyway IMO.


If we can remove indexed property setters, creators and deleters then we can think about a solution for mutable array-like objects that work better with JS Arrays.
Comment 1 Cameron McCormack 2012-12-31 00:29:13 UTC
See also https://mail.mozilla.org/pipermail/es-discuss/2012-December/027688.html for problems with [ArrayClass], which is related.
Comment 2 Boris Zbarsky 2012-12-31 06:48:07 UTC
HTMLOptionsCollection has an indexed setter/creator, and that's required for web compat.  I agree it's weird and bad design and generally crappy, but we can't get rid of it...

I'm not sure offhand whether anything needs deleters for backwards compat, but I doubt it.
Comment 3 Anne 2012-12-31 11:13:48 UTC
I missed HTMLOptionsCollection as it is not using the terms from IDL.
Comment 4 Boris Zbarsky 2012-12-31 17:47:23 UTC
Which terms, out of curiosity?
Comment 5 Anne 2012-12-31 18:57:51 UTC
"indexed property setters" and friends.
Comment 6 Boris Zbarsky 2012-12-31 19:03:11 UTC
For what it's worth, HTMLSelectElement also has an indexed setter/creator, also required for web compat.  I missed it in my scan last night because we haven't converted it to WebIDL yet.
Comment 7 Robin Berjon 2013-01-03 13:06:32 UTC
(In reply to comment #2)
> HTMLOptionsCollection has an indexed setter/creator, and that's required for
> web compat.  I agree it's weird and bad design and generally crappy, but we
> can't get rid of it...
> 
> I'm not sure offhand whether anything needs deleters for backwards compat,
> but I doubt it.

We can't get rid of what's needed for compat, but if we agree that they're bad design (which seems to be the case) we can rename them legacy* to flag the fact that they shouldn't be used for new APIs.
Comment 8 Anne 2013-01-05 11:54:06 UTC
Filed bug 20570 and bug 20571 on HTML.
Comment 9 Cameron McCormack 2015-01-20 06:48:38 UTC
I removed indexed property deleters:

https://github.com/heycam/webidl/commit/291dcc397f48029ac3954b2b0e511f4c14c7631d

Leaving this open for potentially renaming the rest to legacy*.
Comment 10 Anne 2017-12-06 11:15:23 UTC
Above comment is now tracked by https://github.com/heycam/webidl/issues/100.