[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Public WebGL] Should WebGLContextEvent have a constructor?



I notice that many recent drafts of contemporary specs (eg DOM4, HTML5, Workers, WebSockets, etc.) specify events as having constructors, and not init*Event methods. For example, DOM4 specifies CustomEvent this way:

<http://www.w3.org/TR/domcore/#interface-customevent>

[Constructor(DOMString type, optional CustomEventInit eventInitDict)]
interface CustomEvent : Event {
 readonly attribute any detail;
};

dictionary CustomEventInit : EventInit {
 any detail;
}

Would it beÂappropriate to change the definition of WebGLContextEvent from this:

interface WebGLContextEvent : Event {
 readonly attribute DOMString statusMessage;

 void initWebGLContextEvent(DOMString typeArg,
  boolean canBubbleArg,
  boolean cancelableArg,
  DOMString statusMessageArg);
};

To this:

[Constructor(DOMString type, optional WebGLContextEventInit eventInitDict)]
interface WebGLContextEvent : Event {
 readonly attribute DOMString statusMessage;
};

dictionary WebGLContextEventInit : EventInit {
 DOMString statusMessage;
};

Dominic