Page 1 of 1

surrogate issues

Posted: Sat Mar 26, 2011 11:34 pm
by al_9x
NS 2.1, new profile, defaults NS settings
  1. !@* and @* match empty about:blank iframes (<iframe></iframe>) in Fx 3.6.16 and not in Fx 4.0.0. Just to be clear these are not frames whose document.URL is not yet returning the right url, but real about:blank frames. In 2.0.9.9 they didn't. I am guessing the 4.0.0 & 2.0.9.9 behavior is correct, maybe even more efficient, excluding about:blank early in the processing
  2. @* is invoked twice on a normal iframe (Fx 3.6.16, 4.0.0 is ok):

    surrogate:

    Code: Select all

    dump('@ surrogate - '+window.name+' : '+document.URL+'\n');
    
    page:

    Code: Select all

    <html>
    <head>
    <script>
    function evHandler(e)
    {
    	dump(e.type + '\n');
    }
    function writeFrame()
    {
    	var w = document.getElementById('frame1').contentWindow;
    	w.document.open();
    	//w.addEventListener('load', evHandler, false);
    	//w.addEventListener('DOMContentLoaded', evHandler, false);
    	w.document.write('doc.written');
    	w.document.close();
    }
    function changeSource()
    {
    	document.getElementById('frame1').src = 'empty.htm';
    }
    </script>
    </head>
    <body>
    <button onclick="writeFrame();">write frame</button>
    <button onclick="changeSource();">change src</button><br>
    <iframe id="frame1" name="frame1"></iframe><br>
    <iframe id="frame2" name="frame2" src="empty.htm"></iframe>
    </body>
    </html>
    
    dump (also illustrates the first issue), f5 produces 1 dump for frame1, ctrl-f5 produces 2, and both produce 2 for frame2

    Code: Select all

    @ surrogate -  : http://localhost/tests/iframe/docwritten.htm
    @ surrogate - frame1 : about:blank
    @ surrogate - frame2 : about:blank
    @ surrogate - frame1 : about:blank
    @ surrogate - frame2 : http://localhost/tests/iframe/empty.htm
    
    Also, check the error console, there's an ABE LOCAL rule match for both the parent and the iframe, it doesn't stop the loading but why the message?
  3. doc.written iframe does not invoke either @* or @!* in Fx 3.6.16, but does in Fx 4.0.0

Re: surrogate issues

Posted: Sun Mar 27, 2011 2:00 am
by al_9x
al_9x wrote:Also, check the error console, there's an ABE LOCAL rule match for both the parent and the iframe, it doesn't stop the loading but why the message?
This is fixed in 2.1.0.1rc1.

Re: surrogate issues

Posted: Fri Apr 15, 2011 10:31 pm
by Giorgio Maone
al_9x wrote:!@* and @* match empty about:blank iframes (<iframe></iframe>) in Fx 3.6.16 and not in Fx 4.0.0. Just to be clear these are not frames whose document.URL is not yet returning the right url, but real about:blank frames. In 2.0.9.9 they didn't. I am guessing the 4.0.0 & 2.0.9.9 behavior is correct, maybe even more efficient, excluding about:blank early in the processing
Yes, likely, but not a top priority since Fx 4.0 has the desired behavior. As you've seen Script Surrogates are not easy to handle without side effect, so if it's not (utterly) broken I wouldn't touch it.
al_9x wrote:@* is invoked twice on a normal iframe (Fx 3.6.16, 4.0.0 is ok):
This is likely a variant of the issue above, and it depends on the fact surrogates are triggered by a different (and earlier) event in Fx 3.6 (which intercepts about:blank before the actual load) while Fx 4 exposes a new event, which comes a bit later and for regular content documents only.
al_9x wrote: Also, check the error console, there's an ABE LOCAL rule match for both the parent and the iframe, it doesn't stop the loading but why the message?

Code: Select all

doc.written iframe does not invoke either @* or @!* in Fx 3.6.16, but does in Fx 4.0.0
This does deserve more investigation.