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 11032 - HTMLPropertiesCollection shouldn't be callable
Summary: HTMLPropertiesCollection shouldn't be callable
Status: RESOLVED WONTFIX
Alias: None
Product: HTML WG
Classification: Unclassified
Component: LC1 HTML Microdata (editor: Ian Hickson) (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-13 23:47 UTC by Cameron McCormack
Modified: 2011-08-04 05:05 UTC (History)
5 users (show)

See Also:


Attachments

Description Cameron McCormack 2010-10-13 23:47:46 UTC
It would be good if HTMLPropertiesCollection weren't callable.  One way to achieve that would be to make HTMLPropertiesCollection not inherit from HTMLCollection, and defined length and item explicitly on it.
Comment 1 Ian 'Hixie' Hickson 2010-10-14 09:37:49 UTC
I need another way. They didn't inherit before, and people asked me to make them inherit, so they could do overrides on all collections at once, etc.

Is there some way I can make this happen just for implementations of HTMLCollection directly, or whatever the requirement is? Some way to override caller on a derived interface? Anything?
Comment 2 Simon Pieters 2010-10-14 20:23:14 UTC
Maybe you can remove the callable from HTMLCollection and mint a new interface that inherits from HTMLCollection (or implements HTMLCollection?) with [NoInterfaceObject] that has callable?
Comment 3 Cameron McCormack 2010-10-14 22:15:01 UTC
Technically, you can't override any of the special operations in Web IDL.  (It says that it's undefined what happens if a host object implements two interfaces with a name getter, for example.)  Seems like that's needed for various interfaces in HTML5.  Filed http://www.w3.org/Bugs/Public/show_bug.cgi?id=11056.

(In reply to comment #2)
> Maybe you can remove the callable from HTMLCollection and mint a new interface
> that inherits from HTMLCollection (or implements HTMLCollection?) with
> [NoInterfaceObject] that has callable?

Having an HTMLCallableCollection that implements HTMLCollection wouldn't work, due to the way mixin interfaces are currently specced -- you wouldn't be able to add a property to HTMLCollection.prototype and see that reflected on objects implementing interfaces inheriting from HTMLCallableCollection.

But minting a new one to place in the inheritance chain should work:

  interface HTMLCollection { ... }

  [NoInterfaceObject]
  interface HTMLCallableCollection : HTMLCollection {
    caller ...
  }

  interface HTMLAllCollection : HTMLCallableCollection { ... }

  interface HTMLPropertiesCollection : HTMLCollection { ... }

Now, there still would exist an interface prototype object for HTMLCallableCollection.  And if you didn't want that, putting [Supplemental] on it wouldn't work; you'd need a new extended attribute to mean that interfaces that inherit from it get all of its properties.

Or, another way:

  interface HTMLCollection { ... }

  [NoInterfaceObject]
  interface HTMLCollectionCaller {
    caller ...
  }

  interface HTMLAllCollection : HTMLCollection {
    ...
  }
  HTMLAllCollection implements HTMLCollectionCaller;

  interface HTMLPropertiesCollection : HTMLCollection { }

The interface prototype object for HTMLCollectionCaller need not even exist, since it's not accessible anywhere.
Comment 4 Anne 2010-10-16 12:32:05 UTC
Or we could just duplicate the interface definitions (one for HTMLCollection and one for HTMLAllCollection) and tie the definitions of the members. Might be the most straightforward.

Or something like a [DisableCallers] attribute on the interface.
Comment 5 Ian 'Hixie' Hickson 2010-12-26 20:04:01 UTC
I'm leaning towards just letting it be callable, personally.
Comment 6 Ian 'Hixie' Hickson 2011-01-11 20:29:38 UTC
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Rejected
Change Description: no spec change
Rationale: I'm just going to let it be callable, for consistency with the other collections.
Comment 7 Michael[tm] Smith 2011-08-04 05:05:34 UTC
mass-move component to LC1