W3C home > Mailing lists > Public > public-html@w3.org > May 2007

Applicable elements for predefined classnames

From: Rene Saarsoo <nene@triin.net>
Date: Sat, 05 May 2007 15:48:57 +0300
To: "public-html@w3.org" <public-html@w3.org>
Message-ID: <op.trutvvuaexn25i@localhost>

(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>
or
<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?


[1]  
<http://www.whatwg.org/specs/web-apps/current-work/multipage/section-global.html#predefined>
[2]  
<http://www.whatwg.org/specs/web-apps/current-work/multipage/section-miscellaneous.html#the-div>

--
Rene Saarsoo
Received on Saturday, 5 May 2007 12:48:17 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 9 May 2012 00:15:58 GMT