Change 20090924-maxcarlson-T by [email protected] on 2009-09-24 08:57:17 PDT in /Users/maxcarlson/openlaszlo/trunk-clean for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Second attempt at compiling style attribute for <attribute/> Bugs Fixed: LPP-7357 - Simple mechanism for making <attribute>s CSS styleable Technical Reviewer: ptw Details: I couldn't get contraint fallback values to work when the style doesn't match. I tried manually evaluating the once constraint but the other attribute wasn't declared yet - so I tried to install it in the list used by __LZresolveReferences()... It seems like it's just too early in the init phase to do this - we may need to add another phase or something. Also, the compiler still warns about the style attribute of the attribute declaration - I updated the schema, why should it be complaining? lzx.rnc - Add style attribute to attributeElement declaration LzNode.lzs - Add a fallback argument to __LZstyleBindAttribute() which is used to compute the value if the style lookup fails. Works for simple values, but not constraints. NodeModel.java - Add a fallbackexpression property and setter to CompiledAttribute. When computing the binder method for a style, include the fallback expression if it's been defined. In addAttributeElement() look for a style attribute. If one is found, it takes precedance over any existing value attribute - but the value is preserved as a fallbackexpression, and binder and dependancy methods are still installed. Tests: laszlo-explorer/constraints/css.lzx matched the correct style when the style attribute is set to something that matches, e.g. 'background-color'. If style is set to something that fails, the value attribute works for simple values, e.g. 'red' but fails for constraints. Files: M WEB-INF/lps/schema/lzx.rnc M WEB-INF/lps/lfc/core/LzNode.lzs M WEB-INF/lps/server/src/org/openlaszlo/compiler/NodeModel.java M laszlo-explorer/constraints/css.lzx Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20090924-maxcarlson-T.tar _______________________________________________ Laszlo-reviews mailing list [email protected] http://www.openlaszlo.org/mailman/listinfo/laszlo-reviews
