[whatwg] Thoughts on HTML 5

2008/12/16 Nils Dagsson Moskopp <
nils-dagsson-moskopp at dieweltistgarnichtso.net>

> Am Dienstag, den 16.12.2008, 14:14 +0100 schrieb Giovanni Campagna:
> > Maybe so-called "invalid" HTML attributes are not the only solution,
> > but in my opinion it is a simple way to embed metadata within any
> > element.
> What metadata are you talking about ? Microformats already exist.


I'm talking of any data that is related semantically to element and should
not be printed to the user or interact with default browser behaviour. There
is an example in the HTML5 spec of an element representing a spaceship in a
browser game, with data- attributes to provide fire / armour values
Imagine the spaceship has class "spaceship", then i can write the following
css:
.spaceship:after {
display:block;
height: 10px;
width:  attr(data-attack,px);
background-color: red;
color: white;
text-align: center;
content: "Attack value " attr(data-attack,string);
}
.spaceship:after:after {
display:block;
height: 10px;
width:  attr(data-defence,px);
background-color: green;
color: white;
text-align: center;
content: "Defence value " attr(data-defence,string);
}
(The same behaviour can be achieved also with a @namespace rule, putting
non-standard attributes in an application-specific namespace)

>
> > Personally I prefer the latter (XML) solution, but there are context
> > where using XML serialization is not possibile (for example in user
> > generated content) so there is a definite need for a SGML way to add
> > custom attributes without conflicting with standards.
> HTML5 is not derived from SGML anymore.
>
My fault, I meant the HTML serialization of HTML5.
Giovanni Campagna
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20081216/acd04552/attachment.htm>

Received on Tuesday, 16 December 2008 05:32:23 UTC