[Project_owners] Re: methods and fields in XBL bindings

Philip Chee philip.chee at gmail.com
Fri Aug 19 02:57:43 EDT 2005


On Sun, 01 May 2005 01:18:39 +0800, Philip Chee wrote:

> Flashbock uses userContent.css to bind flash objects to our XBL.
> We are trying to refactor the XBL but are running into several errors.
> However the errors don't ALWAYS occur, only about 50% of the time.

Is it possible that I am running into this mozilla bug?
<https://bugzilla.mozilla.org/show_bug.cgi?id=293065>
"XBL doesn't bind its methods"

"A lot of XBL assumes that |this| will be the bound node.  Since XBL doesn't
actually use JSFUN_BOUND_METHOD, this is not guaranteed."

Is there a workaround?

> In our test XBL we have the following:
> 
> <binding id="flash">
>   <implementation>
>     <field name="test">
>       "test"
>     </field>
>     <method name="block">
>       <parameter name="type" />
>       <body>
>         <![CDATA[
> //...some code to do our bit.
>         ]]>
>       </body>
>     </method>
> 
>     <constructor>
>         this.block("flash");
>     </constructor>
>   </implementation>
> </binding>
> 
> The JS error we get is "this.block is not a function", however putting some
> alert boxes I find that SOMETIMES it's undefined, sometimes it works as
> expected.  Similarly the "test" field is sometimes undefined and sometimes
> returns the expected value.  What am I doing wrong?
> 
> Phil
> 

Phil
-==-
Philip Chee <philip at aleytys.pc.my>, <philip.chee at gmail.com>
http://fashblock.mozdev.org/
Guard us from the she-wolf and the wolf, and guard us from the thief,
oh Night, and so be good for us to pass.
[ ]"Imagination is more important than knowledge" - Einstein
* TagZilla 0.059


More information about the Project_owners mailing list