Bug 16014 - Make it clear that callbacks should only be used for Function
Make it clear that callbacks should only be used for Function
Status: RESOLVED WONTFIX
Product: WebAppsWG
Classification: Unclassified
Component: WebIDL
unspecified
All All
: P2 normal
: ---
Assigned To: Cameron McCormack
public-webapps-bugzilla
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-17 14:50 UTC by Ms2ger
Modified: 2012-02-23 18:19 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ms2ger 2012-02-17 14:50:23 UTC
We have a longstanding veto from Mozilla to use them for anything else, so it should be made clear to specification editors that they should not use it for anything else.
Comment 1 Anne 2012-02-17 14:54:53 UTC
Uh?
Comment 2 Anne 2012-02-22 11:52:53 UTC
The veto is bullshit as far as I can tell. E.g. http://dvcs.w3.org/hg/webperf/raw-file/tip/specs/RequestAnimationFrame/Overview.html#the-WindowAnimationTiming-interface is edited by someone working for Mozilla and uses callback.
Comment 3 Ms2ger 2012-02-22 11:54:30 UTC
Excellent example: it is implemented as an interface in Gecko: http://mxr.mozilla.org/mozilla-central/source/dom/interfaces/base/nsIFrameRequestCallback.idl#45
Comment 4 Anne 2012-02-22 12:00:17 UTC
Since nobody implements Web IDL yet I'm not really surprised.
Comment 5 Boris Zbarsky 2012-02-22 14:51:00 UTC
I have never seen Cameron actually do any editing on that spec.

And I thought I'd raised an issue on that use of callback.  I did it again just now, in case I hadn't before....
Comment 6 Cameron McCormack 2012-02-23 01:54:20 UTC
(In reply to comment #5)
> I have never seen Cameron actually do any editing on that spec.

I did write the initial text before it went into the repo there, but it's true James has done most of the work since.

http://dvcs.w3.org/hg/webperf/annotate/843f6eb989ba/specs/RequestAnimationFrame/Overview.xml

> And I thought I'd raised an issue on that use of callback.  I did it again just
> now, in case I hadn't before....

Note that this all came about due to some people preferring the old [Callback] and others writing [Callback=FunctionOnly], and it was clear that we needed to have some consistency across the platform.  At TPAC I believe we agreed to have the [Callback=FunctionOnly] behaviour be the default (IIRC).  As part of simplifying how to write the IDL for callbacks, I introduced the callback syntax for a terser way of doing:

  [Callback=FunctionOnly]
  interface Blah {
    void handleEvent(Whatever blah);
  };

and at the same time to simplify the "user object" vs "platform object" distinction in the spec.  I think it's useful for Web IDL to includes notes/warnings such as the one we have about the use of callback interfaces, so that we have something to point to when arguing for consistency between specifications written by different people.

I don't think it's helpful to describe some peoples' objections to the decision to have the callback syntax not support the object-with-property style as a "longstanding veto", and remember that it is rare for Mozilla people to have a unified, coordinated view on technical issues.

Anyway, I was the one who made the changes to the requestAnimationFrame spec to update it to use the new callback syntax before it was published as LCWD.  Note that before this the spec did use [Callback=FunctionOnly].

What I would ask people to do is if you wish to argue against the decision, to reply and argue against my mail where I worked through the pros and cons of the different approaches:

  http://lists.w3.org/Archives/Public/public-script-coord/2011OctDec/0319.html
  http://lists.w3.org/Archives/Public/public-script-coord/2011OctDec/0368.html
Comment 7 Ms2ger 2012-02-23 18:19:31 UTC
Please record my formal objection to this decision.