Re: ECMAScript in CSS aka "Expressions"

On May 13, 2005, at 1:17 PM, Boris Zbarsky wrote:

> Ben Curtis wrote:
>> 3. A visitor views a page, toggles the visibility on (script sets var 
>> PrevDisplay = foo.style.display;), then off (script sets 
>> foo.style.display = PrevDisplay; -- that is, "none")
>
> Why doesn't the script do the sane thing and just _unset_ the value 
> instead of setting it to the old value ...

Because in some past browser such a thing was unpredictable, and so I 
developed a bad habit that I failed to correct, and as a result I 
didn't see the obvious and got in the habit of such workarounds. You're 
right, in minor tests it seems setting the value to null works just 
fine. I'm constantly amazed how often the simple stuff trips me up.


> Note that I do think the idea you propose has some merit in general; 
> it's just that this particular use case is not a good use case for it.

It's my addenda that get my ideas in trouble.

The primary idea was that we should consider any calculation option for 
values being cumulative in some manner across all applicable rules, in 
order for calculated values for multiple classes and inheritance to 
become conceptually simplified, especially when coded by complex teams 
instead of single authors. It's not appropriate to simply merge the 
calculation of all applied rules through the cascade and descending 
specificity, since the expectation is likely that the rules should be 
grouped more akin to their order in the stylesheet, like:

	((((2px) +4px) *2) *25%) = 3px

....and not:

	2px +4px *2 *25% = 4px

The scripted benefit was ancillary, and as you pointed out, extraneous.

As a side note, is it appropriate to discuss script-applied styles on 
this list?

-- 

    Ben Curtis : webwright
    bivia : a personal web studio
    http://www.bivia.com/
    v : 818 507 6613

Received on Sunday, 15 May 2005 19:04:15 UTC