Ok, this is a good start, but there's some shortcuts that you are taking that 
break dynamic compound rules.

I attached a more complex test case to the bug that shows the issue.  
Basically, I should be able to write a compound rule that depends on several 
attributes and have the node know each of the node and attributes that the rule 
depends on for re-applying its style, so you can't just return 1 node from 
compound rules.  And, you really can't gather rules that don't apply into the 
rule cache, because there is not enough information to decide an property cache 
time whether a compound rule applies.

I think it's easiest if I just try to tweak what you have started here to be a 
little more conservative and get my test case working.  If it turns out that my 
simpler version has really poor performance, we can try to tune it; but let's 
get it working first.

I'll send you a version to review once I get my test case working.

On 2010-04-23, at 13:21, Max Carlson wrote:

> Change 20100423-maxcarlson-Y by maxcarl...@friendly on 2010-04-23 09:33:57 PDT
>    in /Users/maxcarlson/openlaszlo/trunk-clean
>    for http://svn.openlaszlo.org/openlaszlo/trunk
> 
> Summary: Add support for dynamic CSS attribute bindings
> 
> Bugs Fixed: LPP-7359 - Make CSS attribute selectors dynamic
> 
> Technical Reviewer: ptw
> QA Reviewer: hminsky
> 
> Release Notes: CSS attribute selectors now automatically update when the 
> bound attribute changes, e.g. button[mouse=down] will listen for changes to 
> the 'mouse' attribute and will only apply when button.mouse == down.
> 
> Details: LzCSSStyle - Allow getPropertyCache() lookups on the canvas.  Track 
> CSS attributes that could change and need updating.  Move attribute value 
> tests from getRulesCache() to getPropertyCache().  getRulesCache() builds 
> separate list of attribute bindings, adding attribute rules if the node has a 
> non-null value for the attribute.  Add a reference to the node to the rule 
> for attribute selectors bound to parent nodes.  Call 
> LzNode.__applyCSSConstraints() to build constraints to listen for LZX 
> attribute updates.  
> 
> LzNode - Track dynamic CSS properties to be updated, CSS property -> 
> attribute name and type.  __applyCSSConstraints() expects a list of attribute 
> rules and registers/unregisters for updates.  __reapplyCSS() is called by 
> attribute selector dependencies.  __LZstyleBindAttribute() updates  CSS 
> property -> attribute  name and type mappings for use by __reapplyCSS().
> 
> Tests: See LPP-7359, testtest/style/metasuite.lzx?debug=true, smokecheck 
> across runtimes
> 
> Files:
> M       WEB-INF/lps/lfc/services/LzCSSStyle.lzs
> M       WEB-INF/lps/lfc/core/LzNode.lzs
> 
> Changeset: 
> http://svn.openlaszlo.org/openlaszlo/patches/20100423-maxcarlson-Y.tar
> 


Reply via email to