Categories
HTML5 Specs W3C

On being an HTML5 deletionist

When last I posted, I was confident I would be finished with my change proposals for the HTML5 by now. Little did I suspect at how strong a reaction my proposals would have, or how emotional the discussions would become. Some of the responses were humorous, such as when I was called a “deletionist”, of all things. Most of the responses, though, were not pleasant.

Ian Hickson, the HTML5 editor, framed his replies rejecting my changes in terms of accessibility and that’s how I responded. As was noted by the wise woman in the group, Laura Carlson, the use of accessibility in this regard was likely a red herring. However, when you write a change proposal, all you can do is respond to the presented arguments. Now, there have been additional arguments, and I’m adjusting my response accordingly.

I was disappointed in how my change proposals were treated. I didn’t expect the HTML5 WG co-chairs to encourage people to respond with one counter-proposal for several of my change proposals. Though each of the impacted proposals was about removing an element from the HTML5 spec, each element is unique. Or at least, I though they were unique. The response leads me to wonder: if people respond with a blanket statement about all elements, how unique are they, really? And how useful?

The Accessibility TF responded in support of keeping the elements, but again, grouped all the elements together in the group response. This following from the groups having marked the original bugs as outside of the group’s interest. That this response was inconsistent didn’t seem to matter—built-in elements are better for accessibility, regardless of the elements.

Back in the HTML WG, I have been met with a block of voices all clamoring, “We want the elements”. My first reaction when met with the fairly strong resistance was to bag my change proposals, and just let the overly large HTML5 specification be that much larger. Such a response, though, would not be honest—I genuinely believe that not only are these elements not useful, their costs exceed whatever perceived benefit they may bring.

Now, a few months later, I’m making final edits to my change proposals in response to the blanket counter-proposal and the one paragraph response from the Accessibility TF. You can read my work for the first change proposal I’m editing, related to deleting the details and summary elements. I’ll post my work in progress for the other change proposals as I finish.

Yours truly,

the Deletionist

Categories
HTML5 Specs

Removing the Detail and Summary elements

One of my HTML5 change proposals is to remove the details element[12].

The HTML5 specification states[1]:

The Details represents a disclosure widget from which users can obtain additional information or controls.

Two examples of the use of Details are given: one used with additional information, and one used with form elements. Whether the details body is shown or not is based on the presence (or absence) of the boolean open attribute. If open is present, the body is displayed; if not, the body is not displayed. User Agents are supposed to respond in some way to a user request to open the details element by setting this boolean attribute, and to respond to a user request to close the details element by removing this attribute.

Rationales for Keeping the Element

The rationale for keeping the element provided by the editor, Ian Hickson, in the initial bug to remove it is[2]:

The <details> element is needed to provide an accessible way of reflecting a common application widget in HTML-based applications without requiring authors to use extensive scripting, ARIA, and platform-specific CSS to get the same effect.

A counter-proposal has been provided to keep the element. The rationale in the counter proposal is[3]:

The notion of “optional” content that can be skipped over when reading the main content is a useful semantic to express.

This semantic is used in many webpages. For example, forms sometimes contain optional sections that are not necessary to successfully submit the form, but allow you to give extra information. Message boards often have a “spoiler” feature for hiding long sections of content that aren’t necessarily useful (such as a long digression proving some point used in an argument) or that readers may want hidden until they choose to view it (such as conversation about a movie or book that concerns important plot details).

The <details> element expresses this semantic, indicating that its contents may be optional or are otherwise suppressed, but may be called up and viewed or interacted with easily. The <summary> element provides a short description of the content within its <details> parent.

In addition, the Accessibility TF discussed the change proposal[4], and among the benefits discussed were the following:

  • Specific behavior associated.
  • Makes a control for a behavior that is frequently done in script. what details does is frequently done (badly and inaccessibly) in script.
  • Specifically useful for accessibility.
  • Authors often roll their own without getting the accessibility right, and it is expensive.
  • Details isn’t trivial to do in Javascript.
  • There are things without elements, like accordions – I’d like to see elements for those too, rather than removing this one…from an interaction design perspective she might have a point that these are similar.

The Accessibility Task Force also provided a general statement regarding this element and others:

RATIONALE: The F2F believes these elements are actually useful for accessibility. We note that features similar to the elements in question are today created using elements with different semantics actuated by style and script, whereas we prefer native elements.

Response

Summarizing the rationales for keeping details:

  • This type of behavior occurs frequently
  • This type of behavior is semantic
  • Implementing this type of behavior with JavaScript and CSS is difficult, error-prone, and inaccessible
  • Generally, built-in elements are more accessible than their JavaScript/CSS equivalents

Starting from the top, I agree that this type of behavior occurs frequently. So frequently, in fact, that there are variations on the behaviors, and the concept of a collapsible, hidden page section has been incorporated into higher level accordion, popup menu, and tabbed page applications. This type of behavior has also been in use for many years, and is implemented in most User Interface libraries, such as Yahoo! UI (YUI), jQuery, Dojo, Mootools, and others.

Therefore, I agree with those providing counter-proposals that this type of behavior is common. However, I do not agree with the other rationales/assertions given.

Behavior is not semantics

I disagree with the assertion that this type of packaged behavior is “semantic”. There is nothing semantic about managing web space more efficiently by hiding a page section and only displaying the section based on some event. It is a convenience, a way of simplifying the presentation of the content.

Consider a page that has collapsed sections compared to a version of the same page, identical in every other way, except that it doesn’t use collapsible sections. The meaning of the page, or its contents, doesn’t differ between the versions. In fact, the concept of progressive enhancement is based on the principle of providing the same content regardless of whether JavaScript is enabled or not. The details element is nothing more than a declarative element mimicking a well know JavaScript/CSS enabled behavior—if the use of a JavaScript-enabled collapsible section does not change the meaning of the page, or its content, the existence of a built-in alternative does not either.

I created four pages, each with collapsible sections. One implements the behavior with a div elements, similar to what we might find given in earlier examples (a “for more details section”)[5]; one implements the collapsible section behavior with form elements[6]; another with an unordered list, like we might use with a menu[7]; the last with table rows[8].

Access the pages using a JavaScript-enabled browser, then turn the JavaScript off and access the pages again. The contents of the page do not change based on the presence of JavaScript or not, nor does the overall page meaning change. The use of the collapsed sections is a way of managing web page space: nothing more, nothing less.

The collapsible section is a purely presentational construct, implemented using JavaScript and CSS.

Difficulty of Implementing Collapsed Sections

Another rationale given for keeping the details element is that creating collapsible sections using JavaScript and CSS is difficult. The examples I just listed are using the exact same JavaScript, except for one minor line change in the table example for IE8, to work around a browser bug. The exact same code—and the code is more verbose than it needs to be, to make it easier to read. The examples are also keyboard accessible, as well as annotated with ARIA.

The amount of code is insignificant, and that’s with me coding the behavior from scratch. This type of collapsible section is implemented in most UI libraries, and typically only requires either a single function call, or that we annotate a couple of page elements with a specialized class value. We’d probably annotate the elements anyway, in order to create the element’s unique style.

Not only is the amount of code needed small, it’s also important to note that the label/content sections of the different examples also make use of elements relevant to the uses. The form example uses form-specific elements (fieldset and legend); the table example, a table element (table rows). Even the use of an unordered list for the menu items is extremely common, as is the use of the div elements for the “more details” implementation.

Being able to apply the same behavior to different page elements should be encouraged. Trying to integrate a details element into a table element or form element, in order to implement the same behavior I demonstrated in my examples, is not only awkward, there’s a very good possibility the use of the element would fail conformance tests, if it even worked. When you introduce elements to take the place of JavaScript behaviors, you introduce changes to structure, as well as behaviors—we have far less flexibility when applying changes to structure than to modifying the behavior of existing elements.

The User experience and Accessibility

The last rationale associated with keeping the details element is the supposedly superior accessibility of built-in elements, such as details, as compared to JavaScript-enabled behaviors. Let’s look at the accessibility associated with the details element.

The HTML5 specification says the following about the behavior associated with details:

The user agent should allow the user to request that the details be shown or hidden. To honor a request for the details to be shown, the user agent must set the open attribute on the element to the value open. To honor a request for the details to be hidden, the user agent must remove the open attribute from the element.

There is nothing related to accessibility associated with the element. There’s nothing in the HTML5 specification about what user-initiated action each user agent will associate with the details element. Unlike a link (a), there is no actionable behavior associated with the details element. If, as is likely, the details behavior is only triggered by mouse clicks, we’ll have to attach a tabindex of zero(0) to the element, and add our own code to open and close the item, to make it keyboard accessible—if we can add this functionality, depending on how much control we can exert over details.

The examples I provided responded to both a click event, and a simple ENTER keypress event. Depending on the context of use, I can also add additional events. We don’t know what events we can attach to details, though, or which events we can intercept. We’re not even sure about what happens if we attempt to override the element’s default behavior, by manually assigning the open boolean attribute.

There’s no mapping, either, between the element and whatever accessibility API browsers support. We also have no way to attach existing ARIA roles and states with the element, because we don’t know if doing so could conflict with the default behavior— we just don’t have any input into, or control over this element.

So there is absolutely nothing accessible about the element. There’s not even the promise of accessibility— the element’s behavior is too vaguely defined yet inflexible, to enable even partial accessibility until each and every user agent implements whatever it deems appropriate. Considering the various ways in which we can implement a collapsible section behavior, we’re unlikely to ever have satisfactory accessibility with the element.

The details element is not user friendly, either. For the last decade, we’ve come to learn that when we access a web page with a user agent that doesn’t support JavaScript, or where JavaScript is disabled, whatever collapsed sections exist in the page should expand, by default. Such behavior is the result of a long campaign to incorporate good design concepts, among them the concept of progressive enhancement— design the page without JavaScript, first, and then add the JavaScript to enhance the page effects.

Now, because of introducing a declarative element such as details, when a person accesses a web site with both Flash and JavaScript disabled, they still may not see all of the page contents. This is counter to established practices and user expectations. Do we now have to insist that browsers provide a way to turn off declarative animations, in addition to JavaScript and Flash? If so, what happens if we turn off declarative animations for an element such as details, but keep JavaScript and try to manually manage the opening and closing of the element?

We also run into problems with being able to print pages that contain details managed content. According to Ian Hickson, the browser print page functionality is supposed to reflect the state of the page—printing out the details element contents if the element is open, not if it is closed[9].

Typically, custom print page functionality is dependent on turning off JavaScript, and either removing or replacing the stylesheet. Neither of these is an option for the details element. If a site provides custom print functionality, as many do (such as my own web sites, via a custom module), we’ll now either have to strip the details element out of the page and replace it with some other element, or use JavaScript to purposely open this element in order to print the contents. Again, we’re not sure what’s going to happen if we attempt to override default browser behavior using JavaScript.

Designers and web site owners are also going to have a challenging time integrating the element into a site’s design. As demonstrated with my examples earlier, I can style the label for my collapsible section anyway I want. I can also control the expanding and collapsing behavior: opening and closing the collapsed section slowly, or expand the section horizontally, rather than vertically. Other than some crude manipulation, such as changing background colors, we have no control of the design or behavior associated with the new details element. We don’t even have the option to change whatever icon is used to signal that the item can expand.

Now, some people may be aware of the limitations, but stress that lack of customization is a positive, rather than negative, aspect of details.

We can’t control the design, true, but the design will be consistent for the operating system. We can’t control the behavior of the new element, true, but then, we don’t have to have JavaScript to control the element, either.

However, the design consistency also differs by browser as well as operating system, and most sites prefer to have the same look and feel across browsers and operating systems. As for the necessity of having JavaScript, its use is so ubiquitous now, that Content Management Systems, such as Drupal, integrate it’s use by default[10].

Speaking of JavaScript, contrary to assertions about “poorly” performing JavaScript libraries that add a heavy burden on a site’s bandwidth, the popular JavaScript libraries are not only well tested, they’re also optimized and compressed to the point where most would probably take less bandwidth then the average image embedded into a web page. Even for mobile devices, the bandwidth burden will be less than the average phone application, eBook, or YouTube video.

Cost

Returning to the rationales summarized earlier, the only point where I and those who provide counter-proposals agree is that the collapsible section behavior is used frequently. Is frequency of use of this type of packaged behavior enough to implement the behavior as an element?

First, let’s take a look at the cost of not implementing this element.

Several years ago, when HTML4 was released, it might have made sense for behaviors such as details to be packaged into declarative elements. Support for JavaScript and CSS was relatively primitive, and completely inaccessible. We had few libraries that provided the functionality we needed, and none were integrated into the tools we used.

All of this has changed in the last decade. We’ve had new releases for both ECMAScript and CSS, and improved support for both in all of our browsers. With the addition of ARIA, we now have a way to incorporate rendering semantics into our applications—and ARIA support is being incorporated into all of the major JavaScript framework and UI libraries.

The cost to implement this functionality using existing tools has already been incurred. We’ve already paid the bill. Additionally, as my examples hopefully demonstrated, we can use this type of collapsible section behavior with a variety of web elements, for many different purposes, at no extra charge.

Now let’s look at the costs associated with adding the details element. Tools such as lint tools and validation tools have to incorporate functionality to cover the use of the new element—and considering the different ways in which we use collapsible elements, the probable misuse of the element. HTML editing tools have to incorporate support for the element, as well as providing preview functionality (it’s not a simple matter of just defining a new element). WYSIWYG tools have to find some way to not only incorporate an icon for the new element, but also the summary element, and do so in a valid manner. As has been noted elsewhere, the significant number of new elements in HTML5, and the vagueness of their definition, is already a cause for concern for WYSIWYG tool builders[11]. Browsers have to implement support for the new element, which adds to the complexity of the browsers, as well as providing another point of failure. This is especially true since we’re using declarative animation where it has never existed before.

Designers are going to have to figure out what they can or cannot do to style the element, and page authors and developers are going to have to figure out when it can be safely used, and how. Builders of tools that generate content, such as Drupal and WordPress, have to figure out if they need to incorporate support for the element into theme options or as components. Developers who provide print themes without having to use JavaScript, now have to use JavaScript to ensure the element’s contents are printed out. Books will have to be updated, tutorials re-written or created, examples and other documentation provided.

We have to also consider that by implementing one element specifically to emulate a JavaScript-enabled behavior, we’re opening the door to many more of these elements. In the notes related to the Accessibility Task Force decision to protest the change proposal to remove the details element, someone mentioned about not only implementing a details like element, but also implementing elements for other behaviors I’ve mentioned, such as accordion or tabbed page behaviors. The HTML5 editor may believe that something like a collapsible section should be created, but tabbed pages or accordions are “out of scope”, but the only criteria that seems to be used in determining which to create, and which to not, is the editor’s own opinion. This means that we could have potential explosive growth in new elements in future versions of HTML, when either the editor’s opinion changes, or, we have new and different editors.

Whether everyone agrees with implementing declarative elements for these higher-level behaviors or not, I believe there is some general agreement among all those who protest my proposal to drop details that a) it’s better to have declarative elements, and b) the costs are primarily to the browser implementors, without significant impact on other communities. The writers of the counter-proposal have stated that the only cost they see to the element is:

Each new element, attribute, and control is extra functionality for browsers to implement, and for HTML educators, including tutorials, to teach.

However, as I hope I’ve demonstrated, there are significant costs associated with each new element and attribute added to the HTML5 specification, and that the impact can be felt by a great number of web communities. The group may decide the cost is worthwhile in the end, but it should, at a minimum, be aware of the costs and impacts on on all of the communities.

The details element is worth the cost if we believe one thing: that web page authors, designers, and developers will use this new element over existing libraries and implementations. Considering the state of the art of this type of functionality today, and how long before this element could be used in the majority of web sites, and how limited we are with both the styling of the element and where and how we can use it, I find it unlikely that the element will achieve widespread use. I’m confident saying it is unlikely the details element will be used enough to justify its cost.

The details element provides too little in the way of new functionality, and what it does provide, it provides too late.

References

  1. http://dev.w3.org/html5/spec/interactive-elements.html#the-details-element
  2. http://www.w3.org/Bugs/Public/show_bug.cgi?id=8379#c13
  3. http://www.w3.org/html/wg/wiki/ChangeProposals/KeepNewElements#Rationale…
  4. http://lists.w3.org/Archives/Public/public-html/2010Apr/1144.html
  5. http://burningbird.net/html5/detailsdivs.html
  6. http://burningbird.net/html5/detailsform.html
  7. http://burningbird.net/html5/detailsmenu.html
  8. http://burningbird.net/html5/detailstable.html
  9. http://www.mail-archive.com/whatwg@lists.whatwg.org/msg20013.html
  10. http://drupal.org/node/99973
  11. http://rebuildingtheweb.com/en/why-do-wysiwyg-editors-hate-html5/
  12. http://www.w3.org/html/wg/wiki/ChangeProposals/removedetails
Categories
Social Media Specs W3C

HTML5 status and when not to tweet

I’m in the process of rolling out some change proposals and bug reports for HTML5. I had volunteered to help with reviewing MathML during Last Call, and submitting comments for the HTML WG. Unfortunately, the process did not go smoothly.

In the meantime, this week was the W3C’s TPAC meeting, where all the boys and girls from all the W3C working groups get together for a face to face. Interesting stuff happened, including the TAG (TAG is the overall W3C architecture group) recommendation that HTML WG split Microdata from HTML5. We’ll see where that goes.

Twitter was very useful for those of us who were not at TAG. Those at TAG pointed out the IRC channels associated with each meeting, and where links to reports and presentations could be found. It was an example of good Twitter use.

What was not an example of good Twitter use last week were the “live” Twitter messages that came from a soldier in a hospital within Fort Hood during the recent tragic events. The inappropriate and less than helpful use of Twitter was detailed in an exceptionally good post at Techcrunch, written by Paul Carr.

In the writing, Paul makes the point that rather than help, or at least get out of the way, during a crises, we grab our cellphones and become mini-journalists—macabrely excited about being “live” at the event. We post photos of people hurt in accidents, or shot by a crazy man, regardless of who we might harm, including family members or the victims themselves. We exaggerate the event until one gunman becomes three, and an act of insanity becomes one of terrorism.

More importantly, we jam necessary cellphone lines in order to get that last tweet out, cause confusion, and aid and abet chaos.

Even outside a crises, we don’t seem to know when to turn off the spigot. How many of us woke up this morning to be met with the ultimate of absurdities: hundreds of messages from folks “live tweeting” a Congressional vote. My god, it’s just a bloody vote. There is nothing exciting about a vote until the vote is finished and the tabulation made.

Frankly, I would rather hear what people had for breakfast.

Anyway, more on HTML5 later, and do read Paul Carr’s writing.

update Suw Charman-Anderson has a detailed rebuttal. She has some good points, especially about the Iranians feeling reassured that people were listening.

What she misses, though, is the past tense: people were listening. People listened during the Iranian election, dyed their avatars green, and filled Twitter trends with the topic. And then…it all just went away. And that’s the point I think that Paul was making: social media’s ability to influence events is directly proportional to the attention of the participants, and the participants are being subjected to a continuous barrage of new events, and new outrages.

The green avatars are gone. Do the Iranian people still feel assured that people are listening?

Categories
HTML5 Specs

Microsoft’s proposed namespace distributed extensibility in HTML5

Per Sam Ruby, Microsoft has submitted a proposal for distributed extensibility in HTML5, which features the use of namespaces.

The proposal uses reverse DNS names, but other than those ugly sons-of-bitches, it looks promising. There are some issues, including no support for innerHTML on namespaced elements, because they would end up defined as Element, not HTMLUnknownElement, but I don’t think that’s going to be a real problem in the wild. More importantly, I believe the proposal would handle the problems I noted in my last writing, about the valid use of namespaced elements and attributes in SVG. The issue with namespaced elements in SVG isn’t a made-up problem or one that is unlikely to occur: it is a real problem, it will occur in the future, and it does require real solutions. The problem is not going to go away because Ian Hickson clicks ruby shoes together and murmurs “There’s no such thing as namespaces…there’s no such thing as namespaces…” This absolute refusal to acknowledge something that has existed on the web for a decade is, frankly, unconscionable.

I wish I could say that the happy campers of the HTML WG are willing to at least enter into an open and unbiased discussion on the proposal, but I stopped believing in fairy tales, a long time ago. There is contention on this issue (namespaces for distributed extensibility), as noted in the past, in the current discussion, in the HTML WG bug database, related to the new RDFa-in-HTML proposal. Needless to say, the WhatWG members have responded in their typical, open and mature manner.

But here’s some cold, hard reality for Ian et al: this isn’t a proposal from folks like me, who have little say, and no power. This proposal comes from Microsoft. Microsoft, who still maintains a dominant position when it comes to browser use in the world. The HTML5 editor cannot simply ignore the proposal, pretend he doesn’t understand it, or rubber stamp it WONTFIX. Not this time.

Categories
Burningbird Specs

Site problems, HTML5, and LC Realities

Well, that was exciting. I wasn’t sure what was happening with my sites, since Drupal throws up a maintenance page automatically when it can’t get a database connection. My ISP is still investigating what caused the problems.

In the meantime, the WhatWG IRC log is interesting reading today, including the following quote about HTML5 and Last Call, from Philip:

AryehGregor: Hixie, are we still scheduled for October Last Call?  
Philip: If there's a delay, we can just redefine October 
           to match the reality of the spec's status  

So there you go, if someone asks whether HTML5 will make Last Call in the next few weeks, you can answer, Yes—secure in the knowledge that it’s always October, somewhere.