April 26, 2010

Why isn't the browser rendering engine loaded dynamically?

I got thinking this morning after reading yet another blog post about replacing IE6... Actually, this one was veiled as Google trying to oust IE as the market leader, but it got me to thinking about a longer term solution to the problem that will clearly be replayed in corporate environments for... well for as long as I can see.

As a developer and innovator it frustrates me endlessly that we're catering to the worst engine on the market. It also frustrates me that companies like Firefox, Google, Opera and of course Microsoft can't innovate at the rate they want on their own engines without pissing off every developer under the sun because we all have to either pick an engine or only cater to the lowest common denominator or write heaps of extra code to make use of all the neat little extras provided by each individual browser. This is a horrible developer experience. Admittedly jQuery has made this far easier - All Hail jQuery, we love you!

Along comes standardization which has attempted to make developers lives easier, I love this, but at the same time, I hate it. Standardization means that everyone is running at the same pace developing the same experience, or trying to bias the standards to their own ends... and it's all running along at a snail's pace. How long has HTML5 and CSS3 been coming? How long will it take before it's not only commonplace but expected?

Right now we're campaigning to get rid of IE6 which we've already determined is so prohibitive, it's not likely to happen any time soon what with the fact that corporations have spent millions of dollars writing applications that target this environment and don't function properly in newer browsers. 10 years from now we'll be campaigning to get rid of IE9... or at the current rate, maybe we'll still be trying to get rid of IE6. Even if we do manage to get rid of IE6, it'll probably just be replaced with the next standard Microsoft browser... and we're going to forever more be plagued with the corporate environment holding back technology.

So how do we make everyone happy? What if we could allow browser developers to go back to running off at their own pace developing whatever rendering experience they wanted? What if developers didn't have to write cross-browser code? What if we could provide this without corporate I.T. departments having to rewrite millions of dollars worth of code?

This got me to thinking about how to solve the issue in the long term. Why are we held back? It's not specifically the IE6 application that's holding us back, but its crappy HTML rendering engine and corporate applications targeting it that are holding us back.

One potential idea I came up with is [and I'd like to stress that this is really just a seed of an idea just now that hasn't been fully worked through]: Why don't we separate the rendering engine from the browser application and load this dynamically at browse time through a plug-in, in a similar manner to loading jQuery or countless other frameworks from a CDN.

What if our web application were to define which rendering engine it relies on rather than having to cater to them all? - this could be defined through meta data, javascript, some other mechanism I haven't thought about, and the correct rendering engine could be pulled down as required?

This would mean that as new more advanced engines become available, they could be added to a CDN and new apps can come online targeting these engines without affecting applications that target older ones. This would allow creativity back into the web-development process from a rendering standpoint and allow browsers to run off at breakneck speeds again implementing whatever rendering ideas they wanted without affecting everyone else's applications. Developers could target the best engine for their web application without having to write cross-browser code to make it function everywhere else.

All we would need to standardize is the way the rendering engines plug into browsers. Users can use whatever browser makes them feel good about themselves; Developers can target whatever engine they want knowing it's going to be pulled down at runtime specifically for their application; Corporate I.T. doesn't need to replace all their home-grown applications that target IE6.

10 years from now, instead of everyone campaigning to get rid of antiquated IE9 because it's crap, developers could develop for the next engine safe in the knowledge that corporate apps targeting IE9 will still work just fine because they're not browser dependent and the engine is available on the server/CDN for download as it's needed.

  • Browser application developers could shift focus from rendering experience to providing the best application experience.
  • Rendering engine developers could focus on providing the best possible developer experience.
  • Corporate I.T. can keep all their current applications running without having to rewrite them.
  • Web application developers could pick the best rendering engine for their application and code only to that engine without the need for hundreds/thousands of lines of cross browser compatibility code.

Everyone wins.

Disclaimer: This is way outside my realm of expertise of CRUD development, and currently I don't really have the any idea how I'd go about developing this or even at this point if it's possible. That said, I will welcome any input that could help get this idea rolling.

All that said, let's suppose that someone were to do this, what would need to be overcome? So far from the comments I've picked up the following things that need investigated:

  • Would the EULA's of the current engines allow them to be used in a piece of third party software that would do this? This could be a showstopper...
  • Could existing engines be wrapped such that the browser can download the web page code, determine the engine based on some kind of meta-data and fire it into the correct engine? If so, what possible solutions are there for this?
  • Could the whole precompiled engine be downloaded dynamically and installed on demand without compromising security?
  • Could all this be done in a simple manner that would provide the user with a seamless (or as close to seamless as possible) experience?

Google frame has gone part way toward solving this problem with their Chrome frame for IE. What I'm proposing is taking this a step further and making it possible to plug all engines [frames] into a single shell.