History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: LPP-5337
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: P0 P0
Assignee: Unassigned
Reporter: Maynard Demmon
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
OpenLaszlo

Multiframe resource assigned via $style within a view that is init stage late runs a bit and gets orphaned in onidle

Created: 07/Jan/08 07:52 PM   Updated: 21/Jan/08 12:36 PM
Component/s: LFC - Animation, LFC - CSS
Affects Version/s: Eskimo Pie (4.0.8), RingDing (4.1)
Fix Version/s: RingDing (4.1)

Time Tracking:
Not Specified

File Attachments: 1. Zip Archive test.zip (1 kb)


Severity: Major
Fixed in Change#: 7,786
Runtime: N/A
Fix in hand: False


 Description  « Hide
When a view has a multiframe resource assigned to it via $style it within a view that is init stage late a delegate for updatePlayStatus gets left in LzIdle.onidle.

The following test case demonstrates the problem.


<canvas>
    <resource name="SPINNER_RSRC" src="./spinner.swf" />
    <stylesheet>
        view [name="bar0"] {bigspinnerresource: "SPINNER_RSRC";}
        view [name="bar1"] {bigspinnerresource: "SPINNER_RSRC";}
        view [name="bar2"] {bigspinnerresource: "SPINNER_RSRC";}
        view [name="bar3"] {bigspinnerresource: "SPINNER_RSRC";}
        view [name="bar4"] {bigspinnerresource: "SPINNER_RSRC";}
        view [name="bar5"] {bigspinnerresource: "SPINNER_RSRC";}
        view [name="bar6"] {bigspinnerresource: "SPINNER_RSRC";}
        view [name="bar7"] {bigspinnerresource: "SPINNER_RSRC";}
        view [name="bar8"] {bigspinnerresource: "SPINNER_RSRC";}
        view [name="bar9"] {bigspinnerresource: "SPINNER_RSRC";}
        
        view [name="baz0"] {bigspinnerresource: "SPINNER_RSRC";}
        view [name="baz1"] {bigspinnerresource: "SPINNER_RSRC";}
        view [name="baz2"] {bigspinnerresource: "SPINNER_RSRC";}
        view [name="baz3"] {bigspinnerresource: "SPINNER_RSRC";}
        view [name="baz4"] {bigspinnerresource: "SPINNER_RSRC";}
        view [name="baz5"] {bigspinnerresource: "SPINNER_RSRC";}
        view [name="baz6"] {bigspinnerresource: "SPINNER_RSRC";}
        view [name="baz7"] {bigspinnerresource: "SPINNER_RSRC";}
        view [name="baz8"] {bigspinnerresource: "SPINNER_RSRC";}
        view [name="baz9"] {bigspinnerresource: "SPINNER_RSRC";}
        
        view [name="qux0"] {bigspinnerresource: "SPINNER_RSRC";}
        view [name="qux1"] {bigspinnerresource: "SPINNER_RSRC";}
        view [name="qux2"] {bigspinnerresource: "SPINNER_RSRC";}
        view [name="qux3"] {bigspinnerresource: "SPINNER_RSRC";}
        view [name="qux4"] {bigspinnerresource: "SPINNER_RSRC";}
        view [name="qux5"] {bigspinnerresource: "SPINNER_RSRC";}
        view [name="qux6"] {bigspinnerresource: "SPINNER_RSRC";}
        view [name="qux7"] {bigspinnerresource: "SPINNER_RSRC";}
        view [name="qux8"] {bigspinnerresource: "SPINNER_RSRC";}
        view [name="qux9"] {bigspinnerresource: "SPINNER_RSRC";}
        
        view [name="quux0"] {bigspinnerresource: "SPINNER_RSRC";}
        view [name="quux1"] {bigspinnerresource: "SPINNER_RSRC";}
        view [name="quux2"] {bigspinnerresource: "SPINNER_RSRC";}
        view [name="quux3"] {bigspinnerresource: "SPINNER_RSRC";}
        view [name="quux4"] {bigspinnerresource: "SPINNER_RSRC";}
        view [name="quux5"] {bigspinnerresource: "SPINNER_RSRC";}
        view [name="quux6"] {bigspinnerresource: "SPINNER_RSRC";}
        view [name="quux7"] {bigspinnerresource: "SPINNER_RSRC";}
        view [name="quux8"] {bigspinnerresource: "SPINNER_RSRC";}
        view [name="quux9"] {bigspinnerresource: "SPINNER_RSRC";}
    </stylesheet>
    
    <simplelayout axis="x"/>
    
    <!-- This section is a work around using runtime resource assignment. -->
    <view initstage="late">
        <simplelayout axis="y"/>
        <view name="foo0"><method event="oninit">this.setResource("SPINNER_RSRC"); this.stop();</method></view>
        <view name="foo1"><method event="oninit">this.setResource("SPINNER_RSRC"); this.stop();</method></view>
        <view name="foo2"><method event="oninit">this.setResource("SPINNER_RSRC"); this.stop();</method></view>
        <view name="foo3"><method event="oninit">this.setResource("SPINNER_RSRC"); this.stop();</method></view>
        <view name="foo4"><method event="oninit">this.setResource("SPINNER_RSRC"); this.stop();</method></view>
        <view name="foo5"><method event="oninit">this.setResource("SPINNER_RSRC"); this.stop();</method></view>
        <view name="foo6"><method event="oninit">this.setResource("SPINNER_RSRC"); this.stop();</method></view>
        <view name="foo7"><method event="oninit">this.setResource("SPINNER_RSRC"); this.stop();</method></view>
        <view name="foo8"><method event="oninit">this.setResource("SPINNER_RSRC"); this.stop();</method></view>
        <view name="foo9"><method event="oninit">this.setResource("SPINNER_RSRC"); this.stop();</method></view>
    </view>
    
    <!-- This shows the problem not happening because the parent view is not initstage late. -->
    <view>
        <simplelayout axis="y"/>
        <view name="qux0" resource="$style{'bigspinnerresource'}"><method event="oninit">this.stop();</method></view>
        <view name="qux1" resource="$style{'bigspinnerresource'}"><method event="oninit">this.stop();</method></view>
        <view name="qux2" resource="$style{'bigspinnerresource'}"><method event="oninit">this.stop();</method></view>
        <view name="qux3" resource="$style{'bigspinnerresource'}"><method event="oninit">this.stop();</method></view>
        <view name="qux4" resource="$style{'bigspinnerresource'}"><method event="oninit">this.stop();</method></view>
        <view name="qux5" resource="$style{'bigspinnerresource'}"><method event="oninit">this.stop();</method></view>
        <view name="qux6" resource="$style{'bigspinnerresource'}"><method event="oninit">this.stop();</method></view>
        <view name="qux7" resource="$style{'bigspinnerresource'}"><method event="oninit">this.stop();</method></view>
        <view name="qux8" resource="$style{'bigspinnerresource'}"><method event="oninit">this.stop();</method></view>
        <view name="qux9" resource="$style{'bigspinnerresource'}"><method event="oninit">this.stop();</method></view>
    </view>
    
    <!-- This shows the problem not happening because the parent view is not initstage late. Using ${false} to work around a problem with the play attr. -->
    <view>
        <simplelayout axis="y"/>
        <view name="quux0" play="${false}" resource="$style{'bigspinnerresource'}"/>
        <view name="quux1" play="${false}" resource="$style{'bigspinnerresource'}"/>
        <view name="quux2" play="${false}" resource="$style{'bigspinnerresource'}"/>
        <view name="quux3" play="${false}" resource="$style{'bigspinnerresource'}"/>
        <view name="quux4" play="${false}" resource="$style{'bigspinnerresource'}"/>
        <view name="quux5" play="${false}" resource="$style{'bigspinnerresource'}"/>
        <view name="quux6" play="${false}" resource="$style{'bigspinnerresource'}"/>
        <view name="quux7" play="${false}" resource="$style{'bigspinnerresource'}"/>
        <view name="quux8" play="${false}" resource="$style{'bigspinnerresource'}"/>
        <view name="quux9" play="${false}" resource="$style{'bigspinnerresource'}"/>
    </view>
    
    <!-- This section shows the work around again without initstage late just to make sure it works. -->
    <view>
        <simplelayout axis="y"/>
        <view name="corge0"><method event="oninit">this.setResource("SPINNER_RSRC"); this.stop();</method></view>
        <view name="corge1"><method event="oninit">this.setResource("SPINNER_RSRC"); this.stop();</method></view>
        <view name="corge2"><method event="oninit">this.setResource("SPINNER_RSRC"); this.stop();</method></view>
        <view name="corge3"><method event="oninit">this.setResource("SPINNER_RSRC"); this.stop();</method></view>
        <view name="corge4"><method event="oninit">this.setResource("SPINNER_RSRC"); this.stop();</method></view>
        <view name="corge5"><method event="oninit">this.setResource("SPINNER_RSRC"); this.stop();</method></view>
        <view name="corge6"><method event="oninit">this.setResource("SPINNER_RSRC"); this.stop();</method></view>
        <view name="corge7"><method event="oninit">this.setResource("SPINNER_RSRC"); this.stop();</method></view>
        <view name="corge8"><method event="oninit">this.setResource("SPINNER_RSRC"); this.stop();</method></view>
        <view name="corge9"><method event="oninit">this.setResource("SPINNER_RSRC"); this.stop();</method></view>
    </view>
    
    <!-- This shows the problem happening because the parent view is initstage late. -->
    <view initstage="late">
        <simplelayout axis="y"/>
        <view name="bar0" resource="$style{'bigspinnerresource'}"><method event="oninit">this.stop();</method></view>
        <view name="bar1" resource="$style{'bigspinnerresource'}"><method event="oninit">this.stop();</method></view>
        <view name="bar2" resource="$style{'bigspinnerresource'}"><method event="oninit">this.stop();</method></view>
        <view name="bar3" resource="$style{'bigspinnerresource'}"><method event="oninit">this.stop();</method></view>
        <view name="bar4" resource="$style{'bigspinnerresource'}"><method event="oninit">this.stop();</method></view>
        <view name="bar5" resource="$style{'bigspinnerresource'}"><method event="oninit">this.stop();</method></view>
        <view name="bar6" resource="$style{'bigspinnerresource'}"><method event="oninit">this.stop();</method></view>
        <view name="bar7" resource="$style{'bigspinnerresource'}"><method event="oninit">this.stop();</method></view>
        <view name="bar8" resource="$style{'bigspinnerresource'}"><method event="oninit">this.stop();</method></view>
        <view name="bar9" resource="$style{'bigspinnerresource'}"><method event="oninit">this.stop();</method></view>
    </view>
    
    <!-- This shows the problem happening because the parent view is initstage late. also uses the play attr work around. -->
    <view initstage="late">
        <simplelayout axis="y"/>
        <view name="baz0" play="${false}" resource="$style{'bigspinnerresource'}"/>
        <view name="baz1" play="${false}" resource="$style{'bigspinnerresource'}"/>
        <view name="baz2" play="${false}" resource="$style{'bigspinnerresource'}"/>
        <view name="baz3" play="${false}" resource="$style{'bigspinnerresource'}"/>
        <view name="baz4" play="${false}" resource="$style{'bigspinnerresource'}"/>
        <view name="baz5" play="${false}" resource="$style{'bigspinnerresource'}"/>
        <view name="baz6" play="${false}" resource="$style{'bigspinnerresource'}"/>
        <view name="baz7" play="${false}" resource="$style{'bigspinnerresource'}"/>
        <view name="baz8" play="${false}" resource="$style{'bigspinnerresource'}"/>
        <view name="baz9" play="${false}" resource="$style{'bigspinnerresource'}"/>
    </view>
</canvas>

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Maynard Demmon - 07/Jan/08 07:53 PM
The testcase with a test animation.

Maynard Demmon - 07/Jan/08 07:55 PM
In the test case I had to repeat things quite a bit since if the app is small it is hard to reproduce the problem.

To verify the problem has occured inspect the delegate list in LzIdle.onidle using the debugger. Also, you'll see some of that some of the views have animated a few frames even though they are visually stopped.

P T Withington - 08/Jan/08 02:54 PM
I think I have a fix for this issue. It has to do with the 'stop' call happening before the initial checkPlayStatus has run.

P T Withington - 09/Jan/08 09:01 AM
Moving fix to Ringding per sallen message://4784117F.3080808@laszlosystems.com

> Since the problems are not bad as initially reported and/or are intermittent, I'm down-grading to a P2.


P T Withington - 09/Jan/08 09:23 AM
r7786 | ptw | 2008-01-09 12:22:19 -0500 (Wed, 09 Jan 2008) | 21 lines
Changed paths:
   M /openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzSprite.as

Change 20080109-ptw-G by ptw@dueling-banjos.local on 2008-01-09 12:11:23 EST
    in /Users/ptw/OpenLaszlo/ringding-clean
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Fixing a hole where the rain gets in

Bugs Fixed:
LPP-5337 'Multiframe resource assigned via $style within a view that is init stage late runs a bit and gets orphaned in onidle'

Technical Reviewer: max (message://<47844FEA.3000208@openlaszlo.org>)
QA Reviewer: mdemmon (pending)

Details:
    Consider the case where tracking is stopped before checkPlayStatus
    gets to run: Instead of using callOnIdle, which cannot be
    cancelled, register on onidle, so you can be cancelled.

Tests:
    Test case from bug no longer leaves delegates on idle queue


Mamye Kratt - 21/Jan/08 12:36 PM
(trunk 4 local build r7775)
Closing