How To Get Around the Holes In IE9 Beta's Implementation of Canvas
mudimba writes "Microsoft has made grand announcements about how great their implementation of the HTML5 canvas specification is. However, while I was porting a large HTML5 application to work with IE9 beta I found that there are some key features missing. Workarounds are provided where possible. (Disclaimer: I am the author of the submitted article.)"
Doesn't everyone on slashdot use a *nix system?
Its 2011 and (big surprise) there are still problems with IE's implementation of HTML. This has been going on since IE3 (and probably before). I think we can safely say at this point that the problem is the company and will probably never change. As they say, the day Microsoft makes a product that doesn't suck is the day they make a vacuum cleaner.
So, a browser in beta phase does not conform to a specification in draft stage!
Who would have thought!
Just the other day someone asked if I'd done any work with HTML5 and I said I was going to wait for a good while until it worked everywhere. They assured me it did, now I find the opposite.
:)
Glad I didn't bother starting now - procrastination has saved me yet again
while (true != false) process_more_stupid_code();
1. He's using IE9 Beta 1, which is fairly old and out of date. He should try the latest platform preview.
2. He should post functional test cases, like ACID does, instead of posting just the code and pictures.
3. He should contact MS. Instead he is relying on the nerd-rage from Slashdot to get big enough for them to notice. They have an appropriate channel for this where the issue can be discussed.
4. Despite what people think, canvas is not HTML. It's a proprietary and patented Apple technology that has been submitted to W3C for review as a potential addition to HTML. Yes, submission to W3C does require patent disclosure and royalty-free licensing when a submission becomes a part of a recommendation, but canvas has not reached that stage. Patent fears aside, as an early draft it is a standard subject to change either by W3C or by anyone who feels like interpreting the draft as they see fit, which could occur concurrently as in opposition to each other.
The web is still suffering from all the workarounds implemented for IE6 ... don't do workarounds, make M$ FIX the problems instead!
You can (and should) submit bug reports for IE9 directly to Microsoft. Complaining on your personal blog and hoping that the magic internet fairies will take care of it is less effective at getting the problem fixed.
I just got forced to adopt IE8 compatibility (outside constraints). After developing something that runs just fine in Safari/Firefox/Chrome for 4 weeks, it took me:
The downside
- 4 hours to get it to run in IE8
- Data intensive JS processing/DOM manipulation is about 10x slower then in either of the alternatives
- Since no support for CSS3 border-image is present, it makes it look ugly
- Since DOM/JS is so slow, animations (width, height, opacity etc.) are slow as hell.
- the HTML5 popstate event (document.location change) is not supported, hence a watchdog interval has to be installed checking the document.location.hash 20x/second
- since IE is the only browser to enforce XHR caching, every request needs a timestamp query parameter (something that no other browser does, and which is really stupid, altough easy to provide)
- the developer tools are difficult to use (as compared to chrome, webkit, firebug etc.)
The Upside
- console.log works (thank god, no more alert debugging)
- The layout just worked (though I think that's rather a side effect of using pixel width/height zealously rather then an IE8 virtue)
- developer tools, any, even if they work badly, but developer tools!
Recommendation for anyone: IE is still the worst browser, and there's at least 4 alternatives which are collectively 1) faster 2) easier to develop for 3) more compatible to each other 4) prettier 5) more standards conformant
Experiments and other stuff
Unfortunately for me one of the sites that I maintain gets the majority of its views from UK Government workers, most of which use IE. Roughly 2/3 of the visitors to this site are using IE of one form or another. (Admittedly IE9 is only a tiny proportion of these and a lot of them are using IE6 still so I'm unlikely to be using canvas any time soon)
Sure, I could block them completely and it might make a few of them take notice but the majority would just see it as us not wanting to make our site available to the people who need it.
It's a vicious circle and one that I would love to help break (I posted a comment on here a while back which included some code that does what you mention) but in the meantime we still need to get clients and they're still using IE6. We're not going to turn away business because of some browser idealism.
Brain surgery - it's not rocket science!
Well, from your description, apparently the solution you currently use is flash, correct?!
So I guess it would be better to maintain Flash in IE9 rather than 'neuter' Canvas code.
how long until
Why should you waste time and money supporting them?
Because the amount of money you make from supporting them is greater than the amount spent to do so?
If you're running a personal site for your own amusement, then sure, do whatever you think is fun; but when you're trying to make a living (in any industry), rudely telling half your customers to go away is rarely a wise decision
I mod down anyone who says "I will be modded down for this", regardless of the rest of their comment
Well at the moment I don't use anything that needs that kind of functionality. I do use some jQuery to give it a bit of interactivity but it is essentially a static page.
As for maintaining a Flash version in IE9, I doubt it is easier duplicate chunks of your code in a different language (plus the cost of buying the Flash authoring tool) than it is to alter a couple of lines in your Javascript. But then again, you said "better" which is a subjective term.
My favourite way would be every time that an IE-specific line of code is called, an email gets sent to the IE team at Microsoft...That would get their attention.
Brain surgery - it's not rocket science!
Maybe Microsoft IE team doesn't have the money or resources to develop their browser? After all, they don't get the google income of Firefox and they have to pay those horrible h264 fees. They must be borderlining on broke or something. The old guys were disbanded years ago to work on bigger projects and only college hang overs who beg for money from their parents get to touch the code nowadays. [end sarcasm]
I honestly would expect more from an ex-market leader in web browser development. Pure laziness on Microsoft's part.
Once you start despising the jerks, you become one.
It is probably the only way that IE will support modern features. Ever. I am serious. Google needs to start pushing this more. Maybe the embarassment will force MS to finish their HTML5 implimentation.
Once you start despising the jerks, you become one.
I doubt it is easier duplicate chunks of your code in a different language (plus the cost of buying the Flash authoring tool) than it is to alter a couple of lines in your Javascript. But then again, you said "better" which is a subjective term.
My favourite way would be every time that an IE-specific line of code is called, an email gets sent to the IE team at Microsoft...That would get their attention.
True, yeah, maybe it would be easier to do all the 'bells and whistles' on Flash, so you wouldn't have the duplication problem. (Even though flash costs money)
About the email idea, I LOVE IT.
how long until
Stop coddling this company. Don't try to get around it. Code to the standards and let IE9 fail to render if they can't implement the spec properly. Google, Apple, Mozilla, and Opera all have no problem following the spec.
Cory Doctorow talking about cloud computing makes as much sense as George W Bush talking about electrical engineering.
I defended it since it's in beta, and I prefer a combination of Firefox and Chrome. I only use IE when forced to.
So why would it take an apologist to point out the patently obvious?
Saying Android is a family of phones is akin to saying Linux is a family of PCs.
Not surprisingly, IE9 Beta is a work in progress.
The sad fact is that there is no answer that doesn't make somebody's life slightly worse either by taking developers time or money or denying the client access to the site.
Actually, I've got a better idea than the email but I'm not sure how to implement it: Every time an IE-specific line of code is called a small withdrawal from Microsoft's bank account...
Brain surgery - it's not rocket science!
Hi there, thank you for the post. I just wanted to add a few observations on behalf of the Internet Explorer team.
Firstly, no browser offers a perfect implementation of the Canvas 2D API specification to date - we've documented and shared a few examples from our test suites here: http://samples.msdn.microsoft.com/ietestcenter/#html5Canvas
As has been well noted, the IE9 build tested was our beta.
Secondly, in response to the specific issues raised, Giorgio Sardo has posted a response on his blog here:
http://blogs.msdn.com/b/giorgio/archive/2011/01/14/building-great-browsers-together.aspx
We'll update this entry over time.
Thanks for listening,
Tim Sneath | Microsoft Corp.
I wonder what would have happened if MS adopted the Tasman engine used in Mac IE 5 and ported it to Windows instead of spending years fixing the Trident engine?
Time to go all grammar (well, vocabulary) nazi on you....
The word you want is Disclosure, not Disclaimer.
A disclosure is, in this case, a statement of conflict of interest: "I wrote this thing, so I might be biased about how good it is."
A disclaimer would be: "I wrote this thing and even I don't believe it!"
I'm pretty sure you meant the former, not the latter,
Crumb's Corollary: Never bring a knife to a bun fight.
Are you bloody serious?
First of all, IE9 Beta already supports the majority of Canvas. This guy found a few things that didn't work right in the build he was using (far from the newest one, FYI).
Second, IE9 has been receiving improvements to its compatibility in many areas, including Canvas, during Beta. At least one of the bugs found was known, reported, and fixed a while ago.
Third, it *is* still in development (beta, not RC). We (the public) are about due for another preview build drop; the currently available one is 2 months old.
Fourth, If MS were to avoid supporting the portions of HTML5 not yet standardized, they wouldn't have anything at all! The whole spec is still in Draft... seriously, read the official spec page linked in the summary.
Fifth, while there will undoubtedly be shit flung by developer X whose favorite corner case Y doesn't work right yet, most Canvas sites *just work* in IE9 already.
Sixth, MS is already well past the expectations of most web developers. ACID5 (except for the parts that are now redundent and being deprecated), HTML5, CSS3, and very fast JS. All software has bugs, but MS has already largely delivered on its promise to support the same code as other browsers, and it's still in beta!
There's no place I could be, since I've found Serenity...
Hum - you do realize that already at this stage, IE is the browser with the most complete implementation of HTML5 and CSS3 right?
MS has actually contributed *most* of the compliance tests (the official ones, not ACIDs) and have disclosed where IE doesn't *yet* pass the tests. You can run those test yourself and see if your favorite browser passes *all* of them (or even more than IE): http://samples.msdn.microsoft.com/ietestcenter/#html5Canvas
I'm posting this using Chrome and that chart seems to be about right, i.e. only a few of the failed tests have been corrected even though this is Chrome 8.0.552.215 and the chart is from the Chrome 7 days.
globalCompositeOperation "destination-over" is shown as "fail" for IE. If you look at the chart - and do not cherry pick like the original poster did - you will soon realize that IE is indeed the browser which is *most* compliant with the *draft* spec.
What we have here is a biased author who cannot even hide his bias, cherry picking a few areas where IE fails and trying to blow them up as all-important and outright reason to reject IE and MSs efforts. And then he goes posting it on slashdot in order to instigate a good MS bash fest. Real class.
Reading slashdot one-liner: (irm http://rss.slashdot.org/Slashdot/slashdot).rdf.item | fl title,desc*
If the site is broken and a list of downloadable alternative browsers appears, the user may not have privileges to install the program or to run the portable version. Only an administrator can install software to Program Files, and the so-called portable version can be blocked using Windows software restriction policies.