I leave it up to you to try actually adding some defaults and see if  
this actually works!

> attributes.bgcolor = new LzStyleConstraintExpr('bgcolor',  
> 'background-color', 'color', null)';

On 2009-10-07, at 23:09, Max Carlson wrote:

> Approved!  This is good stuff!
>
> P T Withington wrote:
>> Change 20091007-ptw-x by [email protected] on 2009-10-07 17:38:08 EDT
>>    in /Users/ptw/OpenLaszlo/trunk-2
>>    for http://svn.openlaszlo.org/openlaszlo/trunk
>> Summary: Implement a simple mechanism for constant style bindings
>> New Features:
>>    With this change, it should be possible to define default style
>>    bindings for LFC classes by saying (for example):
>>    attributes.bgcolor = new LzStyleConstraintExpr('bgcolor',  
>> 'background-color', 'color', null)';
>>    Which says that the `bgcolor` attribute will be styled by the CSS
>>    `background-color` property, that the attribute is of type `color`
>>    and that the default, if there is no CSS style, is `null`.
>>    Instances and subclasses can override this style binding using the
>>    normal mechanisms.
>> Bugs Fixed:
>> Technical Reviewer: max (pending)
>> QA Reviewer: hminsky (pending)
>> Doc Reviewer: (pending)
>> Details:
>>    Create a simpler mechanism for style bindings that have constant
>>    CSS property names.  A new subclass of constraint-expr is used to
>>    encode this and is applied specially by applyConstraint.  This
>>    eliminates the need to create a separate binding method for every
>>    styled attribute in a class.
>> Tests:
>>    test/style/metasuite has the same 2 errors as before
>>    Inspecting the output of the compiler shows a savings of about 12%
>>    in the DHTML case.
>> Files:
>> M      WEB-INF/lps/lfc/services/LzCSSStyle.lzs
>> M      WEB-INF/lps/lfc/core/LzNode.lzs
>> M      WEB-INF/lps/lfc/core/LzDefs.lzs
>> M      WEB-INF/lps/server/src/org/openlaszlo/compiler/NodeModel.java
>> Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20091007-ptw-x.tar
>
> -- 
> Regards,
> Max Carlson
> OpenLaszlo.org

_______________________________________________
Laszlo-reviews mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-reviews

Reply via email to