

IE9 beta's HTML5 support isn't there yet: 3 big canvas gotchas - kemayo
http://dt.deviantart.com/blog/37599369/

======
pavlov
The lack of globalCompositeOperation in IE9's Canvas implementation is a
pretty serious limitation.

It seems to come down to the limitations of Direct2D, which doesn't seem to
support any other compositing operations except source-over, a.k.a. "normal
alpha blending". This is fairly surprising when taking into account that
Direct2D is a very new graphics API (it shipped in Windows 7)...

I think the root cause is that Microsoft's graphics APIs have long evolved in
a different direction compared to everyone else. Make no mistake, Microsoft is
a very important force in graphics because they control Direct3D, and that has
placed them at the vanguard of high-performance accelerated 3D graphics.

Direct2D seems to mostly take design influence from Direct3D. One of its
explicit goals is to provide 2D utility graphics for Direct3D games -- stuff
like HUD displays for games. The traditional "Porter-Duff" compositing
operators (i.e. the blending modes missing from Direct2D) are not very useful
in this environment, so instead Direct2D concentrates on "game-like" stuff
like high-level geometry objects.

In contrast, the other major browsers use graphics APIs that fundamentally
derive from the Adobe school of print-oriented graphics, where an image is
built from low-level immediate mode operators. Think PostScript and PDF.

The original Canvas JavaScript implementation shipped in Mac OS X 10.4 to
support Dashboard widgets. Canvas was just a paper-thin wrapper over Apple's
Quartz API, which in turn was essentially a royalty-free implementation of the
PDF graphics model (before Quartz, Apple/NeXT were licensing Display
PostScript from Adobe).

I think Mozilla's Canvas implementation uses Cairo, which is an open-source
library heavily modelled after PDF and Quartz. Chrome uses their home-grown
Skia, which is also very similar.

Poor Microsoft. If they had taken the opportunity in 2004, they could have
easily dictated a simple web graphics standard that would have played to the
strengths of the accelerated graphics API that they control. But instead they
were busy building giant fortresses of proprietary APIs like the dead-end
Windows Presentation Foundation, and now they're having trouble implementing
something as superficially simple as Canvas.

~~~
stwe
Many globalCompositeOperation modes are also broken in WebKit based browsers:
<https://bugs.webkit.org/show_bug.cgi?id=39177> But sadly nobody seems to care
too much about that.

~~~
pavlov
IMHO, most of the Porter-Duff compositing operations are fairly useless. There
is a nice mathematical purity to the model from which these operations are
derived, but that's also their weakness: they are based on an ultra-simplistic
abstraction instead of real world use cases. Punching out alpha mattes in
various ways just isn't very interesting in practice.

Porter and Duff can be forgiven because the "real world" didn't exist when
they designed this model in the early '80s. At the time, a frame buffer add-on
to a computer could cost as much as a car...!

When designing a modern graphics API, I think it would be more useful to look
at the operations that people are actually familiar with, e.g. Photoshop
blending modes, and design the interface to match those expectations.

------
treeface
In all fairness to Microsoft, the last IE9 beta was released on 2010-09-15:

[http://ie.microsoft.com/testdrive/info/downloads/Default.htm...](http://ie.microsoft.com/testdrive/info/downloads/Default.html)

I wonder if he has the same issues with the latest platform preview (which
came out nearly two months ago).

Now, all this fairness aside, I'm extremely curious why MS isn't adopting the
rapid release cycles that the Chrome team have used. As a (potential) consumer
of the Internet Explorer line of products, I feel like I'm left out in the
cold when I see that the last release was sometime last September. In the
meantime, Chrome has added a major enhancement to their JavaScript engine,
WebGL support, and more. More importantly, they've added this stuff
incrementally so I, the (current) user of Chrome don't have to wait for months
for the next major release.

Or perhaps more to the point, I'm curious why the IE9 marketing team don't see
the promotional advantages of rapid releases as compared to the old major
release model. As the Chrome team have said...market features, not releases.

~~~
kenjackson
I get that Chrome is fast, but do you hear what you're saying. They did a tech
preview in October and it's only been three months, which includes
Thanksgiving, Christmas, and New Years.

There's rumors that the RC is coming on the 28th. And RTW is probably a few
months after that. Not Google like speed, which is ridiculously impressive,
but a beta and 7 tech previews in this time isn't bad.

~~~
cryptoz
IE8 came out in March of 2008. By the time IE9 is out, it'll be close to _3
years_ between major browser releases from Microsoft. That is too slow. The
Internet is moving much faster than Microsoft understands. (Or perhaps if they
understand it, the Web is moving much faster than they can _handle_.)

Chrome went from a state of non-existing to very popular in the same time.
Microsoft's web browser development speed is abysmal for such a powerful and
large software company. They either don't care, or they want it to be slow and
have poor performance. I can think of no other reason for such slow
development of their web browser, especially in an era where _everyone_ knows
how important the web is.

~~~
kenjackson
Actually it came out in March 200 _9_. So it's two years between major browser
releases. In that 22 months they've dropped 7 tech previews and beta. So at
about a clip of every 3 months they've released a new build.

But I do agree that it's too slow. They really do need a Chrome like schedule.

~~~
cryptoz
Thanks for the release date correction. I even did my research and checked
Wikipedia first! Turns out I read the wrong date. Oh well, thanks. :)

------
pilif
So it just continues on. You implement something and it's going to work in all
browsers but will require specific tweaks and workarounds for IE.

Business as usual.

The only thing that changed is the nature of the needed workarounds (fix
broken canvas instead of fix missing canvas), so that IE9 just brings more
frustrating work to the table. One more special case to handle.

In the application I'm maintaining, we have CSS and JS to make the thing work
in real browsers and then one file for each version of IE to handle their
specific bugs.

As it's looking now, IE9 won't improve on the situation, but just require two
more files (CSS, JS) to fix the new, IE9 specific issues, thereby increasing
the development time of any new feature because one more special case must be
handled.

Why can't Microsoft just get their act together. This is so dammed frustrating

------
Groxx
There are lots of problems with the global composite operations in browsers.

Try your browser:
<https://developer.mozilla.org/en/Canvas_tutorial/Compositing> WebKit still
doesn't have all the -in or -atop working, despite bug reports going back very
nearly a year now: <https://bugs.webkit.org/show_bug.cgi?id=34027>

------
v413
It is interesting to see the HTML 5 compatibility charts (including for
canvas) according to w3.org here:

<http://test.w3.org/html/tests/reporting/report.htm>

According to this no browser is currently following 100% the canvas spec.

~~~
mudimba
While that is true, I think the chart is misleading in that it doesn't
properly weight the tests. Failing to have any sort of
globalCompositeOperation is a huge thing, but IE only lost one point for it. I
would say that some of the things that the other browsers got dinged for are
much smaller in comparison.

~~~
smackfu
You could argue about the weightings all day though. Will people actually use
every single one of those composite operations in real life? Shouldn't the
important ones be weighed more? etc.

------
thwarted
_In my defense, Chrome, Firefox, Opera, and Safari did an amazing job of
coding to the HTML5 spec. I don’t know why Microsoft couldn’t as well._

I feel like this has been, and is, said about a lot of things that Microsoft
should be kicking ass on. Why is Microsoft either unwilling or unable to lead
the charge on these kinds of things? Can they say that it's not in their best
marketing interest to have a crappy, slowly developed product?

------
gruseom
Anybody care to comment on how good the SVG implementation in IE9 is? I've
found, somewhat counterintuitively, that you can get better rendering
performance from SVG than Canvas if your application is a good fit for certain
techniques, and I'm hoping that we can use them in IE9 too.

~~~
mudimba
"If your application is a good fit" is the operative phrase here. SVG does
some things very well, but lags in other ways. They really are different tools
made for different purposes (though they do have a little bit of overlap). It
is like Illustrator and Photoshop, which both can make pictures, but a good
designer will use both depending on the circumstances.

