Hi Oliver,

thanks for your replies but fortunately today turned out to be our lucky day after working for a week on this problem as it is solved now

The problem was with the creation of context which we were creating each time window object was created. What solved the problem was that all the contexts were needed to be part of a global context group which we created using JSGlobalContextCreateinGroup() instead of JSContextGlobalCreate() as shown in the code posted above.

The parent is the keyword needed to access objects/functions in a window  from a child window e.g. iframe.

Before the above described change we were unable to execute parent.function_name() from inside an iframe as context of parent window was not accessible from child window(iframe).

Regards,

Mohit
 




parent is the keyword to access the

On Thu, Oct 28, 2010 at 9:26 PM, Oliver Hunt <oliver@apple.com> wrote:

On Oct 27, 2010, at 9:42 PM, mohit kingra wrote:

Hi Oliver...


How we are using C API set provided by JavaScriptCore framework is described below:-


example- Initialization of Window Object in Window.cpp

static JSClassDefinition classDefinition = {
      0,                        /* current (and only) version is 0 */
      kJSClassAttributeNone,    /*JSClassAttributes*/

      "Window",
      0,                           /*JSClassRef*/
      WindowProps,                /*const JSStaticValue*                staticValues;  */
      WindowMethods,             /*const JSStaticFunction*             staticFunctions;*/
      NULL,                        /*JSObjectInitializeCallback          initialize*/
      Window_Finalize,        /*JSObjectFinalizeCallback*/
      Window_HasProperty,/*JSObjectHasPropertyCallback */
      Window_GetProperty, /*JSObjectGetPropertyCallback*/
      Window_SetProperty, //NULL, /*JSObjectSetPropertyCallback */
      NULL, /*JSObjectDeletePropertyCallback*/
      NULL, /*JSObjectGetPropertyNamesCallback*/
      NULL, /* JSObjectCallAsFunctionCallback*/
      NULL, /* JSObjectCallAsConstructorCallback*/
      NULL, /* JSObjectHasInstanceCallback*/
      NULL /*JSObjectConvertToTypeCallback*/
};

InitWindowClass()
{
.............
       GlobalObjectClass = JSClassCreate(&classDefinition);
        pJsCx = JSGlobalContextCreate( GlobalObjectClass);

        pWinObj =  JSContextGetGlobalObject(pJsCx);

register pWinObj with a DOM's structure holding all the objects made like above 
.........
.........
}

See,The standard properties/Methods are accesible if defined in WindowProp/WindowMethods as Window Object is made Right.
The problem is in accesing JavaScript Objects using parent keyword.

What do you mean by "parent"?

Are any of the properties you're trying to access being provided by the Window_GetProperty callback?  If so is Window_GetProperty consistent with Window_HasProperty?

--Oliver


Mohit



On Thu, Oct 28, 2010 at 9:48 AM, Oliver Hunt <oliver@apple.com> wrote:

On Oct 27, 2010, at 9:14 PM, mohit kingra wrote:

No, we haven't registered any custom properties for Browser Objects.

On Thu, Oct 28, 2010 at 9:40 AM, Oliver Hunt <oliver@apple.com> wrote:

On Oct 27, 2010, at 9:02 PM, mohit kingra wrote:

> Hi All,
>
> First thing first, The BrowserCore is not WebCore of Webkit, its our own. We are only using JavaScriptCore Library from WebKit.
>
> The Platform we are working on is Gtk on Linux.
>
> Methods/Properties of Browser Objects or Custom Objects are registered as Callbacks using JSClassDefinition structure(JavaScriptCore APIs) in our Interface Code for SquirrelFish and BrowserCore.

Do your custom properties exist on any of the browser objects?

I meant to ask are you aware of your custom properties every being present?

What do you mean by your interface code to squirrelfish?  JavaScriptCore is the API you should be using -- squirrelfish is just the execution engine so if you're circumventing the APIs you may encounter all sorts of problems.

It may be helpful if you give some sample code to show us how you're using the api, as that will make it easier for us to understand what's happening and why your properties aren't showing up.

--Oliver