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

Re: [www-vrml] Re: [Vrspace-dev] Cortona createVrmlFromURL bug test code



Hi,

On Fri, 25 Mar 2005 20:54:46 +0100, Josip Almasi <joe@vrspace.org> wrote:
> Hi all,
> 
> crosspost, browser bugs.

First of all, it's not a _Cortona_ bug; it's even not a feature. It is
a _standard_ behavior.

> Rob Meyers wrote:
> > This fact that event doesn't raise for every assignment to addChildren
> > in boundaries of one frame (?) is not standards violation.
> >  >>> , , createVrmlFromUrl,        callback .
> > Scarcely it can disturb program's logic if we take into account that
> > processing time for  createVrmlFromUrl, and calling rules for callback
> > are not hardly defined.

Second, it's a bad (automatic?) translation from Russian.  That's what
I've wrote: "I can not see how it can break program logic, taking into
account that createVrmlFromUrl() completion time and callbacks calling
order are non-deterministic."

The problem arises when several calls to createVrmlFromUrl() where
completed in the same frame (see. ISO/IEC 14772-1, 3.33 frame).
Cortona then sends multiple addChildren events to the receiving node. 
Changes in the children field can fire one or more children_changed
events, but only one is sent out (see the last paragraph of `4.10.3
Execution model' and `4.12.9.3 Sending eventOuts').

> > Hah, hah, hah,  well you see, since the standard is vague we decided to
As you can see, the standard is absolutely clear. You just have to
become accustomed to read it.

> > choose a retarded method of implementing it, so therefore, its not a bug,
> > its a feature!!!   No competent software designer would consider random
> > callbacks to an asynchronous api call acceptable.   Come on now...

Well, explain me, as one competent software designer to other
competent software designer what for do you use callbacks if their
count is so important?

> Right, guess they had trouble implementing event model (thread safe) in C...

It is wrong guess.

And at last a simple example of events handling in different browsers.
Load the file in a browser, open a console, and click a sphere. You've
got one message in Cortona and Cosmo. Guess, how much do you get in
Contact?

#VRML V2.0 utf8

DEF G Group {
 children [
  Shape {
   geometry Sphere	{
   }
  }
 ]
}

DEF TS TouchSensor {
}

DEF S Script {
 eventIn SFTime touchTime1
 eventIn SFTime touchTime2

 eventOut MFNode addChildren1
 eventOut MFNode addChildren2

 eventIn MFNode children_changed

 url "javascript:
 function touchTime1()
 {
  addChildren1 = new MFNode(new SFNode('Shape { geometry Cone {}}'));
 }
 function touchTime2()
 {
  addChildren2 = new MFNode(new SFNode('Shape { geometry Box { size 1 5 1}}'));
 }
 function children_changed(v, t)
 {
  trace('G.children_changed: ' + v.length);
  trace('time: ' + t);
 }
 "
}

ROUTE TS.touchTime TO S.touchTime1
ROUTE TS.touchTime TO S.touchTime2

ROUTE S.addChildren1 TO	G.addChildren
ROUTE S.addChildren2 TO	G.addChildren

ROUTE G.children_changed TO S.children_changed

#END OF VRML

Dmitry Egorenkov
Cortona Team Leader
ParallelGraphics
-------------------------------------------------------------------------
for list subscription/unsubscription,
go to http://www.web3d.org/cgi-bin/public_list_signup/lwgate/listsavail.html