[Laszlo-dev] For Review: Change 20090421-ptw-J Summary: Make constraints idempotent

André Bargull andre.bargull at udo.edu
Wed Apr 22 11:02:54 PDT 2009


In LzDataAttrBind:
> if (node.visibility = 'collapse') {
Little typo here.

> +        // NOTE: [2009-04-16 ptw] Not sure why there is any test other
> +        // than 'will the value change?', but I left them for
> +        // compatibility.
> +        if (this.__LZpchanged || (node[ attr ] !== newvalue) || 
> (this.parsedPath.operator == "attributes")) {
The "parsedPath.operator" test is necessary if the $path is constrained 
to the data-node's attributes (xpath @*), because you can't use a simple 
identity test in that case.


Otherwise approved.


On 4/21/2009 11:35 PM, P T Withington wrote:
> Change 20090421-ptw-J by ptw at dueling-banjos.home on 2009-04-21 
> 16:17:33 EDT
>     in /Users/ptw/OpenLaszlo/trunk-3
>     for http://svn.openlaszlo.org/openlaszlo/trunk
>
> Summary: Make constraints idempotent
>
> Bugs Fixed: LPP-8058  Constraints should short-circuit if the value 
> would not change
>
> Technical Reviewer: a.bargull at intensis.de (pending)
> QA Reviewer: mdemmon (pending)
>
> Release Notes:
>     This change makes it an error to constrain an attribute to `void
>     0` (undefined).
>
> Details:
>     LzNode: Ensure attributes with setters or constraints are created
>     in the instance for JS1 runtimes (for implicit this), but have
>     `void 0` as their value, not `null`, to ensure constraints are
>     executed at least once.
>
>     LzStyleAttrBinder, LzDataAttrBind, NodeModel: Add a test to
>     $always, $path, and $style constraints that looks to see if the
>     attribute being constrained already has the value that will be
>     set.  If it does, don't set it again.  This should improve the
>     performance of most applications because it will prevent pointless
>     event cascades.  (Cf., LPP-7452 which required that `setAttribute`
>     _not_ make this optimization.)
>
> Tests:
>     {smokecheck, component sampler, amazon, calendar} x {swf8, dhtml,
>     swf9} x { , debug}
>
> Files:
> M      WEB-INF/lps/lfc/core/LzNode.lzs
> M      WEB-INF/lps/lfc/core/LzStyleAttrBinder.lzs
> M      WEB-INF/lps/lfc/data/LzDataAttrBind.lzs
> M      WEB-INF/lps/server/src/org/openlaszlo/compiler/NodeModel.java
>
>
> Changeset: 
> http://svn.openlaszlo.org/openlaszlo/patches/20090421-ptw-J.tar
>


More information about the Laszlo-dev mailing list