Re: [CSS-X] style sets and style systems isolation

----- Original Message ----- 
From: "David Woolley" <david@djwhome.demon.co.uk>
To: <www-style@w3.org>
Sent: Sunday, February 11, 2007 6:21 AM
Subject: Re: [CSS-X] style sets and style systems isolation


>
>>    style-set: "std-calendar"; /* name of style set above */
>
> This looks like just another variant of the rendering time variables
> in CSS frequently requested proposal.

Sorry, I don't understand this. What are these "time variables"?
I do know that web is full by calendar control implementations.
The only difference is in their stylings - style should match design of the
site. Try google: "calendar control HTML"

>
>> #myblog .right-sidebar input[type="calendar"]
>
> If you are using inconsistent styling for different calendars on the
> same page, you should probably use id on each calendar.  If you are using
> consistent styling, simply prefixing each rule with input[type="calendar"]
> seems to me to be sufficient.

Say you have calendar control used inside some blog article.
Blog has its own system of styles for the content area:

#blog-content h1 {....}
#blog-content td {....}

Such declarations will match content of such calendar too.
So if I want my calendars (read components) to be consistent
I need to redefine the same style sets for different selectors.
Otherwise if I want to define their styles only once I need to use
some tricks to increase weight of selectors used.
This is not desirable - simply bad in many senses.
Think about use of "second party" component libraries.
Current situation is far from term "scalable" at least.

Probably microformats (as any other component framework)
will benefit of this too.

>
>> One style set can be derived from another one:
>>
>> @set my-calendar < std-calendar
>
> This looks like you are trying to provide an alternative mechanism
> for cascading.
>

This is complementary to cascading. Styles inside style set are cascaded 
using
current set of rules. Assignment of style set is also "cascadable".

Another benefit of this approach - it significantly reduces style resolving
complexity.

Think about about following

#blog-content td {....}
#my-sidebar input[type="calendar"]  td {....}
#my-calendar input[type="calendar"] td {....}

So we have number of rules M (=3)

Say you have two tables (N=2) on the page and D is an average depth
of elements in the DOM on the page. In this case computational
complexity of style resolving is near O(N*M*D).
Such formula of complexity is extremely bad - add twice more elements
and styles (or change D factor)  and number of operations quadruples.
So it should be some mechanism that allows to change that exponential 
function.

Andrew Fedoniouk.
http://terrainformatica.com 

Received on Sunday, 11 February 2007 22:05:27 UTC