Bug 94477

Summary: Update postMessage declaration in MessagePort.idl
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebCore Misc.Assignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, darin, eric, haraken, levin, ojan, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
URL: http://www.w3.org/TR/html5/comms.html#messageport
Attachments:
Description Flags
Patch none

Description Chris Dumez 2012-08-20 07:04:35 PDT
postMessage() / webkitPostMessage() are defined as follows in MessagePort.idl:
[Custom] void postMessage(in DOMString message, in [Optional] Array messagePorts)
[Custom] void webkitPostMessage(in DOMString message, in [Optional] Array transfer)

According to the spec (http://www.w3.org/TR/html5/comms.html#messageport), the first argument should be of type 'any', not 'DOMString'.
We currently don't notice the issue cause we provide custom implementation for those methods and the custom implementation handles the first argument as being of type 'any'.

We should however update MessagePort.idl to avoid confusion.
Comment 1 Chris Dumez 2012-08-20 07:07:54 PDT
Created attachment 159419 [details]
Patch
Comment 2 Kentaro Hara 2012-08-20 08:49:21 PDT
Comment on attachment 159419 [details]
Patch

The change looks reasonable. DedicatedWorkerContext.idl already uses 'any' for postMessage() and webkitPostMessage().

> We currently don't notice the issue cause we provide custom implementation for those methods and the custom implementation handles the first argument as being of type 'any'.

Note: Code generators do not yet support 'any', so we can use 'any' only for custom implementations. We want to fix it.
Comment 3 WebKit Review Bot 2012-08-20 09:39:26 PDT
Comment on attachment 159419 [details]
Patch

Clearing flags on attachment: 159419

Committed r126040: <http://trac.webkit.org/changeset/126040>
Comment 4 WebKit Review Bot 2012-08-20 09:39:32 PDT
All reviewed patches have been landed.  Closing bug.