<div class="gmail_quote">On Fri, Nov 12, 2010 at 2:29 PM, Jonas Sicking <span dir="ltr"><jonas@sicking.cc></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
You looking at only part of what Henri said. He also pointed to<br>
<div class="im"><br>
<a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=11191" target="_blank">http://www.w3.org/Bugs/Public/show_bug.cgi?id=11191</a><br>
<br>
</div>which is a request to change HTML5 so that createContextualFragment<br>
can specify that scripts should remain executable.<br></blockquote><div><br></div><div>However, this request has not been granted yet.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">
>> * Since scripts don't execute synchronously from within<br>
>> createContextualFragment the caller doesn't have to deal with weird<br>
>> reentrancy issues during parsing.<br>
><br>
> Sure but that means we have to special-case fragments created<br>
> by createContexualFragment. That adds extra complexity to the HTML fragment<br>
> parsing algorithm.<br>
<br>
</div>I'd prefer to single out scripts only in one API than in multiple ones.<br></blockquote><div><br></div><div>innerHTML and createContexualFragment both use the HTML fragment parsing algorithm. If you had implemented these features as described in the spec, there should be no differences.</div>
<div><br></div><div><div>My concern is that treating script elements in a fragment differently based on whether the fragment was added by innerHTML or createContextualFragment is confusing to the developers. I would, if I was a developer. If developers wanted to load a script file, they can explicitly load the file and use eval, no?</div>
<meta charset="utf-8"></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">
>> For these reasons we decided to keep Firefox 4 behaving like previous<br>
>> versions of firefox and allow scripts created using<br>
>> createContextualFragment to execute.<br>
><br>
> However, Firefox 4.0 Beta 6 does not execute the script as far as I tested.<br>
> Try opening <a href="http://dscoder.com/MessageStyle/testcase.html" target="_blank">http://dscoder.com/MessageStyle/testcase.html</a><br>
<br>
</div>That's old code at this point. And it resulted in people filing bugs<br>
on us. I forget if we fixed it for beta7 or not, but if you try recent<br>
nightlies it should work there.<font class="Apple-style-span" color="#888888"><br></font></blockquote></div><br><div>OK. Thanks for clarification.</div><div><br></div><div>- Ryosuke</div>