Re: [whatwg] Request: window.postMessage should be async

2008-04-11 Thread Jonas Sicking
Aaron Boodman wrote: Here is one more point on the async vs sync thing. In my opinion, one of the most compelling reasons to make an API synchronous instead of asynchronous is convenience. This is why I was so passionate about having a synchronous database API: getting the result of a call via

Re: [whatwg] Request: window.postMessage should be async

2008-04-06 Thread Nicholas C. Zakas
- Original Message From: Peter Kasting [EMAIL PROTECTED] To: Jeff Walden [EMAIL PROTECTED] Cc: whatwg@lists.whatwg.org Sent: Saturday, April 5, 2008 3:51:53 PM Subject: Re: [whatwg] Request: window.postMessage should be async On Sat, Apr 5, 2008 at 2:19 PM, Jeff Walden [EMAIL PROTECTED] wrote

Re: [whatwg] Request: window.postMessage should be async

2008-04-06 Thread Aaron Boodman
On Sun, Apr 6, 2008 at 1:52 AM, Aaron Boodman [EMAIL PROTECTED] wrote: There doesn't seem to be any advantage to it. I take it back, there is one advantage, which Jeff brought up: function realMessageHandler(messageEvent) { // handle the message... // and, reply to the message

Re: [whatwg] Request: window.postMessage should be async

2008-04-06 Thread Aaron Boodman
Here is one more point on the async vs sync thing. In my opinion, one of the most compelling reasons to make an API synchronous instead of asynchronous is convenience. This is why I was so passionate about having a synchronous database API: getting the result of a call via a return value is much

Re: [whatwg] Request: window.postMessage should be async

2008-04-06 Thread Peter Kasting
On Sun, Apr 6, 2008 at 1:52 AM, Aaron Boodman [EMAIL PROTECTED] wrote: We have on one hand authors with reasons (however edge casey you may believe them to be) they would prefer the API be asynchronous, Here's another problem an async API would automatically address:

Re: [whatwg] Request: window.postMessage should be async

2008-04-06 Thread Anne van Kesteren
On Sun, 06 Apr 2008 11:41:20 +0200, Peter Kasting [EMAIL PROTECTED] wrote: Here's another problem an async API would automatically address: https://bugzilla.mozilla.org/show_bug.cgi?id=416912 FWIW, Opera is ok either way. I personally think it doesn't make much sense for this to be

Re: [whatwg] Request: window.postMessage should be async

2008-04-06 Thread Jeff Walden
Peter Kasting wrote: Here's another problem an async API would automatically address: https://bugzilla.mozilla.org/show_bug.cgi?id=416912 That *should* be handled by a slow-script dialog, and the fact that it isn't is simply a bug. That the bug is triggered using postMessage is in my opinion

Re: [whatwg] Request: window.postMessage should be async

2008-04-05 Thread Peter Kasting
(Apologies if the threading on this gets messed up. I was not subscribed to the list when the original message was sent.) I want to paint Eric's scenario more strongly, because it seems like people think if it would rarely blow up then it doesn't matter. If you want to handle _any_ request sent

Re: [whatwg] Request: window.postMessage should be async

2008-04-05 Thread Adam Barth
Peter, On Sat, Apr 5, 2008 at 12:38 AM, Peter Kasting [EMAIL PROTECTED] wrote: Or, if you like, take the position that the argument should stay optional, and if someone for some reason doesn't have to care about security (?!), they can avoid passing it. Although I'm not sure this is a

Re: [whatwg] Request: window.postMessage should be async

2008-04-05 Thread Jeff Walden
Peter Kasting wrote: It doesn't matter if the stack will not _commonly_ be too deep, or if it isn't too deep for the callers that you know about right now -- it might be too deep at some point (after someone else changes the caller code, for example), and your sync handler will blow up. So

Re: [whatwg] Request: window.postMessage should be async

2008-04-05 Thread Peter Kasting
On Sat, Apr 5, 2008 at 2:19 PM, Jeff Walden [EMAIL PROTECTED][EMAIL PROTECTED] wrote: Peter Kasting wrote: It doesn't matter if the stack will not _commonly_ be too deep, or if it isn't too deep for the callers that you know about right now -- it might be too deep at some point (after

Re: [whatwg] Request: window.postMessage should be async

2008-04-04 Thread Anne van Kesteren
On Fri, 04 Apr 2008 23:04:30 +0200, Eric Seidel [EMAIL PROTECTED] wrote: Anyway, I'm not the foremost expert here, but I was reading HTML5 last week and encountered this sync postMessage() requirement, which seemed like a bad idea. It doesn't make sense to change this given that all

Re: [whatwg] Request: window.postMessage should be async

2008-04-04 Thread Aaron Boodman
On Fri, Apr 4, 2008 at 2:39 PM, Anne van Kesteren [EMAIL PROTECTED] wrote: It doesn't make sense to change this given that all synthesized event dispatching is synchronous. I don't think postMessage() should be different. It seems a little different to me. PostMesasge events are fired in

Re: [whatwg] Request: window.postMessage should be async

2008-04-04 Thread Jeff Walden
Eric Seidel wrote: 1. JS content authors will want an async API. Sometimes, for the large applications; small apps won't care. As you note, the workaround of immediately packaging up a setTimeout continuation isn't difficult. I tend to think worrying about the N-1 case is designing a bit

Re: [whatwg] Request: window.postMessage should be async

2008-04-04 Thread Eric Seidel
Anne- Thanks for the reply. I see window.postMessage as different from element.dispatchEvent. The JS author has control over the JS code executed as a result of their dispatchEvent call. JS author does not have control over code executed by window.postMessage (either before and after, or

Re: [whatwg] Request: window.postMessage should be async

2008-04-04 Thread Anne van Kesteren
On Sat, 05 Apr 2008 00:03:58 +0200, Aaron Boodman [EMAIL PROTECTED] wrote: On Fri, Apr 4, 2008 at 2:39 PM, Anne van Kesteren [EMAIL PROTECTED] wrote: It doesn't make sense to change this given that all synthesized event dispatching is synchronous. I don't think postMessage() should be