5 ms·
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?
by xymostech 13y ago
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?
- workbench 13y agoTypical Mozilla nonsense
- stormbrew 13y agoReally this seems incredibly strange.
- paulrouget 13y agoThe Joy of about:blank: http://hsivonen.iki.fi/about-blank/ http://hsivonen.iki.fi/about-blank/
- unwind 13y agoHere's Henri Sivonen (the author of the HTML5 parser that is now Firefox' sole parser) on the subject: http://hsivonen.iki.fi/about-blank/ 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.
- knackers 13y agoThanks 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).
- hsivonen 13y agoA 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.