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 26101 - say what to do with event initializer dictionaries that have members without a default value
Summary: say what to do with event initializer dictionaries that have members without ...
Status: RESOLVED WORKSFORME
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: DOM (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Anne
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-16 05:29 UTC by Cameron McCormack
Modified: 2014-10-14 11:58 UTC (History)
5 users (show)

See Also:


Attachments

Description Cameron McCormack 2014-06-16 05:29:10 UTC
If we have this:

  dictionary SomeEventInit : EventInit {
    sequence<DOMString> values;
  };

  [Constructor(optional SomeEventInit eventInitDict)]
  interface SomeEvent : Event {
    [Cached] readonly attribute sequence<DOMString> values;
  };

assuming that [Cached] is a thing, then http://dom.spec.whatwg.org/#concept-event-constructor doesn't handle what to do when the values dictionary member is not present, for example if you do:

  new SomeEvent({});

Maybe the http://dom.spec.whatwg.org/#concept-event-constructor algorithm allow prose in other specs to describe how the Event object members get their values in this case?
Comment 1 Boris Zbarsky 2014-06-16 05:43:34 UTC
For this specific case (sequences), I think we should allow a default value.  See also bug 25391.
Comment 2 Anne 2014-06-16 06:09:17 UTC
Travis might need such a hook to define keyboard events.
Comment 3 Anne 2014-06-16 06:46:07 UTC
Suggestions welcome on how to define this by the way. "default value for attribute /x/" or some such?

(Should we also update the specification to more clearly indicate the internal properties of an event are being set (as the exposed are readonly)? Not sure how to do that though.)
Comment 4 Olli Pettay 2014-06-16 09:22:33 UTC
So why isn't bug 25391, = [] , enough?
(Or change the SomeEvent to use sequence<DOMString>? and default to null)
Comment 5 Anne 2014-10-14 11:58:42 UTC
It seems this is taken care of now through changes in IDL.