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

Re: [CSS3] transition effects -why not use proper scripting backed up by the correct DOM methods?

From: Andrew Fedoniouk <news@terrainformatica.com>
Date: Tue, 09 May 2006 23:40:10 -0700
To: Jordan OSETE <jordan.osete@laposte.net>
Cc: www-style@w3.org
Message-id: <008b01c673fc$95c7f420$3401a8c0@TERRA>

----- Original Message ----- 
From: "Jordan OSETE" <jordan.osete@laposte.net>
To: "Andrew Fedoniouk" <news@terrainformatica.com>
Cc: <www-style@w3.org>
Sent: Tuesday, May 09, 2006 11:05 PM
Subject: Re: [CSS3] transition effects -why not use proper scripting backed 
up by the correct DOM methods?

> Andrew Fedoniouk a écrit :
>> ----- Original Message ----- From: "Emrah BASKAYA"
>>> I do understand the problem of having to put style related information 
>>> right in the javascript, but these things are too heavy for CSS, IMHO: 
>>> just because we don't want to update two files (css+javascript) instead 
>>> of one shouldn't mean CSS should hold the burden of these behaviours. 
>>> However, I do understand the problem of having to declare style in 
>>> Javascript.
>> Main motivation:  I (as anyone else) would like to be able to 
>> disable/enable transitions and similar effects in my UA.
>> Having animations defined in script does not allow me to implement this
>> feature on UA's level.
> That is exactly why events in CSS are here for. I am sorry i have not 
> explained this well, but it's possible with that. If the script taking 
> care of animations, transitions or whatever are with the main "behavioral" 
> script (as it is the case right now, since there is no way to separate 
> them), then there is no way for the UA to understand wich script does 
> what. If you allow to put script in CSS, then the user agent can just have 
> a "disable scripts defined in CSS" option, that will just do what you 
> want.
> Jordan Osete

I have two objections to scripts inlined in CSS:

1) Too easy to abuse. You'll see a lot of things in such inline scripts
what you will not expect to be there.
2) Embedding two (possibly more) different but close
syntax constructions into one chunk of text is difficult
(read: expect unreliable implementations) and sometimes
is just impossible. E.g. think about string literals in script code
and rules of escapement in this case.
I tried in fact "to marry" CSS and JS once - idea was
close to yours (more ambitious I would say):

    color: black;
    onclick: function( el )
        el.text = "Got click";
        el.state.active = true;
    color: red;

Got a picture at the end:
"Mortification of Beatiful Idea by Disgustful Fact".
CSS notation especially things like font shortcut attribute and
funny nmtokens with minuses inside - it does not work to be short.

Andrew Fedoniouk.
Received on Wednesday, 10 May 2006 06:40:24 UTC

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