Thursday, April 12, 2012

content vs structure and the quixotic hopes of html5

So one old tag/feature that some whippersnappers might not know about, but comes in useful from time to time, is <nobr>. On old (and current, for that matter) browsers, it does a good job of telling the browser not to automatically insert any line breaks, that you want this line to just go on and on. A common use case is to safely wrap a phone number in a body of text, also with various widgets it can be useful for maintaining certain kinds of structure.

Of course, this is the Age of CSS, not the  bad old days of oddball tags, and the CSS equivalent is
white-space: nowrap; It seems to work pretty well. (Unlike text-wrap:none; which isn't supported by anyone.)

Anyway, thinking about the dirty old  <nobr> tag remind me of the dream the semantic web, and how it influences html5. For a while I've thought that it feels like html5 purists (especially ones with a designer background) try too hard to make the html page do things an engineer would use a Content Management System for; I tend to think of HTML as something people look at, ultimately; with many systems I've made, the html sits there as kind of a template, until some kind of server language or javascript fills in the blanks... it's not the ultimate repository of knowledge, and it doesn't have to pretend that it is.

And that, I guess, is what the html5 folks disagree with... with MVC (Model View Controller), they would like the page to be the M, the model, with all of the V/View aspects controlled by the CSS. One of the finest examples of this is  CSS Zen Garden that show off the ability to have vastly different look-and-feels just by swapping out the CSS. And it's really impressive -- so many variations looking so fantastic -- until you realize two things: the fundamental page really is pretty simple, and there's a fundamental sameness to all the variations, but worse than that: 80-90% of the "heavy lifting" is being done by custom graphics. For example, the Scouts-influenced Make 'em Proud look has those awesome headers.. but each one is a custom graphic. Similar, the merit-badge like links at the bottom... It's one big image, with some fixed-width floatingness used on the links to line them up with the image. (Also, the order is reversed relative to other CSS versions, I'm not sure why.)

So with all those custom graphics... if every html page needs its own handtuned CSS page to render properly, that seems rather messed up to me, a reversal of priorities, and a very un-engineerish in its separation of concerns, a tight coupling of form and content. And that's what it comes down to: I think HTML will always be influenced by traditional top to bottom reading order. (Then again I never liked how xml would often dictate a specific order for its elements, it goes against the "everything on one level should be unique key/value pairs and order should be unimportant" ideals that work so well for me on the code side of things.) Something like nobr-- it shouldn't exist in the html5 idealized world because it's purely a display thing, even if it's a reference to a CSS class.

I guess some day we might have a semantic "phone" tag that would know not to split itself on lines, but still, I think trying to treat html5 as just a holder of data is a fool's errand.

No comments:

Post a Comment