W3C home > Mailing lists > Public > www-style@w3.org > December 2006

Re: [whatwg] HTML syntax: shortcuts for 'id' and 'class' attributes

From: Matthew Raymond <mattraymond@earthlink.net>
Date: Thu, 30 Nov 2006 21:40:53 -0500
Message-ID: <456F9635.3050306@earthlink.net>
To: Andrew Fedoniouk <news@terrainformatica.com>
CC: www-style@w3.org

Andrew Fedoniouk wrote:
> While we are on the subject of discussing HTML syntax....
> 
> How about following (wild) idea?
> 
> To allow following notation (borrowed from CSS selectors):
> 
> <p.myclass>...</p> is equivalent of 
> <p class="myclass">...</p> 
> 
> <p#myid>...</p> is equivalent of 
> <p id="myid">...</p> 
> 
> <p.myclass1.myclass2>...</p> is equivalent of 
> <p class="myclass1 myclass2">...</p> 
> 
> <p#myid.myclass1.myclass2>...</p> is equivalent of 
> <p id="myid" class="myclass1 myclass2">...</p> 
> 
> It is syntax sugar of course but at least it will reduce amount of data 
> needs to be sent over the wire.

   Okay, here's what's wrong:

1) Wrong mailing list.

2) Requires you to know two languages to write HTML instead of one.

3) It probably violates XML, so I'm guessing it can't be done in XHTML.

4) It's not backwards compatible with HTML 4.01.

5) People who are still learning HTML and have a programming background
will confuse the element name and all but the last class name for
namespaces.

6) It would take thousands of elements with IDs and/or class names to
make the savings in file size non-trivial. (You could save just as many
characters per page by making the |alt| attribute optional on <img>
elements.)

7) People will be tempted to use other CSS Selectors syntax in markup.
(Or do so out of plain confusion.)

8) The lack of whitespace makes the markup harder to read.

   I'm about to go to sleep, so that's all I can think of for now.
Received on Friday, 1 December 2006 02:41:09 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:47 GMT