W3C home > Mailing lists > Public > whatwg@whatwg.org > December 2008

[whatwg] Thoughts on HTML 5

From: Giovanni Campagna <scampa.giovanni@gmail.com>
Date: Tue, 16 Dec 2008 14:32:23 +0100
Message-ID: <65307430812160532n377153dy58abbc56e7ae2dc6@mail.gmail.com>
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

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:46 UTC