gnash-dev
[Top][All Lists]
Advanced

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

Re: [Gnash-dev] youtube bugs for release


From: Michael Fötsch
Subject: Re: [Gnash-dev] youtube bugs for release
Date: Sat, 28 Feb 2009 16:31:27 +0100
User-agent: Thunderbird 2.0.0.19 (X11/20090105)

John Gilmore wrote:
The trunk (as of a few days ago) still has serious bugs with Youtube's
embedded player, the largest of which is that it floats a big "play
button" in the middle of the video window for the entire time the
video is playing (obscuring the video).

I think I found the cause. It's in the way Gnash handles "super.method()" when the derived method is invoked via "method.apply(this)" and not via "this.method()". This breaks YouTube's event handling code.

In short:

  class Base {
    function method()   {
        // this is never called
    }
  }
  class Derived extends Base {
    function method()   {
        super.method();
    }
  }
  var d = new Derived();
  var m = d.method;
  m.apply(d);


I am attaching a patch for an existing Gnash test case that works with Flash 10 and fails with Gnash.

My Gnash knowledge is still limited, so I couldn't yet figure out what's going on in the code. If I can, I'll be happy to help debug this further, so please let me know what I can do.

Kind Regards,
M.F.
=== modified file 'testsuite/misc-mtasc.all/Base1.as'
--- testsuite/misc-mtasc.all/Base1.as   2007-10-10 08:13:55 +0000
+++ testsuite/misc-mtasc.all/Base1.as   2009-02-28 15:06:38 +0000
@@ -3,6 +3,8 @@
 {
   var baseCtorCalled;
   var baseThisPtr;
+  var baseDirectCalled;
+  var baseViaApplyCalled;
   
   // constructor
   function Base1()
@@ -10,4 +12,15 @@
     this.baseCtorCalled = true;
     baseThisPtr = this;
   }
+
+  function direct()
+  {
+    this.baseDirectCalled = true;
+  }
+
+  function viaApply()
+  {
+    this.baseViaApplyCalled = true;
+  }
 }
+

=== modified file 'testsuite/misc-mtasc.all/Derived1.as'
--- testsuite/misc-mtasc.all/Derived1.as        2007-10-10 08:13:55 +0000
+++ testsuite/misc-mtasc.all/Derived1.as        2009-02-28 15:07:00 +0000
@@ -5,6 +5,8 @@
 {
   var derived1CtorCalled;
   var derivedThisPtr;
+  var derived1DirectCalled;
+  var derived1ViaApplyCalled;
   
   // constructor
   function Derived1()
@@ -13,4 +15,16 @@
     this.derived1CtorCalled = true;
     derivedThisPtr = this;
   }
+
+  function direct()
+  {
+    super.direct();
+    this.derived1DirectCalled = true;
+  }
+
+  function viaApply()
+  {
+    super.viaApply();
+    this.derived1ViaApplyCalled = true;
+  }
 }

=== modified file 'testsuite/misc-mtasc.all/super_test1.as'
--- testsuite/misc-mtasc.all/super_test1.as     2007-11-29 08:44:11 +0000
+++ testsuite/misc-mtasc.all/super_test1.as     2009-02-28 15:10:25 +0000
@@ -29,6 +29,8 @@
 {
   var derived11CtorCalled;
   var thisPtr;
+  var derived11DirectCalled;
+  var derived11ViaApplyCalled;
   
   // constructor
   function Derived11()
@@ -38,6 +40,18 @@
     thisPtr = this;
   }
 
+  function direct()
+  {
+    super.direct();
+    this.derived11DirectCalled = true;
+  }
+
+  function viaApply()
+  {
+    super.viaApply();
+    this.derived11ViaApplyCalled = true;
+  }
+
   static function main()
   {
      // Gnash got an unexpected 'ActionLimit hit' here.
@@ -47,13 +61,27 @@
      check_equals(derivedObj.baseCtorCalled, true);
      check_equals(derivedObj.derived1CtorCalled, true);
      check_equals(derivedObj.derived11CtorCalled, true);
+ 
+     // check that all "super.method()" in the inheritance chain are called.   
 
+     derivedObj.direct();
+     check_equals(derivedObj.baseDirectCalled, true);
+     check_equals(derivedObj.derived1DirectCalled, true);
+     check_equals(derivedObj.derived11DirectCalled, true);
+     
+     // check that all "super.method()" in the inheritance chain are called
+     // when "apply()" is used to call the derived method.
+     var method = derivedObj.viaApply;
+     method.apply(derivedObj);
+     check_equals(derivedObj.baseViaApplyCalled, true);
+     check_equals(derivedObj.derived1ViaApplyCalled, true);
+     check_equals(derivedObj.derived11ViaApplyCalled, true);
      
      // check this pointers. 
      check_equals(derivedObj.thisPtr, derivedObj);
      check_equals(derivedObj.derivedThisPtr, derivedObj);
      check_equals(derivedObj.baseThisPtr, derivedObj);
 
-     check_totals(6);
+     check_totals(12);
      Dejagnu.done();
   }
 }


reply via email to

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