[webkit-dev] How to handle Array types in IDL files?

Drew Wilson atwilson at google.com
Tue Aug 25 23:43:44 PDT 2009


I'm trying to update MessageEvent to match the current HTML5 spec.
Currently, MessageEvent has two references to MessagePort:

        readonly attribute *MessagePort messagePort*;

        void initMessageEvent(in DOMString typeArg, in boolean canBubbleArg,
in boolean cancelableArg, in DOMString dataArg, in DOMString originArg, in
DOMString lastEventIdArg, in DOMWindow sourceArg, *in MessagePort
messagePort*);

MessageEvent now needs to support an array of MessagePorts. I had planned to
provide a custom getter for the messagePort attribute and change
initMessageEvent to be custom as well, resulting in this:

        readonly attribute [CustomGetter] *Array ports*;

        [Custom] void initMessageEvent(in DOMString typeArg, in boolean
canBubbleArg, in boolean cancelableArg, in DOMString dataArg, in DOMString
originArg, in DOMString lastEventIdArg, in DOMWindow sourceArg, *in Array
messagePorts*);

My custom JS handlers could map between JSArray and the native WebCore
collection used by the impl class. I'm not certain whether this is the right
approach for the objc bindings, however - in fact, the generated code for
DOMMessageEvent.mm contains "#import Array.h" and "#import
DOMArrayInternal.h", neither of which exist.

What do people suggest here? I'm not certain how this should be exposed for
ObjC. Other classes (like Clipboard.idl) that use Array don't seem to have
objc bindings, but I don't think that's an option for MessageEvent.

-atw
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20090825/9051a7b1/attachment.html>


More information about the webkit-dev mailing list