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 13499 - Introduce "assume-null-if-not-object" flag
Summary: Introduce "assume-null-if-not-object" flag
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: WebIDL (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Cameron McCormack
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 13433 14351 14352
  Show dependency treegraph
 
Reported: 2011-08-01 11:35 UTC by Anne
Modified: 2011-10-01 08:50 UTC (History)
4 users (show)

See Also:


Attachments

Description Anne 2011-08-01 11:35:57 UTC
Event handler IDL attributes either take a Function object or null. However, the behavior in user agents is such that whenever you assign a non-Function null is assumed (e.g. "test", 2, []).

Maybe this can be combined with [AllowAny] somehow? Not sure if that is worth it though.
Comment 1 Jonas Sicking (Not reading bugmail) 2011-08-01 17:26:22 UTC
Which user agents behave this way? I suspect Gecko does, but I'd be interested to know what others do.
Comment 2 Boris Zbarsky 2011-08-01 17:27:44 UTC
All of them, basically.  See http://www.w3.org/Bugs/Public/show_bug.cgi?id=13433 (which should probably have been referenced in comment 0) for details.
Comment 3 Anne 2011-08-02 11:26:44 UTC
addEventListener()'s EventListener also seems affected by this. Have not tested other callbacks, but did notice that the timeout API already accepts "any".
Comment 4 Boris Zbarsky 2011-08-02 13:40:18 UTC
> addEventListener()'s EventListener also seems affected by this.

Only in some browsers.
Comment 5 Cameron McCormack 2011-08-25 04:45:06 UTC
It wasn't clear to me reading through bug 13433 and this one again whether we want to treat as null (a) non-callable objects, (b) non-Function objects or (c) non-objects.  I've assumed (a) for now and added [TreatNonCallableAsNull].

http://dev.w3.org/cvsweb/2006/webapi/WebIDL/Overview.html.diff?r1=1.355;r2=1.356;f=h

Let me know if that works or needs changes.