Tag Archives: html 5

Testing the Canvas element in Internet Explorer 9

I’m impressed by the demos at the IE9 Testdrive site, which is full of fun and interest. Of course it’s good to try the demos in other recent browsers, though as you would expect on a Microsoft site, IE9 tends to work best. For example the great Beatz demo scored 8510 in IE 9 versus 1560 in Google Chrome 6 (developer build):

image

But are these demos slanted to favour IE9? I looked around for some independent demos, especially for the Canvas element. Here’s one on developer.mozilla.org, for example:

image

Hmm, it looks like some of these demos do not allow for the possibility of Internet Explorer supporting Canvas. What about this one?

image

Not too good either. I tried downloading it and hacking it to work in IE9. I disabled the script that conditionally displays the Chrome Frame offer and tried again. Another failure, because IE9 loaded the page in IE5 document mode. When I have a moment I’ll work out why. I forced IE9 mode (Debug menu) and at last was in business, sort-of:

image

Chrome is on the left, IE9 on the right. This is an animation with speech bubbles, and there is some problem with the text handling because the bubbles do not appear in IE9. Still, it did run. I noticed that IE9 ran slightly faster than Chrome, but with nothing like the big Testdrive difference: 209fps versus 164 fps, for example, but varying considerably as the animation proceeded.

I also tried with Mozilla Firefox 3.6, which is much slower than Chrome on this example, around 71 fps.

No conclusions yet, but watch this space. It would also be helpful if more of the folk doing Canvas demos would test with IE9 as well as Chrome, Firefox, Safari and Opera. The experience bears out what Microsoft is preaching: test for the feature, not the browser version.

Internet Explorer 9 Preview gets to 95% on Acid 3

Microsoft has released the fourth platform preview for Internet Explorer 9, which you can download here. This is the last preview before the beta release, expected in September.

When IE9 was first previewed, back in March, it scored only 55% on the Acid3 standards test – well ahead of IE8 which scores around 20%, but far short of rivals like Google Chrome and Apple Safari which achieve full marks. Mozilla Firefox is at 94%.

Acid 3

The new preview is at 95%. IE9 is now up there with them – but why not 100%?

According to UK Web Product Manager Mark Quirk, it is down to three features, two of which are related to SVG (Scalable Vector Graphics). Two points are lost because of SMIL (Synchronized Multimedia Integration Language) presentations, which Microsoft does not intend to support because a similar feature will be part of CSS in future. Two points are lost because of SVG fonts, which again Microsoft does not intend to support because it sees WOFF (Web Open Font Format) as the future standard here. One point is lost because of the inability to draw SVG fonts on a path, though there are other ways to draw fonts on a path.

The bottom line: IE9 will most likely stay at 95% right through to its final release.

Incidentally, IE9 JavaScript performance is wildly faster than IE8, thanks to the new “Chakra” engine. IE9 is on the left, Firefox 4 on the right :

image

So when will we get IE9? Although it is not long to September, there is a major difference between the preview and the coming beta, which is that the preview does not have a full user interface. It is mainly to show off the rendering and JavaScript engine. Therefore we can expect new features in the beta versus the preview. Despite that, Quirk says that Microsoft intends the beta to be “good quality for any user”, not just for brave developers and testers.

But how long before the final release? Microsoft is not saying, though when I suggested the first half of 2011 as a reasonable guess, Quirk reminded me that the beta will be high quality and that the release should therefore follow “not too long” after.

Since we will get much of HTML 5 in IE alongside the other popular browsers, do we still need Silverlight?

“As the number of the things you can implement with HTML clearly goes up, the need for Silverlight and Flash goes down,” said Quirk, though he added hastily, “The value that those players add needs to go higher.”

I’d add that even if IE9 is all that we hope, it will take years before older versions fall out of use. Recently the UK government said it will stick with IE6, and whatever you think of that decision, it shows how hard it is to get browsers upgraded everywhere. By contrast, plug-ins like Flash and Silverlight get updated rather fast. I noticed on Riastats today that over 50% of browsers now have the latest Silverlight, and 39% already have Flash 10.1 – over 90% have Flash 10 or higher.

image

If you combine that issue with things like video playback that are problematic even in HTML 5, it suggests that plug-ins will be with us for the foreseeable future, though it is quite possible that their use may decline.

Another factor is tool support, mature for Flash and Silverlight, but not for the newest features of HTML. After IE9 appears, will Microsoft come up with tools that properly support it, in Expression Web and Visual Studio? “We have to, it’s as simple as that,” says Quirk, though he adds, “we haven’t said when.”

Big browser and RIA news: Canvas comes to Internet Explorer 9

I’ve just installed the third Internet Explorer Platform Preview (on a virtual machine just in case) and run through a few of the demos. One of the most impressive is Canvas Pad, which demonstrates the HTML 5 Canvas element.

image

Canvas is particularly interesting, since it provides a surface to which you can draw anything you like. Canvas support was not announced at Mix earlier this year, when IE9 was unveiled, and some of us speculated that Microsoft would omit it in order to preserve the value of its Silverlight plugin – though in doing so it would also help Adobe Flash. Well, apparently the IE9 team decided to risk it. Not only is canvas supported; it is also hardware-accelerated:

Like all of the graphics in IE9, canvas is hardware accelerated through Windows and the GPU. Hardware accelerated canvas support in IE9 illustrates the power of native HTML5 in a browser.

Is there still value in Silverlight and Flash? There is, for several reasons. A plug-in presents a predictable runtime, insulating the application from browser variations. A plugin will work on browsers that do not yet support Canvas. Further, Silverlight includes the .NET Framework with its rich library, and supports the .NET languages, whereas for HTML5 you have to use JavaScript – though don’t forget Google Web Toolkit, which compiles Java to JavaScript, and other similar projects.

Even so, once you have hardware-accelerated Canvas there will be few occasions when you absolutely have to use Flash, Silverlight or Java.

Microsoft is doing the right thing. Crippling IE for the sake of Silverlight would only push users to other browsers, so it would not achieve its goal.

A full list of what is new in IE9 is here. It is shaping up to be the most interesting new IE since version 4.0 back in 1997.

Steve Jobs saying Flash is bad does not make it so

I’ve mulled over the statement by Apple CEO Steve Jobs on why he hates Flash. It’s been picked over by many, so there’s little point in analysing it line by line, spotting what’s true, what’s false, what’s twisted. It doesn’t matter. What counts is that Jobs is disallowing Flash and attacking Adobe – he’s decided it should get out of the runtime business and just do tools for HTML5:

Perhaps Adobe should focus more on creating great HTML5 tools for the future

Apple is a powerful enemy; and what I’ve found alarming watching the reaction is the extent to which Jobs saying “Flash is bad” has lowered the reputation of Flash; it’s as if all the great things which it has enabled – web video that works, pushing the boundaries of what is possible in a web browser, an entire industry of casual gaming – has been forgotten because one charismatic and influential individual has called it old stuff that crashes Macs.

The army of enthusiasts which leaps to the defence of all things Apple both amuses and disturbs me. I understand some of the reasons. People warm to Apple because the company has improved their lives, in computing, in music, in mobile phones – especially in contrast to the efforts of Microsoft and its partners who have all too often made computers and mobile devices that are hostile and unpleasant to use. This last factor is not Apple’s fault; and without Apple it might not now be changing. Apple deserves our thanks for that.

That doesn’t make Jobs or his followers right about Flash, which is a magical piece of technology. Yes, it’s been widely abused to make annoying ads and animations; yes, it crashes the browser sometimes; yes, both HTML5 and Microsoft Silverlight are encroaching on Flash territory.

Still, Flash is never going to be allowed on Apple’s new wave of personal computing devices, which by the looks of things it intends to form the core of its business. Nor can we write for Flash and compile for Apple; it’s not allowed.

This is the new model of computing: the web if you want open, or humbly seek permission from the device overlords if you want a local application install, at least on Apple’s platform; and Microsoft is headed in the same direction with Windows Mobile 7. It’s not a model I like; but the trend is unmistakeable.

Microsoft playing HTML 5 standards game alongside Silverlight game

I’m at Mix10 in Las Vegas where Microsoft has been showing off the latest preview of IE9 – you can try it here, provided you have Vista SP2, Windows 2008 or Windows 7.

The two themes are performance, with GPU-accelerated HTML and graphics and a new Javascript engine that compiles code in the background, and standards support. This latter was not a surprise to me, as I’d heard the well-informed Molly Holzschlag praise Microsoft’s commitment to HTML5 at a workshop here on Sunday – see this earlier post.

During the keynote, we saw IE9 playing a video using the HTML 5 video tag – no Flash or Silverlight needed. Microsoft also showed that in this instance IE9 performed better than Chrome thanks to better hardware acceleration. Although one should always mistrust one vendor’s demonstration of another vendor’s product, it should not be surprising that Microsoft is able to deliver a browser that is better optimised for Windows.

Video, hardware accelerated graphics, audio element support, fast JavaScript: there is considerable overlap with the features of the Microsoft Silverlight (and Adobe Flash) plug-ins.

The plug-in approach has advantages. It offers consistency across browsers, and enables rapid evolution without the hassles of standards committees. The multimedia features in Silverlight and Flash are well ahead of those in HTML 5 – Holzschlag nailed this when she described today’s HTML 5 demos as reminiscent of Flash demos a decade ago.

Still, if you can do without the plug-in you end up with cleaner code, removing the awkward transition between what is in HTML and JavaScript, and what is in the plug-in. There is also a better chance that your code will run on Apple’s iPhone and iPad, for example.

The question though: can Microsoft do an equally good job of supporting HTML 5 throughout its platform, as it will do with Silverlight? This is where I’m doubtful. The Visual Studio and Expression tools will continue to drive developers towards Silverlight rather than HTML 5.

It’s notable that shortly after Microsoft’s IE9 demos at Mix, we saw demos of fun technology like code-name Houston, develop databases in the cloud using just your browser and … Silverlight.

The two specifications of HTML 5.0: WHAT WG vs W3C

I’m just back from a workshop on HTML 5, led by web standards advocate and CSS expert Molly Holzschlag. It proved an illuminating session, though not quite in the way I had expected. Holzschlag, who works for Opera, was keen to convey the ideology behind HTML 5 rather than giving us a blow-by-blow tour of its features (though she did a little of that). She was also open about its problems, explaining that the spec is in flux and everything may change – “we make it up as we go along” – and talking about the politics as well as the technical aspects.

In her view, Microsoft is now fully on-board with IE, and committed to implementing the W3C HTML spec as it evolves. So too are Mozilla and Opera. She is less warm in this respect towards Apple, Google and Adobe, who she described as the “new Microsoft”, meaning I think that their business interests may be detrimental to their work on progressing the standard.

It is surprising to see Google mentioned in this context, since it is the company most obviously concerned to advance the browser’s capabilities, thus increasing the capabilities of its web-based platform. Ian Hickson, who is the editor of the HTML 5 specification, works for Google. Still, HTML 5 is a subject full of contradictions. One of its most curious aspects is that there are two HTML 5 specifications, one at WHAT WG, and one at the W3C, both edited by Hickson.

The history is that at one time the W3C, the official body in charge of the HTML specification, decided to replace HTML with a stricter XML-compliant language called XHTML. Real-world adoption was limited, and WHAT WG was set up by Google and browser vendors as a renegade group to work on a new version of HTML outside the W3C. When it became clear that XHTML was not achieving its goals, and that HTML 5.0 was meeting real needs, the W3C changed direction, stopped working on XHTML, and adopted the WHAT WG spec.

At this point you would have thought that WHAT WG might have closed itself down, job done. That is not the case though; it continues to work on its own version of the spec. I asked Holzschlag why this is, given that the existence of two HTML 5 specifications seems on the face of it to be destructive:

I think it’s very destructive. It’s very problematic. The WHAT working group is into innovation, and pushing the envelope, where they can’t do that in the W3C. The reason why the W3C’s stuff is important … is because it’s about open standards. The WHAT working group has no validation or validity or standing as an organisation other than its own self-involvement. The W3C is clearly the authority for most of these things.

Holzschlag emphasized that the W3C is a cross-industry body, with every browser maker and other interested parties such as Adobe represented.

Get us all round the table, and once we’ve spilt enough blood [laughs] we get on with the work and that actually goes through a very rigorous process, which a lot of people criticise and I feel it could be streamlined as well, but the bottom line is to ensure that it stays open, and it’s open standards, whereas the WHAT working group can decide any day that they want to close that door. At the W3C that can’t happen. That’s why if you’re really going to commit to anything in HTML 5, go with the W3C specs not with WHAT WG.

It’s a political issue in part, and in part it’s an ego issue. I think that Ian and his mates are great, very bright people but they are not totally mature yet … and I think that there’s a sense of self-importance going on, to be perfectly honest … I’m a little concerned about the monoculture that HTML 5 has created. So that exists and is a known factor. Everything I’ve said is nothing that hasn’t been said before publicly.

Strong words; yet overall Holzschlag conveys great enthusiasm for HTML 5 and its potential. She says that the mere fact of having all the leading browser vendors on board and talking to one another is of great significance.

But does HTML 5 exist? In some ways it does not; it is work in progress and not implemented consistently across browsers yet. That said, Holzschlag noted that the latest versions of the main browsers already implement significant parts of HTML 5; we will no doubt see more of it in Internet Explorer 9, for example. Even though Hickson said HTML 5 might not be done until 2022, it will be usable long before that.

What’s on at Mix 2010 – some surprises as Microsoft talks standards

Microsoft’s Mix conference is on next month – probably the company’s second most interesting conference after PDC, though this Mix looks rather better than last year’s relatively drab PDC (free laptops aside). The company has plenty to talk about, primarily around Windows Phone development – twelve sessions! – Internet Explorer 9, and Silverlight 4. Mix is meant to be a web design conference – though it has always strayed extensively into Windows-only territory – and the inclusion of Windows Phone is a bit of a stretch, but I doubt attendees will care.

It’s notable that Microsoft is making more than a nod to web standards and open source. There is a full day workshop from Molly Holzschlag on HTML5 Now: The Future of Web Markup Today, John Resig on How jQuery Makes Hard Things Simple, and Doug Schepers from the W3C with Microsoft’s Patrick Dengler on SVG: The Past, Present and Future of Vector Graphics for the Web; Christian Heilmann on Participating in the Web of Data with Open Standards; and not forgetting Miguel de Icaza on The Mono Project.

Why would Microsoft talk about such things? Arguably it is a kind of smokescreen, talking standards while busily promoting proprietary stuff like SharePoint and Silverlight. I think there is some of that; but that this new focus also reflects power shifts in the industry. In the new cloud-based era Microsoft has to compete with Google, Mozilla and others; and to make sure that its stuff works in some measure on a diversity of clients, from Android to iPhone. Note the session on Practical Strategies for Debugging Cross-Browser Display Issues.

I would not call this a conversion. I would say this is more about “Windows if we can, standards if we must”. That necessity is increasing though, and the sessions at Mix reflect that.