RESOLVED FIXED 26006
Sort out lexical / dynamic global object for window.location
https://bugs.webkit.org/show_bug.cgi?id=26006
Summary Sort out lexical / dynamic global object for window.location
Adam Barth
Reported 2009-05-25 03:15:00 PDT
Our choice of lexicalGlobalObject or dynamicGlobalObject not correct. The correct choices appear to be: 1) Use dynamicGlobalObject to find the user gesture. 2) Use dynamicGlobalObject to complete URLs. 3) Use lexicalGlobalObject to find the referrer. 4) Use lexicalGlobalObject for the frame navigation checks. 5) Use lexicalGlobalObject for the XSS checks. Patch forthcoming.
Attachments
patch (28.45 KB, patch)
2009-05-25 03:27 PDT, Adam Barth
no flags
patch (30.08 KB, patch)
2009-05-25 09:52 PDT, Adam Barth
no flags
patch with lexicalFrame (30.08 KB, patch)
2009-05-25 12:10 PDT, Adam Barth
sam: review+
Adam Barth
Comment 1 2009-05-25 03:27:01 PDT
Created attachment 30647 [details] patch This patch isn't fully vetted yet, but it's bedtime. Hopefully I'm nominate it for review tomorrow.
Sam Weinig
Comment 2 2009-05-25 09:18:38 PDT
I would prefer we don't continue to use the term activeFrame, as I think it conveys nothing. In fact, in the code you are changing, it was used to refer to the frame associated with the dynamic global object, but now you are associating it with the lexical global object.
Adam Barth
Comment 3 2009-05-25 09:27:44 PDT
> I would prefer we don't continue to use the term activeFrame, Sure. What term would you like? How about "calling Frame?"
Sam Weinig
Comment 4 2009-05-25 09:39:20 PDT
How about the lexicalFrame and the dynamicFrame. Not the best names for sure, but they at least evoke the terms we use.
Adam Barth
Comment 5 2009-05-25 09:46:22 PDT
> How about the lexicalFrame and the dynamicFrame. Not the best names for sure, > but they at least evoke the terms we use. I'd like to use the same term in both the JSC and V8 bindings so they're easier to keep in sync. The problem with lexicalFrame is that V8 would think that's a different frame because it would give you the lexicalFrame for the *current* function (i.e., the one we're implementing) not the lexical frame for the function that called this one...
Adam Barth
Comment 6 2009-05-25 09:52:52 PDT
Created attachment 30653 [details] patch This patch uses the "callingFrame" name. We can change the name later. There are still a bunch more of these lexical/dynamic issues to sort out (e.g., window.open).
Sam Weinig
Comment 7 2009-05-25 11:53:47 PDT
While I understand your desire to have a name that works with the terminology the v8 bindings folks decided to use, I don't think we should make it harder for the webkit folks because of that. CallingFrame doesn't state which global object it is using clearly, and therefore is less than ideal for me. I would much prefer to go with lexicalFrame and dynamicFrame and have the v8 bindings change to accommodate.
Adam Barth
Comment 8 2009-05-25 12:01:07 PDT
Comment on attachment 30653 [details] patch Ok. I'll spin up a new patch.
Adam Barth
Comment 9 2009-05-25 12:10:41 PDT
Created attachment 30657 [details] patch with lexicalFrame I changed the JSC code to lexicalFrame and left the V8 code with callingFrame. That way the variables match the terminology for each bindings. (This patch is still compiling, but I can fix any typos before landing.)
Sam Weinig
Comment 10 2009-05-25 12:21:22 PDT
Comment on attachment 30657 [details] patch with lexicalFrame Assuming it all compiles and stuff, r=me. Thanks!
Adam Barth
Comment 11 2009-05-25 14:50:34 PDT
Transmitting file data .................. Committed revision 44135.
Note You need to log in before you can comment on or make changes to this bug.