[Laszlo-dev] For Review: Change 20070111-ptw-j Summary: Refined event deferral

P T Withington ptw at pobox.com
Thu Jan 11 19:39:02 PST 2007


[Max, I was finally able to refine my debugging and I realized we  
were just deferring too broadly.  This change makes it so _only_  
events that would be sent to the node under initialization are  
deferred.  With this change, the components work again.  I still have  
the event debug printing on in this change, so be prepared for a lot  
of output if you test this change with debugging on.  You can comment  
the Debug.debug calls out of LaszloEvents if that is too noisy.]

Change 20070111-ptw-j by ptw at 191.154.150.10.in-addr.arpa on  
2007-01-11 19:12:09 PST
     in /Users/ptw/OpenLaszlo/legals-2

Summary: Refined event deferral

Bugs Fixed:
LPP-?: 'Legals branch and Broken Components'

Technical Reviewer: max (pending)
QA Reviewer: platform-team (pending)
Doc Reviewer: jsundman (pending)

Documentation:

     Events that would be sent to a node when the node is being
     constructed (typically events that would be triggered by
     initializing the attributes of the node) are deferred until the
     node's attributes are fully initialized.

Release Notes:

     This is a change from previous behavior, where the initialization
     of a node attribute could cause an event to be sent to the node
     when the node was partially initialized.  This was an
     underspecified area of the LZX language which lead to hazards in
     some runtimes.  This change should not affect the behavior of
     existing programs.

Details:

     LzDebug.*: Changed the behavior of __String so that if 'pretty'
     output is requested instance UID's are not printed, even for
     objects that have ambiguous representations.  By default '%w'
     requests pretty output.  You can use '%#w' to force uid's to be
     printed.

     LzFormat: Removed hazards where format tried to interpret the
     value to be displayed as a Number or String prematurely.

     LaszloCanvas, LzNode: For the purposes of testing this change, you
     can set the canvas attibute __LZhenryWasRight to true or false to
     enable or disable the deferral of events during node
     initialization.

     LzNode, LaszloEvents: Event deferral is refined in this change to
     _only_ defer events that would be sent to the node under
     initialization.  Previously, all events sent during a node's
     initialization would be deferred.  This meant that even nodes that
     were already initialized or standalone events were deferred, which
     appears to have been the cause of the lossage in components.

     LzNode: Also over-rode _dbg_typename so that node's will print  
in the
     debugger with their 'lz' package name.

     Class: Make the Instance method for _dbg_typename overridable

Tests:
     These components all work now:

     examples/components/combobox_example.lzx?lzr=dhtml
     examples/components/form_example.lzx?lzr=dhtml
     examples/components/list_example.lzx?lzr=dhtml
     examples/components/menu_example.lzx?lzr=dhtml

     This test (the original bug that sent us down this path) also
     works the same in swf and dhtml:

     <canvas width="600" height="600">
       <view id="vw" bgcolor="blue" width="100" height="100" >

         <handler name="onwidth" >
           this.setBGColor(0xFF0000)
         </handler>
       </view>
     </canvas>

Files:
M      WEB-INF/lps/lfc/debugger/platform/swf/LzDebug.as
M      WEB-INF/lps/lfc/debugger/platform/dhtml/LzDebug.js
M      WEB-INF/lps/lfc/debugger/LzFormat.lzs
M      WEB-INF/lps/lfc/core/LzNode.lzs
M      WEB-INF/lps/lfc/core/Class.lzs
M      WEB-INF/lps/lfc/views/LaszloCanvas.lzs
M      WEB-INF/lps/lfc/events/LaszloEvents.lzs


Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20070111-ptw- 
j.tar


More information about the Laszlo-dev mailing list