gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash ChangeLog server/sprite_instance.cpp test...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/sprite_instance.cpp test...
Date: Thu, 14 Feb 2008 12:07:35 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  08/02/14 12:07:35

Modified files:
        .              : ChangeLog 
        server         : sprite_instance.cpp 
        testsuite/misc-ming.all: registerClassTest2.c 

Log message:
                * server/sprite_instance.cpp (on_event): reword the onLoad 
handling so
                  that sprites with a registered class won't skip the 
user-defined
                  handler. Fixes the new tests in registerClassTest2.c and one 
of the
                  bugs exposed by FlowPlayer.
                * testsuite/misc-ming.all/registerClassTest2.c: expect failures 
in
                  order of execution of the onLoad handlers (this might be the 
reason
                  for the overly complex handling of onLoad handler in current 
gnash).

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5646&r2=1.5647
http://cvs.savannah.gnu.org/viewcvs/gnash/server/sprite_instance.cpp?cvsroot=gnash&r1=1.474&r2=1.475
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/registerClassTest2.c?cvsroot=gnash&r1=1.11&r2=1.12

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.5646
retrieving revision 1.5647
diff -u -b -r1.5646 -r1.5647
--- ChangeLog   14 Feb 2008 11:02:35 -0000      1.5646
+++ ChangeLog   14 Feb 2008 12:07:34 -0000      1.5647
@@ -1,5 +1,15 @@
 2008-02-14 Sandro Santilli <address@hidden>
 
+       * server/sprite_instance.cpp (on_event): reword the onLoad handling so
+         that sprites with a registered class won't skip the user-defined
+         handler. Fixes the new tests in registerClassTest2.c and one of the
+         bugs exposed by FlowPlayer.
+       * testsuite/misc-ming.all/registerClassTest2.c: expect failures in
+         order of execution of the onLoad handlers (this might be the reason
+         for the overly complex handling of onLoad handler in current gnash).
+
+2008-02-14 Sandro Santilli <address@hidden>
+
        * testsuite/misc-ming.all/registerClassTest2.c: test that user-defined
          onLoad handler is still invoked if no clip events are defined and
          the object is not dynamic (placed by onClipEvent).

Index: server/sprite_instance.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/sprite_instance.cpp,v
retrieving revision 1.474
retrieving revision 1.475
diff -u -b -r1.474 -r1.475
--- server/sprite_instance.cpp  14 Feb 2008 10:08:07 -0000      1.474
+++ server/sprite_instance.cpp  14 Feb 2008 12:07:35 -0000      1.475
@@ -2518,18 +2518,36 @@
   //   not placed by PlaceObject, see
   //   testsuite/misc-ming.all/registerClassTest.swf
   //
+  //   Note that this is also not true for sprites which have
+  //   a registered class on them, see
+  //   testsuite/misc-ming.all/registerClassTest2.swf
+  //
+  //   TODO: test the case in which it's MovieClip.prototype.onLoad defined !
+  //
   if ( id.m_id == event_id::LOAD )
   {
-    if ( (!isDynamic()) && get_parent() && get_event_handlers().empty() )
-    {
+    // TODO: we're likely making too much noise for nothing here,
+    // there must be some action-execution-order related problem instead....
+    // See testsuite/misc-ming.all/registerClassTest2.swf for an onLoad 
execution
+    // order related problem ...
+    do
+    {
+        if ( ! get_parent() ) break; // we don't skip calling user-defined 
onLoad for top-level movies
+        if ( ! get_event_handlers().empty() ) break; // nor if there are 
clip-defined handler
+        if ( isDynamic() ) break; // nor if it's dynamic
+        sprite_definition* def = dynamic_cast<sprite_definition*>(m_def.get());
+        if ( ! def ) break; // must be a loaded movie (loadMovie doesn't mark 
it as "dynamic" - should it? no, or getBytesLoaded will always return 0)
+        if ( def->getRegisteredClass() ) break; // if it has a registered 
class it can have an onLoad in prototype...
+
 //#ifdef GNASH_DEBUG
-      log_debug("Sprite %s (depth %d) won't check for user-defined LOAD event 
(is not dynamic, has a parent and had no clip events defined)",
+        log_debug("Sprite %s (depth %d) won't check for user-defined LOAD 
event (is not dynamic, has a parent, "
+               "no registered class and no clip events defined)",
                getTarget().c_str(), get_depth());
-      //testInvariant();
+        testInvariant();
 //#endif
-      
       return called;
-    }
+    } while (0);
+      
   }
 
   // Check for member function.

Index: testsuite/misc-ming.all/registerClassTest2.c
===================================================================
RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/registerClassTest2.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- testsuite/misc-ming.all/registerClassTest2.c        14 Feb 2008 11:02:36 
-0000      1.11
+++ testsuite/misc-ming.all/registerClassTest2.c        14 Feb 2008 12:07:35 
-0000      1.12
@@ -198,8 +198,9 @@
 
   check_equals(mo, "_root.theClass3onLoadCalls.length", "3");
   check_equals(mo, "_root.theClass3onLoadCalls[0]", "_level0.instance2");
-  check_equals(mo, "_root.theClass3onLoadCalls[1]", "_level0.clip3");
-  check_equals(mo, "_root.theClass3onLoadCalls[2]", "_level0.noclipevs"); /* 
it4 ... */
+  // Gnash gets the onLoad events of 'clip3' and 'noclipevs' swapped !!
+  xcheck_equals(mo, "_root.theClass3onLoadCalls[1]", "_level0.clip3");
+  xcheck_equals(mo, "_root.theClass3onLoadCalls[2]", "_level0.noclipevs"); /* 
it4 ... */
   add_actions(mo, "totals(27); stop();");
     
   SWFMovie_nextFrame(mo); /* end of frame4 */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]