Categories
HTML5 Specs

HTML5 implementation experience

I disappointed folks with a recent email to the W3C HTML5 co-chairs, offering to withdraw my change proposals. The co-chairs nixed the idea, which is OK, but also have not provided a decision on these items yet. The unfortunate consequence of the new Decision Process is that the co-chairs have become the group bottleneck.

I do genuinely believe that after recent discussions related to figure and aside that the existence, or not, of details, aside, figure, progress, meter, and the hidden attribute (not to mention a dozen or so other elements), should be decided after people have a chance to play with a couple of implementations. I am relatively confident we’ll find that the implementation of the elements will drive home the points I attempted to make in my change proposals. It is easy to say, “Oh, we want these because they’re useful and accessible”. It’s another thing to actually make them useful, and accessible.

That is the problem with the current HTML5 specification. Some of the items are implemented, such as Canvas, audio, and video. In fact, the browser companies have tripped over their own feet in a rush to implement audio and video.

Other, shall we say, “less sexy”, elements have not been implemented, including most of the form input element types that actually formed the basis for the beginning work on HTML5, six years ago. Opera has done some implementation of form input types, and Webkit now supports progress and meter, but Firefox hasn’t started on these items, and neither has IE.

However, it is these “less sexy” elements that need implementation experience more than the cool items, because it is these that are more vaguely defined and introduce concepts into HTML that have the potential for negative repercussions.

Take figure, a seemingly innocent element. It started life as nothing more than a way to add a image caption, and now it compromises anything with a caption. Yes, this is semantically incorrect, if we’re following print semantics, but the HTML5 world marches to its own semantic drum.

Now the question becomes, in what way do we associate the caption to specific elements within the figure? For one, does it replace the alt text in the img elements? If we have a table in the figure element, which is allowed, can we use a caption for it, and the figure caption, too?

Supposedly figure can be located separately in the page or in a separate page, and is somehow associated with the content. How? Do we link the two? Do we have to use some form of magic pixel dust? There’s a gap in understanding between just writing in a spec that the figure is associated with its context but may not be physically located with the context, and the actual implementation. This has not arisen in the past, because previous elements are defined within the context of their containing elements, not some vague assurance of association by proxy somewhere in the web.

Figures in books and other printed material are linked by reference. We use in the text, “See Figure 1-a”, and the reader knows to look further in the book for Figure 1-a, or to check out the image in a special figures section. We have implementation experience, so to speak, with “figure” in the print world. We don’t in the web world. We’ve never really needed it, because we have a thing called a hypertext link that works marvelously well when it comes to associating one piece of content with another.

As for the “semantics” of figure—when anything is allowed in the figure element, there is very little meaning to the element, other than it being “something with a caption”. Actual implementation experience drives home this point, because if figure is anything with a caption, what use is it for something such as a search engine? If we returned to the original concept of figure, though, where it was a way to associate a caption with one image, many of the problems associated with the implementation of figure fall away. We can easily see Google pulling the image and associating the correct text with it in its images search page.

But then someone, somewhere, will dig through web pages until they find one example where someone associated the use of “Figure” with code or a table, or even a poem, and they’ll bring this up as a use case, with tut tuts of how can we prevent people from being free to use figure however they want—totally disregarding the whole meaningful part of semantics—and figure gets redefined and broadened, again and again, until we have something with a caption.

Maybe this is OK with the world. But we’re not going to know, until we actually try to implement it.

The same with the details element. Even now, there’s a bug on what component of this element gets focus—the element itself, or the summary label. There’s nothing in the spec that makes the element keyboard accessible, though. There’s little in the spec that talks about whether the user agents allow readers to control what are known as declarative animations: animations, such as the exposure or or not of the display contents based on a some action, that come about via the HTML markup rather than JavaScript. Readers can turn off JavaScript, they can turn off Flash, but there is no way to turn off declarative animations, and not every reader would probably understand exactly what a declarative animation is, anyway.

There are components of declarative animations in use today. Dropdown selection lists are another example of declarative animations, and we certainly don’t want to remove this. Then, we might be asked, if we want to keep declarative animations for some web components, why not add this type of behavior for others?

The reason why is that in the last ten years, we have had details-like collapsible page and menu sections, controlled with CSS and JavaScript. We’re used to these, and we’re used to them being controlled by JavaScript and CSS. We know that when JS is turned off, these items should be expanded by default. We make use of this for our print pages, which disable JavaScript, leaving the items expanded, and therefore printed.

This isn’t going to work with details, though it may seemingly look exactly like the JavaScript controlled elements. The details element works against expectations.

Again, maybe the benefit of the element will outweigh the disadvantages, but we’re not going to really know for sure, until we actually see a couple of implementations. We can’t compare what this element provides against the state of the art today while the element is still nothing more than an abstract.

Webkit has implemented progress and meter, and I talked about progress recently. The elements can’t, for the most part, be styled: what you see is what you get. In addition, the new meter element actually uses color to denote the element’s current value as compared to its optimum value. Doesn’t look like a gauge, which is what a meter is supposed to be—not like we’re used to with JavaScript libraries. And we don’t know what other implementations will look like with other browser companies. Or across different operating systems.

Even something as simple as an aside element can be complicated to implement. Consider that most of these elements have to be mapped to existing accessibility APIs, how does one map aside to, say, ARIA roles? Originally, it could have mapped to the ARIA note role, which is used with content in a main document that can skipped and returned to later. However, because people grasped the reference to “sidebar” when this term was used to define the element (but based on print sidebar, not web sidebar), we can now use aside for web sidebars, too. However, the ARIA “note” role is no longer applicable. In ARIA, sidebar content would be marked with a complementary role. In order to make aside accessible when it’s used as a sidebar, we have to override the semantics by assigning it an ARIA role of “complementary”. Or if it gets mapped to ARIA role of “complementary” by default, then we have to override the semantics of the item, setting it to “note” if used as a content note. Which then begs the question, What the heck use is the item when we can just use the ARIA roles now, and not have to worry about which to use when?

In other words, rather than provide cleaner semantics, aside actually makes things worse. But it’s only when you start implementing the thing that details such as this start to appear, making the element a whole lot less attractive.

The problem, though, when you wait to challenge an element or attribute until after it’s had a couple of implementations is that people assume the thing is real, and going forward. People become extremely reluctant to let something go after they’ve spent time on it. It’s a catch 22 situation, made worse because of the hype about HTML5, and the contentiousness in the HTML5 working groups.

By filing the change proposals to remove these items before implementation, I know people haven’t started using the elements in their web pages. However, the downside to filing before implementation is we’re talking about removing abstract elements, and the costs of the elements aren’t necessarily going to be apparent until we actually try to work out the physical implementations.

Once the items are implemented and in the HTML5 spec, if we decide later we made a mistake with them, it will take years, perhaps decades to remove them. Look how long it took just to eliminate blink? And I imagine at one time, even the blink element made an attractive sounding abstract element.

All of which brings me back to the offer I made yesterday: pull the change proposals now, with the understanding that we could re-visit these elements again when we’ve had implementation experience, and with the understanding that these elements could still be removed if the implementations demonstrate problems. By writing this email, though, I disappointed some folks.

I do apologize for suddenly springing this offer on folks, but I’m not going to apologize for the action. If the co-chairs do agree with any of my proposals, those who proposed keeping the items will not be happy and will, most likely object, at length and loudly. Why wouldn’t they? Right now, these elements are marvelous inventions of semantic goodness, and accessible to boot.

If the co-chairs don’t agree with my proposals, which frankly, I feel is the most likely outcome, then after we have some implementation experience with the elements, we could supposedly bring up the idea of removing some or all of elements if we run into significant problems with their implementations. If, that is, we can convince the co-chairs that “new information” has occurred to justify bringing up the issues again.

But by that time, the co-chairs will have “confirmed by decree” that we ware keeping the elements, people are assuming that these elements will be in the final release of HTML5, time will have been invested in the elements, and it would be the devil’s own work just to get people to consider the possibility that maybe, the elements are less than useful.

I do not claim to know if I’m right about these elements, or those who disagree with me are wrong. I believe I’m right, I’ve tried to demonstrate why I believe I’m right, but I know that doesn’t make me right. And I don’t know if filing the change proposals now was a mistake, the offer yesterday was a mistake, or a combination of both was a mistake—or not.

Regardless, what’s done is done.