W3C home > Mailing lists > Public > www-style@w3.org > October 2005

Behaviors, was: Re: Styling by attribute-based association?

From: Andrew Fedoniouk <news@terrainformatica.com>
Date: Tue, 25 Oct 2005 13:54:36 -0700
Message-ID: <00c301c5d9a6$4f17de50$c302000a@internal.toppro.net>
To: "Orion Adrian" <orion.adrian@gmail.com>, <www-style@w3.org>

----- Original Message ----- 
From: "Orion Adrian" <orion.adrian@gmail.com>

| On 10/25/05, ACJ <ego@acjs.net> wrote:
| > The CSS2 attribute selector [1] allows you to style labels with a for
| > attribute like this:
| >
| > label[for] { border: thin dashed }
| >
| > The first case you discribe (1) is not possible with current CSS, but
| > one could argue if it should. It sounds like behaviour to me (and should
| > therefor be handled by script).
| Behavior is a ill-defined thing. What's your definition for it? Or is
| it, "I know it when I see it."

I am defining "behavior" as a set of functions - event handlers:
on_mouse_down, on_mouse_up, etc. attached to the DOM element.
Each such set is responsible for implementation of particular behavior of the 
element -
its reaction on users actions. Purpose of behavior functions is to modify
DOM elements - their attributes, state flags (:visited, :hover, etc) and content 
in the
way they seen to CSS engine. CSS and such behaviors peacefully coexist -
behavior changes state, CSS renders it.

Here is an example of <select> element which is pure DOM element with
attached "input-select" behavior. Any compnent of <select> (option, optgroups) 
is a
DOM element styled as anything else.

And here is a dropdown select behavior:
(Behavior in this case just enumerates <option>s placed in any arbitrary 

( To see this alive with HTML/CSS samples download 
- temporary link , will expire pretty soon )

Andrew Fedoniouk.

| --
| Orion Adrian
Received on Tuesday, 25 October 2005 20:55:01 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:21 UTC