Tuesday, March 16, 2010

A New Old Positioning Model forThe Web

One of biggest pain points for Web Designers -- and one that often makes them doubt their skills and abilities -- is that CSS includes a legacy of HTML formatting which, were it to have been a newly proposed Web Design standard in 2010, would be dismissed out of hand as worthless crap. As it is, CSS3 embeds HTML formatting as its enduring legacy, so most people accept the premise without thinking twice and move on with their lives.

I've complained elsewhere about the CSS positioning model and cascading, so I won't repeat those rants. My objective in writing this is to propose another way. Maybe it will be found to be even a crappier way than the bits of CSS we all hate. And maybe I live in a glass house, not having contributed directly to the working group efforts, but I think for the sake of Web Designer sanity it is about time that someone threw the first stone.

We need a new formatting model for the Web. Oh, don't get me wrong: most of CSS is great. The syntax is compact. The abstract model of how style information is attached to the tree is really pretty elegant, even if The Cascade does cause the occasional seizure in the average Web Designer. But the box model interactions are pernicious enough to cause fits of blind rage in ordinary people. Much of the genetic inelegance of CSS really arises from the continued inbreeding with HTML since the early days of the Web.

The solution is to introduce a new strain of positioning model, one which redefines the antiquated notion of "the" in "the normal flow". Here are my premises and logic:
  1. Unless it can be demonstrated that the designer should absolutely not have access to a parameter, all algorithm parameters should be made explicit through syntax.
  2. The designer should be able to control the flow.
  3. Therefore the flow itself should be made explicit to the designer.
In short, I don't think the idea of one "normal" flow was ever sufficient for good design. It is necessary however, for quickly laying out markup. So make "flow" an explicit construct, and refactor "normal flow" as a pre-configured instance which takes over when no other flow is specified.

How? The WDG and W3C vendors seem to have completely missed the boat with CSS3. The most obvious fact that is being ignored is that Web designers have been doing layout for years with markup. Not HTML markup mind you -- the syntax was indeed HTML but as anyone working on HTML5 will tell you, the tags are meant to convey the meaning of content, not the formatted layout. Instead the Web design discipline has very clearly overloaded HTML markup as a primitive layout language.

It is great that CSS allows the designer to separate out the style properties, but it perfectly SUCKS at layout because it got most of its layout algorithms come from HTML formatters, and despite the cleverness of Web designers, overloaded HTML still sucks at layout. It doesn't say explicitly what designers need it to say. Thus, CSS is crippled by its codependent relationship with half-arsed formatting solutions. CSS3 could be so much better, if it stopped looking toward a content specification to specify formatting layout, and instead adopted a separate and distinct markup language to specify layout models and provision formatting algorithms explicitly.

Where can we get such a model? The closest thing in existence today that I know of is XSL-FO. The XSL Recommendation has been tried and tested through years of industrial scale document formatting, yet the overall application model seems poorly suited toward interactive applications.

Is it really?

We are seeing movement in the DITA camp that belies this assumption. DITA is another industrial-strength markup language architecture, which for years has been positioned to perform batch-formatting of content. Yet IBM developers have demonstrated that a little imagination and a lot of work can bring dynamic interfaces for topic-based content forward, exposed directly to face the Web. With a little imagination and a lot of software work, I propose that XSL FO can be adapted to fundamentally enhance the design vocabulary of Web rendering engines.

No comments: