OK this sounds like a promising approach. <br><br><br><br><br><div class="gmail_quote">On Wed, Oct 7, 2009 at 11:50 AM, P T Withington <span dir="ltr">&lt;<a href="mailto:ptw@pobox.com">ptw@pobox.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im"><br></div>
See my reply to myself about a better approach, where you will see that despite the $style bindings being classified as &#39;constraints&#39; they do not actually install any delegates (unless the CSS itself specifies a constraint, as in, the `attr()` value, which ties one CSS value to another), they are just evaluated at initialization time. Also, in the revised implementation, we have a &#39;fallback&#39; or &#39;default-default&#39;, where if there is no CSS property found, you install that default instead.  I guess you could consider that fallback to specify the default LFC stylesheet, but I don&#39;t think we have to actually implement any such thing.<br>


<br>
Also, the idea is that these are defaults that will be overridden by subclasses and instances.  Only if the subclasses and instances do not specify values will these defaults be consulted.  But, yes, if we go crazy and make every possible attribute CSS styleable, there will be an increase in the instantiation time of a view, so we should be judicious about what we make styleable in this way.<br>


<br>
The goal here is that we think users expect to be able to use CSS to style their applications, but because we don&#39;t have any default bindings for &lt;view&gt; attributes, the user has to do this all by hand.  This way, there will be default bindings all set up and they can just add a stylesheet.<br>


<br>
We should obviously evaluate the overhead of this change.  There are already some pretty good caches that optimize the CSS lookup, but perhaps we can make a further optimization that creates a cache on the class to avoid re-looking up (non-existen) default CSS bindings for each instance of the class.<br>


<br>
Finally, someday we _will_ have to have at least one more delegate for each instance that has CSS style bindings so that we can implement dynamic CSS styles.  I.e., when the user wants to change a stylesheet dynamically and see the change propagate to all the views with attributes bound to the changed style.  We&#39;d need at least one delegate to re-evaluate the style bindings when the style sheets change.<br>


<br>
</blockquote></div><br><br clear="all"><br>-- <br>Henry Minsky<br>Software Architect<br><a href="mailto:hminsky@laszlosystems.com">hminsky@laszlosystems.com</a><br><br><br>