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 16014 - Make it clear that callbacks should only be used for Function
Summary: Make it clear that callbacks should only be used for Function
Status: RESOLVED WONTFIX
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:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-17 14:50 UTC by Ms2ger
Modified: 2012-02-23 18:19 UTC (History)
4 users (show)

See Also:


Attachments

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.