Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Does anyone know why about:blank is so magical that can't use the new HTML parser? Can it not be parsed like other pages?


Here's Henri Sivonen (the author of the HTML5 parser that is now Firefox' sole parser) on the subject: http://hsivonen.iki.fi/about-blank/.

From a quick reading, it seems to be a mix of synchronous vs asynchronous parsing, historical reasons, and stuff. He identifies eight different behaviors.


The Joy of about:blank: http://hsivonen.iki.fi/about-blank/


Thanks for the link unwind/paulrouget2.

I think it went a little over my head. What role does about:blank actually play? I'm assuming that the wild behaviour and parsing difficulty is the result of it performing some special function (beyond just returning a blank page).


A browsing context doesn't start its life empty. Instead, when a browsing context is created, if a JS program looks at what's in there, there's an about:blank doc in there. Since you can create a browsing context synchronously (e.g. document.body.appendChild(document.createElement("iframe"))), there has to be a way for the initial about:blank document to materialize synchronously. The HTML parser is always async. (Edit: The HTML parser is always async when loading a URL. Then there are innerHTML, createContextualFragment and DOMParser, which are synchronous.)

Add various events (readystatechange, DOMContentLoaded, load) to added fun. And the fact that browsing contexts that are top-level from the Web perspective are iframe-like from the XUL perspective and the code for dealing with this duality is a mess.


Really this seems incredibly strange.


Typical Mozilla nonsense




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: