W3C home > Mailing lists > Public > www-style@w3.org > July 2001

Re: Future suggestions for stylesheets ...

From: Clover Andrew <aclover@1value.com>
Date: Mon, 16 Jul 2001 12:55:58 +0200
Message-ID: <D58B0195B58937489E89124469E57CA20D507A@EX1.1value.com>
To: <www-style@w3.org>
Tim Bagot <tsb-w3-style-0003@earth.li> wrote:

> There was a Behavioral CSS (BeCSS) WD, but it seems to have been
> more or less abandoned.

I do hope so.

> I think it is felt that scripting should be kept out of the core
> specification, as it adds too much complexity.

Not to mention possible security problems. The world does not need
another unexpected place to hide scripting: just look at the
problems javascript: URLs have caused.

> could similar functionality be achieved by a script traversing
> the document tree and adding event attributes as required?

Yes, I've written several scripts this way and it's quite pleasant.
body-onload calls an initialisation function in a linked script,
which binds onto the required elements with no extra markup
required. It'll be better when more browsers support DOM 2 Events
and methods like 'addEventListener', which have the potential to
cope better with multiple behaviours.

The big problem is picking out which elements to affect. Selecting
a single element is fine (getElementById, with backup for older
browsers); selecting all elements of a certain type is okay
(getElementsByTagName, backup for older browsers is tricky);
selecting all elements of a certain class is not easy at all. The
DOM lacks a getElementsByArbitraryAttributeValue().

Andrew Clover
Technical Consultant
Received on Monday, 16 July 2001 06:58:13 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:26:58 UTC