Alex Russell is not a heretic

First off, let me preface this by saying I just got back to the East Coast after catching a red-eye from San Francisco on Saturday night, so if I seem a bit incoherent, that’s likely why.

In perhaps the most intellectually-stimulating session at The Rich Web Experience, Alex Russell (of Dojo Toolkit fame) tackled the topic of Standards Heresy.

For those who are not aware, Alex was once a staunch standards advocate who has turned to what he considers, “the dark side.” In truth, he’s sick and tied of the dysfunctional nature of the W3C and other similar organizations and I can’t say I blame him. As his session pointed out, the W3C has 60+ paid, full-time staff and yet we saw literally no movement on either (X)HTML or CSS for over five years. That is a travesty.

In my opinion, fault lies not with the individuals on the various committees and sub-committees, but rather, with the process. And this isn’t just a problem in the W3C, an organization comprised almost entirely of representatives from the various software vendors (Microsoft, AOL, Opera, etc.) which pay tens of thousands a year to take part. Look at what’s happening with JavaScript 2 in ECMA. Or HTML5 for that matter—“just because it is an “open” organization which “anyone can join” doesn’t make the WHAT WG any better. They are all flawed because the process is flawed, and I think that is Alex’s main point (despite his assertion that the WHAT WG is not dysfunctional).

So why is the process flawed? Well, for one, spec writing is largely an academic undertaking. In many cases there are invited experts in a Working Group (such as Andy Clarke in the CSS one), but, for the most part, specs are written by people who are not in the trenches. As Alex rightly points out, in fact, many times, the specs are nothing more than an official blessing of some proprietary technique or technology created by a member company. And good ideas that may be very useful to designers or developers are lost because of internal politics or because a browser vendor thinks it would be “too hard” to implement.

Which brings me to Alex’s “heresy.” In his session, he proudly declared himself a heretic because he sees a need for innovation in (X)HTML which is currently unavailable because the specs are not evolving quickly enough. I feel his pain, but I think he is looking at the problem the wrong way. He sees the spec (and web standards in general) as stifling innovation. I see web standards as facilitating innovation. After all, were it not for the firm foundation of well-formed documents and a unified DOM (no matter how piecemeal the implementations), we’d still be writing spaghetti code whenever we tried to do anything with JavaScript. It is because of web standards that we can write clean JavaScript and that we can make truly innovative interactions that take us beyond what is allowed for in the specs themselves.

But back to Alex’s complaint…as his example of how Dojo is heretical, he showed this code example:

<div dojoType="dijit.form.HorizontalSlider"
name="horizontal1"
onChange="dojo.byId('slider1input').value=arguments[0];"
value="10"
maximum="100"
minimum="0"
showButtons="false"
intermediateChanges="true"
style="width:50%; height: 20px;"
id="slider1">
<!––>
</div>
view raw dojo.html hosted with ❤ by GitHub

The problem that Dojo is attempting to solve here is the inclusion of a slider form control, which does not exist under the current HTML Forms spec. In order to function, the widget requires several custom attributes to be placed on the element to provide information to assist in the creation of that slider. The fact that Alex “cannot” add these attributes to the document and maintain XHTML validity is a major source of annoyance for him and part of why he has decided that validation is no longer important.

But the truth is that Alex could make any or all of these attributes available to whatever elements he wants and still have a validating document by simply creating a DTD (based on any existing (X)HTML one) to include them. After all, the X in XHTML stands for extensible…the language is meant to be improved. Sure, there are some standardistas who think we shouldn’t muck about with the standards, but the powers that be put that extensibility in there for a reason (and I don’t think it was just as a tease). By extending the language to mix in features we desperately need, we drive innovation and, who knows, perhaps someone will take notice and add our extensions into the next version, thereby driving the evolution of the language so many of us desperately want.

The same goes for CSS. The W3C made CSS extensible by allowing for custom properties utilizing the -*- syntax. Chances are, you’ve come across this when implementing -moz-border-radius or -webkit-border-radius (which, honestly, both seem superfluous to me when the CSS3 spec includes border-radius as an actual property…why not just support that?). In my mind, this is ripe for use in extension of CSS, not by individual browser vendors (as that is proprietary and closed), but by us (in an open, cross-browser/cross-platform way) to achieve what we want or need that CSS currently does not offer us. That was the basis for my work on gFSS (an experiment in presentational Flash generated from CSS, debuted at Web Directions North this year) and another project I will be releasing in the next few months.

So, long story, long, I don’t think that Alex is a heretic. I think he can make a solid case for extending the language (and the interface) of the web for his particular needs (or the needs of his toolkit) as long as he backs it up with documentation in the form of a custom DTD.

An aside

I do have one problem with what Alex wants, however (or at least what he chooses as a code example) and that problem is the extension of the language, but rather the way in which it was done (i.e. the DIV in his example will degrade to nothing without JavaScript enabled). Dojo supports WAI-ARIA to improve the accessibility of this and many other widgets, which is commendable, but that extra markup is only generated when the Dojo methods are run. If JavaScript is turned off in his example, no form control is available whatsoever.

What I’d prefer to see is something like this:

<select class="dojo-form-horizontalSlider"
name="horizontal1"
showButtons="false"
intermediateChanges="true"
id="slider1">
<option>0</option>
<option>5</option>
<option selected="selected">10</option>
<!––>
<option>100</option>
</select>
view raw slider.html hosted with ❤ by GitHub

There’s nothing that could keep Dojo from parsing that bit of XHTML and gleaning from it what it needs to make the slider. And now, when Dojo doesn’t run, there is a degradable interface for the user to adjust the setting. Sure, it may not be nearly as nice, but at least it works. Plus, it allows Dojo to be added as a progressive enhancement, which is what it should be.

And to make this valid syntax, the Dojo team just needs to augment the XHTML 1.0 Strict DTD like this to include the custom attributes:

<!ENTITY % Boolean
"(true | false)"
>
<!– attributes for Dojo Toolkit
showButtons display buttons (boolean)
intermediateChanges display intermediate steps (boolean)
–>
<!ENTITY % dojo-attrs
"showButtons %Boolean #IMPLIED
intermediateChanges %Boolean #IMPLIED"
>
<!ATTLIST select
%attrs;
name CDATA #REQUIRED
size %Number; #IMPLIED
multiple (multiple) #IMPLIED
disabled (disabled) #IMPLIED
tabindex %Number; #IMPLIED
onfocus %Script; #IMPLIED
onblur %Script; #IMPLIED
onchange %Script; #IMPLIED
%dojo-attrs;
>
view raw dojo.dtd hosted with ❤ by GitHub

Sure, it takes a little extra work, but at least it gives users of the Dojo Toolkit the ability to validate their documents, which will help reduce potential CSS and JavaScript conflicts and errors (just one of the many benefits of web standards). Beyond that, it takes advantage of the extensibility of the language to facilitate innovation, and isn’t innovation what we all really want to see?

Like it? Share it

Share on LinkedIn

Share on Google Plus

Comments

  1. Chances are, you’ve come across this when implementing <code class=“css”>-moz-border-radius</code> or <code class=“css”>-webkit-border-radius</code> (which, honestly, both seem superfluous to me when the CSS3 spec includes <code class=“css”>border-radius</code> as an actual property…why not just support that?).

    The vendor-specific prefix is present on these properties because the CSS 3 specification is still in draft. This means that a given vendor’s implementation of the property that was implemented against the specification on a given date may not be completely compliant to the specification when it leaves draft status. It’s a way of letting developers experiment with the new CSS 3 features while still reminding them that they are a work in progress and are subject to change as specification matures.

  2. <blockquote cite=“http://www.easy-reader.net/archives/2007/09/10/alex-russell-is-not-a-heretic/#comment-11827”>The vendor-specific prefix is present on these properties because the <abbr title=“Cascading Style Sheets”>CSS</abbr> 3 specification is still in draft.
     </blockquote>

    Right. I know that’s the intent, but the problem is that these features have been publicized and are now being incorporated into stylesheets as though they were part of the spec. I see that as somewhat of an issue. The spec itself states that

    <blockquote cite=“http://www.w3.org/TR/CSS21/syndata.html#vendor-keywords”>Authors should avoid vendor-specific extensions
     </blockquote>

    But, unfortunately, few authors ever do.

    I guess what I am proposing is that the term “vendor” be opened up to more than just the browser software makers. I would like to see developers push more presentational configuration into <abbr title=“Cascading Style Sheets”>CSS</abbr> than currently exists. For example, we should be able to extend the language to do fill gaps (provided we document it, obviously), not just “preview” what’s coming in some future version of of the language. Here’s one possibility:

    <code class="css">.dojo-form-horizontalSlider {
      -dojo-show-buttons: false;
      -dojo-intermediate-changes: true; }</code>

    Both of these properties are presentational about the rendering of the slider widget. Obviously you could get more specific about instances, but I think it makes a valid point. After all, the spec does not say this is only for previewing features. It says that if a vendor needs to add a property, it can. My feeling is that we should use that opportunity.

    Plus, <code class=“css”>-moz-border-radius</code> and <code class=“css”>-webkit-border-radius</code> (as fun as they are to play with) feel like a cop-out to me. Other features of CSS3 are being implemented by both Mozilla and Webkit without the vendor extension (<code class=“css”>overflow-x</code> and <code class=“css”>overflow-y</code>, for instance). Why pick and choose?

  3. Hey Aaron,

    I agree (as we discussed F2F) with much of what you’ve said. I can’t seem to find your email anywhere, but I would like to follow up on the points regarding the correct patterns for degraded markup for each widget so that we can come up with a set of recommendations which can go in the Dojo docs. I’d appreciate it if you’d send me private mail at alex at dojotoolkit dot org.

    Progress on the DTD front isn’t likely before Dojo 1.0, but may be possible afterward. As for CSS rules being used to locate widgets, not verey likely as the default (why is the class selector more blessed than attribute selectors?) but perhaps pluggable. There are only a couple of things that would need to change for such a plugin to work in Dojo.

    Regards

  4. <blockquote cite=“http://www.easy-reader.net/archives/2007/09/10/alex-russell-is-not-a-heretic/#comment-11831”>I would like to follow up on the points regarding the correct patterns for degraded markup for each widget so that we can come up with a set of recommendations which can go in the Dojo docs.</blockquote>

    Excellent, I’d love to help. Email’s on it’s way.

    <blockquote cite=“http://www.easy-reader.net/archives/2007/09/10/alex-russell-is-not-a-heretic/#comment-11831”>Progress on the <abbr title=“Document Type Definition”>DTD</abbr> front isn’t likely before Dojo 1.0, but may be possible afterward.</blockquote>

    I understand that this isn’t the most pressing thing for you all right now, but I am glad you’re interested in it as an option. I’m happy to help in this regard as well, just let me know.

    <blockquote cite=“http://www.easy-reader.net/archives/2007/09/10/alex-russell-is-not-a-heretic/#comment-11831”>As for <abbr title=“Cascading Style Sheets”>CSS</abbr> rules being used to locate widgets, not very likely as the default why is the class selector more blessed than attribute selectors?) but perhaps pluggable. There are only a couple of things that would need to change for such a plugin to work in Dojo.</blockquote>

    It’s not a hard gap to fill, for sure. I guess I am of the mindset that CLASSes are for classification of elements (not just application of <abbr title=“Cascading Style Sheets”>CSS</abbr>). That’s why I favor it as a means of including additional info about an element or using it as a hook for a script. We can talk more about this at length as well via email.

  5. Perhaps the most intellectually-stimulating session and I totally agree with Alex Russell is not a heretic…