<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Aug 3, 2009, at 10:34 AM, Daniel Gredler wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><br><div class="gmail_quote">On Sat, Aug 1, 2009 at 4:59 PM, Ian Hickson <span dir="ltr">&lt;<a href="mailto:ian@hixie.ch">ian@hixie.ch</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> <div class="im">On Wed, 22 Jul 2009, Daniel Gredler wrote:<br> &gt;<br> &gt; First, why does the structured clone algorithm used by postMessage() [1]<br> &gt; throw an exception if it encounters cycles? It seems to me that the<br> &gt; memory-based logic which is used to catch cycles could easily be<br> &gt; modified to resolve them instead. The only possible reason I can think<br> &gt; of is to match JSON semantics, and the only reason I can think of to<br> &gt; want to match JSON semantics is to make implementers lives easier<br> &gt; (witness Firefox 3.5, which just JSONifies objects passed to<br> &gt; postMessage()). However, this is a huge limitation, and I'm not sure<br> &gt; that the correct trade-off is to make implementers lives easier at the<br> &gt; expense of making web designers lives harder.<br> <br> </div>Your guess is correct. I imagine we'll lift the restriction eventually; if<br> you want to make that happen quicker, then I encourage you to speak<br> directly to the browser vendors implementing this, and convince them it'd<br> be worth it. :-)<br><div></div></blockquote><div><br><br>I know Anne VK (Opera) and ROC (Mozilla) appear to read this list... any comments, guys? Should I just file bugs? Any Safari / Chrome / IE guys out there with comments?<br></div></div></blockquote><div><br></div><div>I'd prefer to stick with JSONic object graphs for now. Correctly cloning&nbsp;more&nbsp;complicated&nbsp;object&nbsp;structures&nbsp;is&nbsp;a&nbsp;fair&nbsp;bit&nbsp;more&nbsp;complicated,&nbsp;so&nbsp;I'd&nbsp;like&nbsp;to&nbsp;get&nbsp;solid&nbsp;interop&nbsp;on&nbsp;the&nbsp;basic&nbsp;cases&nbsp;first.&nbsp;Also,&nbsp;the&nbsp;idea&nbsp;is&nbsp;that&nbsp;postMessage()&nbsp;should&nbsp;be&nbsp;sending&nbsp;object&nbsp;structures&nbsp;that&nbsp;are&nbsp;essentially&nbsp;pure&nbsp;data.&nbsp;JSON&nbsp;seems&nbsp;to&nbsp;capture&nbsp;pretty&nbsp;well&nbsp;the&nbsp;idea&nbsp;of&nbsp;a&nbsp;pure&nbsp;data&nbsp;structure in JavaScript.</div><div><br></div><div>Regards,</div><div>Maciej</div><div><br></div></div></body></html>