News for hackers. Stuff that matters.
Re:Off-main-thread HTML parsing in Servo by rossy on Friday August 25, 2017 @01:31AM (#15096333)
> it's horrible for developers to use and no-one I know advocates it

I've seen developers advocate for document.write to inject locally-hosted JavaScript as a fallback for when CDNs are down: https://www.hanselman.com/blog/CDNsFailButYourScriptsDontHav...

I definitely don't agree with this method, but there you go. Apparently ASP.NET 4.5 will even insert this pattern automatically.

Re:Off-main-thread HTML parsing in Servo by CrystalGamma on Friday August 25, 2017 @02:33AM (#15096581)
You could still insert <script> elements, you just wouldn't do it with document.write().
Re:Off-main-thread HTML parsing in Servo by pygy_ on Friday August 25, 2017 @05:15AM (#15097151)
I may be wrong, but I think that document.write() will load the script synchronously while inserting a `script` element will not.
Re:Off-main-thread HTML parsing in Servo by acdha on Friday August 25, 2017 @08:44AM (#15098003)
You can set async=false on a dynamic script element to avoid the default asynchronous behaviour.
Re:Off-main-thread HTML parsing in Servo by pygy_ on Friday August 25, 2017 @01:35PM (#15100491)
I just looked at the support matrix: IE10+. So it is reasonably supported nowadays, nice :-)
Re:Off-main-thread HTML parsing in Servo by acdha on Friday August 25, 2017 @06:29PM (#15102773)
Working on the web is refreshing like that these days — so many things which used to be painful are now just standards + “Microsoft doesn't support that old version of IE and neither do we”.