Re: HTML is a declarative mark-up language

On Wed, 28 Jan 2009, Roy T. Fielding wrote:
> 
> If I ask a simple question, like:
> 
>    what does the name attribute on the "a" (anchor) element mean?

The answer to this question is "nothing, this element is non-compliant in 
HTML5". In fact, that's exactly the answer you found, it seems.


> how do I find the answer in HTML5? Well, supposedly I look at the ToC
> for the a element, find it eventually under "Text-level Semantics" at
> <http://www.w3.org/TR/html5/text-level.html#the-a>, and discover that
> there is apparently no "name" attribute for <a> and, further, that <a>
> doesn't even mean anchor any more.  Brilliant.

It represents a hyperlink; is that no the same thing?


> Oh, but maybe it's defined in the operational behavior ...

If you find any conforming features that are defined only in terms of 
operational behavior, then that's a spec bug. Please let me know about 
these cases.


> "The activation behavior of <a> elements that represent hyperlinks
> is to run the following steps:"  Nope, that's DOM.
> 
> You'd almost think that name was removed, but then if we happen to be
> reading the section on Web Browsers we find...
> 
> <http://www.w3.org/TR/html5/history.html#scroll-to-fragid>
> 
> "4. If there is an <a> element in the DOM that has a name attribute
>  whose value is exactly equal to fragid, then the first such element
>  in tree order is the indicated part of the document; stop the algorithm here.

Right, this is error handling behavior for legacy pages. The "name" 
attribute was indeed removed. (This isn't an HTML5 change; the attribute 
was actually removed in XHTML 1.1 back in 2001 at the latest, possibly 
earlier, long before the HTML5 effort started. [1])

[1] http://www.w3.org/TR/2001/REC-xhtml11-20010531/changes.html#a_changes


> The name attribute is used but never defined, AFAICT.  I just happened 
> to run across this error in the first element that I looked at in the 
> HTML5 spec today, and it is hidden because the declarative language is 
> being obscured by the behavioral descriptions.

It's not an error, your interpretation of the spec -- that the attribute 
was removed -- was exactly correct.

This is actually quite encouraging for me. :-)


> > Without understanding where you're coming from, it's hard to 
> > understand your position. I really _would_ like to understand why you 
> > believe this; if I understood that, maybe I would agree with you. 
> > Currently, I do not.
> 
> Yes, it would be nice if you would understand the perspective of someone 
> who is working in the CMS industry, or the HTTP server industry, or the 
> Web authoring tools industry.

For what it's worth, I work for a company that works on a number of CMSes, 
we have written our own HTTP server that serves the third greatest number 
of unique host names (more than 5%) after Apache and IIS [2], and we 
develop several different authoring tools. I am in contact with all these 
teams internally.

[2] http://news.netcraft.com/archives/2009/01/16/january_2009_web_server_survey.html

I in fact _do_ work in those industries.


> You say that it doesn't require DOM, CSS, or scripting, yet the entire 
> spec is defined in terms of the effect on DOM, the impact of CSS, and 
> the behavior of scripting.  If you try to read the spec from the 
> perspective of someone whose implementation does not have a DOM, for 
> whom CSS is an entirely orthogonal concept because there is no rendering 
> or presentation being implemented, and for which scripting is 
> irrelevant, then I think you will discover that HTML5 as currently 
> drafted doesn't even define the base mark-up.

I _am_ someone whose implementation does not have a DOM. (And here I'm not 
even talking about the products I mention above -- I mean I literally have 
personally written implementations of HTML5 that don't have DOMs, the main 
example being a number of MapReduce programs to examine Web pages crawled 
for Google's search engine index.)


I'm not saying that the spec is perfect -- far from it, if it was I 
wouldn't be saying that CR was planned for 2012. What I _am_ saying is 
that it's quite possible to write a spec that defines everything in one 
document, just like specs always have done.

I'm sure there are examples of attributes that aren't defined in terms 
that really help authors today (Lachy on IRC suggested target="" would be 
a good example of this), and I know that the APIs are currently defined in 
very implementation-centric ways. But this is all editorial stuff. It'll 
probably get mostly fixed around Q3 of this year, when I go through and 
make the author-specific filtered view of the spec.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Thursday, 29 January 2009 02:12:48 UTC