Applicable elements for predefined classnames

(Starting a new thread separate from the role v/s class debate.)

First of all there is a bug in WHATWG spec.
The Predefined class names section [1] excludes div
as an applicable element, although the section for
the element div [2] clearly states, that six predefined
classes apply to this element.

But for some reason "copyright" does not apply to div.
I see no apparent reason why it shouldn't.

Anyway, this list of applicable elements seems kind of
limiting. For example it seems natural, that I would like
to write an example of computer code, like this:

<pre class="example">Some code...</pre>
<code class="example">Some code...</code>

But predefined class "example" is only allowed for aside,
figure, p, section, span :(

Another example: "warning" class applies to many more
elements than the "error" class. Why so? What's the big
difference between error and warning anyway?

And there are a lot of elements for which you can't apply
any predefined classname:

- none of the list elements.
- none of the table elements.
- and many more...

What's wrong with having an example table?
Or why can't I have a list of warnings?

In conclusion. Why should the predefined classnames only
apply to limited set of elements?

Certanly there are some elements, for which you don't want
to apply those predefined classnames. For example the
head, title, meta and link elements.

I don't think authors should be forced to remember, that
to article only "warning" applies, but "copyright" only
applies to p and span, and that you can have a warning-figure,
but not an error-figure.

And do we really expect, that user-agents will ignore
a predefined classname, if it's applied to an element not
in the list of allowed ones?


Rene Saarsoo

Received on Saturday, 5 May 2007 12:48:17 UTC