Let's try it. At one point it made the world catch fire due to code that special cases Firefox vs WebKit (ex. Closure, a bunch of google3)... But if Edge is getting away with it maybe we can too. :)
On Jul 26, 2016 9:56 PM, "Dominic Cooney" <domi...@chromium.org> wrote:
>
> I noticed Firefox doesn't process javascript: iframe src URLs synchronously; Blink does (trace forward and backward from HTMLFrameElementBase::openURL.) So something like this:
>
> <!DOCTYPE html>
> <body>
> <script>
> let f = document.createElement('iframe');
> f.src = 'javascript:console.log("b");';
>
> console.log('a');
> document.body.appendChild(f);
> console.log('c');
> f.remove();
> document.body.appendChild(f);
> </script>
>
> prints a, c, b in Firefox but a, b, c, b in Blink.
>
> What do you think about making these loads asynchronous? It would have a number of benefits:
>
> - Be more like Firefox. (Not sure what other browsers do.)
> - Comply with the spec, I think (see navigate step 12, which says to "queue a task.")
> - Avoid a state where the parser is synchronously running script but hasn't set up its usual state of being blocked. (<-- I'm mostly interested in this, FWIW. I'm poking at script running for custom elements.)
I'm pretty sure the parser can run script in parserRemoveChild and parserAppendChild for various other reasons. Where is this script running in the parser that you don't expect? I don't think changing javascript: urls makes this simpler.
- E
This whole thread is amazing. Thank you for digging into this, Dominic.:DG<