All posts tagged ‘Web Standards’

File Under: Browsers, HTML5, Web Standards

Apple’s HTML5 Showcase Less About Web Standards, More About Apple

Apple posted a showcase of “HTML5 and web standards” on its website Thursday that highlights the level of support for the emerging standard in the company’s Safari and Mobile Safari browsers.

It’s nice to see Apple (or anyone for that matter) talking about HTML5 and mentioning more than just video. The site showcases HTML5 audio and canvas elements, as well as CSS 3 transitions and typography tools. It also has a nice photo gallery that looks and behaves just like former Apple designer Mike Matas’ amazing photo-gallery site.

Unfortunately, the way Apple presents the showcase, you would think Safari is the only web browser that supports these new web standards.

In fact, visit the site with any other browser and you’ll get a message telling you to download Safari. Surely your browser must be inadequate? Actually, your browser is probably capable of handling the showcase just fine, but ultimately the showcase isn’t about web standards: It’s about Apple’s version of web standards.

Apple is detecting the user-agent string (the bit of identifying data your browser passes to a web server when it requests a page) and only allowing Safari users to see the galleries. Other browsers are effectively cut off, regardless of the fact that many can render them just fine.

Worse, Apple’s CSS code uses only WebKit-specific selectors — for example, -webkit-border-radius instead of the actual CSS 3 selector border-radius. WebKit is the open source engine that powers Safari and Google Chrome. Firefox, IE and Opera can’t understand this code as clearly.

So much for web standards. Not only is user-agent sniffing absolutely the wrong way to determine the HTML5 capabilities of the current user, the implicit suggestion is that HTML5 is something only Apple supports.

Microsoft recently published its own HTML5 showcase to hype the coming release of Internet Explorer 9, and its demo pages are viewable (and work) in any non-IE browser with the proper support. Mozilla’s HTML5 demo pages are geared to work with experimental builds of Firefox, but at least other browsers aren’t blocked, and most of the demos actually work in Chrome.

To test Apple’s demos in other browsers, we spoofed the user agent in Firefox and Chromium and found that, while several examples do indeed fail in Firefox, most worked just fine. Naturally, everything works without issue in Chromium, because it uses the same WebKit rendering engine as Safari. Apple is being disingenuous by making its browser seem more compelling than others. That’s not surprising, but we’d be disappointed to see independent developers follow suit. [Update: As several commenters, and John Gruber point out, the version WebKit that Chromium uses doesn’t yet support all of CSS 3′s 3D transforms, which renders this demo incomplete, though still functional, in Chrome/Chromium.]

So how should you detect whether the current browser can display whatever bit of HTML5 or CSS 3 you’re using? The long-established best practice is to detect for features, not browsers. To find out which features are available in the current browser isn’t hard — there are even several free, open source libraries out there that do just that.

Modernizr is one of our favorites. This handy little JavaScript library can detect which HTML5 features are available. Then, armed with that information, you can then create conditional JavaScript statements to offer HTML5 to those browsers that support it, but still fall back on other content for those that don’t.

There are however, some cases where Modernizr might be overkill. For example, if you just want to embed some HTML5 video, you only need to detect one element. If Modernizr isn’t right for your project, check out Mark Pilgrim’s list of ways to detect HTML5 elements. The list of elements and how to detect them is an appendix to Pilgrim’s book in progress, Dive Into HTML5.

The list isn’t just elements, though it does cover those as well. But it also shows you how to detect API support for things like offline storage or geolocation, as well as SVG, SVG-in-HTML and even which video codec the current browser supports.

One thing Pilgrim doesn’t cover is CSS 3 features (CSS 3 != HTML5). To detect which CSS 3 features are available in the current browser you can use Modernizer or you can roll your own code using a library like jQuery, which includes a support() method to check a wide range of browser features before executing code.

See Also:

File Under: Glossary

CSS

CSS, or cascading stylesheets, allow you to define how web page elements are displayed.

Specific margins or colors can be associated with elements on the web page; Headers and links, for example. When style sheets are applied to a new page, the elements are changed according to the specifications of the style.

File Under: Glossary

Document Object Model

The document object model (DOM) is the specification for how objects on a web page are represented.

A DOM defines each object on a web page (images, text, scripts, links, etc.) and also defines what attributes are associated with these objects and how they can be manipulated.

File Under: Glossary

ISO Entities

ISO (International Standards Organization) entities, sometimes referred to as character entities, are a group of ASCII characters that can be used in HTML to display special characters. For example, you can’t simply type the registered trademark symbol ® from your keyboard since it’s not a standard ASCII character; it’ll show up as garbage on your web page. But if you use the ISO entity equivalent, the web browser will be able to interpret the character correctly.

For example, the umlaut ¨ appears if you write
¨
in your HTML code.

File Under: HTML, HTML5, Web Standards

What Comes After HTML5? Just HTML

The future of the web is fast approaching. HTML5, the successor to today’s HTML 4, the lingua franca of the web, has reached the Last Call stage and is beginning to look like a finished spec. While it will be some time before HTML5 can be called complete, forward-thinking browsers already support much of the spec.

HTML5 represents the biggest leap forward in web standards in almost a decade, but what comes after HTML5? HTML6?

As it happens, no. The WHAT Working Group, which, along with the World Wide Web Consortium (W3C), is helping to create HTML5 and beyond, has already decided to move to a non-versioned development model after the release of HTML5. That means, in the future, there will simply be HTML.

What will this HTML look like you ask? Well, Mark Pilgrim, who works on the WHAT Working Group, has started a new series of posts on the group’s blog entitled What’s Next in HTML?

The answer, at least for now, is a possible new tag: <device>.

As you would expect <device> will offer web developers a way to access devices, for example your PC’s webcam or perhaps your mobile device’s accelerometer.

The obvious application for the device tag is video chat — something currently only possible using proprietary tools like Adobe Flash. As Pilgrim points out in his post, if you combine the existing video tag and web socket tools of HTML5 with the new device tag, all the elements necessary for an online video chat application are in place.

Before web developers get too excited it’s important to realize that <device> is a long, long way from being a real HTML element. As Pilgrim notes: “the entire device API is still in its infancy… nobody has even started implementing a prototype of that piece yet, and the whole idea might be scrapped.”

That shouldn’t be too surprising for those of you following the bleeding edge of the web, after all we’ve already been teased with the promise of a single video codec only to see that vanish.

But with any luck, the device tag won’t suffer a similar fate and one day web developers will be able to take advantage of yet another set of tools that were once the sole province of desktop software.

See Also: