[webkit-qt] A quick question regarding bindings of webcore and jsc

Balazs Kelemen kb at inf.u-szeged.hu
Fri Aug 27 04:04:23 PDT 2010

I have no real knowledge in the DOM bindings of JSC. I think the
majority of that lives in WebCore/dom. Actually I replied to you in
private accidentally, so let's continue the discussion on the list :) .

On 08/25/2010 11:43 PM, Yuchen Zhou wrote:
> Hi Balazs,
> Thank you for your response! That helped a lot but I am still not very
> clear:
> Correct me if I am wrong, I understand that ExecState is defined in
> JSC and also it inherits from the Register class. Register class has a
> union variable which stores the runtime environment such as RegisterFile. 
> However I assume if I declare a variable in javascript, such as "var a
> = 1;", it should not only be created in the JSC registerfile but also
> become a new node in the document tree in WebCore. As we know that
> this variable "a" is actually "window.a". In other cases, if I
> explicitly write "document.a = 1" it should certainly reflect in the
> DOM tree. I was looking at where the DOM tree is passed on to JSC and
> later modified in JSC.
> You just told me that all script objects (I assume including the DOM)
> are stored in execstate, however in ExecState class (defined in
> callframe.h) I cannot find anything related to WebCore::Document
> class, so I was a little confused about this.
> Many thanks in advance,
> Best,
> --Yuchen
> On Wed, Aug 25, 2010 at 12:51 PM, Balazs Kelemen <kb at inf.u-szeged.hu
> <mailto:kb at inf.u-szeged.hu>> wrote:
>     On 08/25/2010 03:55 AM, yz8ra wrote:
>>     Hi all,
>>     I am graduate student at University of Virginia, looking to
>>     improve some security features of webkit and I am currently
>>     looking at IsolatedWorld mechanism specifically. I wish to
>>     broaden its usage to protect the webpages against embedded
>>     third-party scripts.
>>     I have a question here:
>>     in Class DOMWrapperWorld (WebCore/bindings/js/DOMWrapperWorld.h),
>>     there are two variables: JSC::JSGlobalData* m_globalData; and
>>     HashSet<Document*> m_documentsWithWrapperCaches;
>>     Upon initialization of the script execution, the DOMWrapperWorld
>>     is later used to create a JSDOMWindowShell, which contains two
>>     variables: JSDOMWindow* m_window; and the world itself. Correct
>>     me if I am wrong, this Windowshell is later used to create
>>     ExecState variable and then passed on to JavascriptCore as script
>>     runtime environment.
>>     I want to know where does the javascript document tree object of
>>     the webpage resides in. Clearly the DOMWrapperWorld has a hashmap
>>     variable of document class, however I don't see there is any code
>>     touching that variable. In other words, when the browser
>>     encounters a script like "var a = 10;", where does the browser
>>     stores this variable? I assume it's gonna store it in one of the
>>     abovementioned data structures...
>>     Many thanks in advance,
>>     Best,
>     All script objects are stored in a slot of ExecState. For better
>     understanding about what the ExecState is, see RegisterFile.cpp

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-qt/attachments/20100827/f4068c51/attachment.html>

More information about the webkit-qt mailing list