Changeset 25534 in webkit
- Timestamp:
- Sep 13, 2007, 6:54:12 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r25527 r25534 1 2007-09-12 Antti Koivisto <antti@apple.com> 2 3 Reviewed by Geoff, Maciej. 4 5 Fix <rdar://problem/5445058> 6 REGRESSION: Unable to upload picture to eBay auction due to domain security check 7 8 eBay uses window.eval() between windows. In Firefox window.eval() switches execution 9 and security context to the target window, something WebKit did not do. With WebKit 10 security tightening in r24781, this broke picture uploads. 11 12 Fix by making WebKit switch context in window.eval(). 13 14 * kjs/Context.cpp: 15 (KJS::Context::Context): 16 (KJS::Context::~Context): 17 * kjs/context.h: 18 Save and restore interpreter context independently from calling context. 19 20 * kjs/function.cpp: 21 (KJS::GlobalFuncImp::callAsFunction): 22 If eval is called for global object different than current one, switch execution context 23 to that object and push it to scope. 24 1 25 2007-09-12 Sam Weinig <sam@webkit.org> 2 26 -
trunk/JavaScriptCore/kjs/Context.cpp
r21019 r25534 32 32 FunctionImp* func, const List* args) 33 33 : m_interpreter(interpreter) 34 , m_savedContext(interpreter->context()) 34 35 , m_currentBody(currentBody) 35 36 , m_function(func) … … 84 85 Context::~Context() 85 86 { 86 m_interpreter->setContext(m_ callingContext);87 m_interpreter->setContext(m_savedContext); 87 88 88 89 // The arguments list is only needed to potentially create the arguments object, -
trunk/JavaScriptCore/kjs/context.h
r21889 r25534 130 130 Interpreter* m_interpreter; 131 131 Context* m_callingContext; 132 Context* m_savedContext; 132 133 FunctionBodyNode* m_currentBody; 133 134 ExecState* m_execState; -
trunk/JavaScriptCore/kjs/function.cpp
r24394 r25534 771 771 } 772 772 773 JSValue* GlobalFuncImp::callAsFunction(ExecState* exec, JSObject* /*thisObj*/, const List& args)773 JSValue* GlobalFuncImp::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args) 774 774 { 775 775 JSValue* res = jsUndefined(); … … 818 818 return throwError(exec, SyntaxError, errMsg, errLine, sid, NULL); 819 819 820 bool switchGlobal = exec->dynamicInterpreter()->isGlobalObject(thisObj) && thisObj != exec->dynamicInterpreter()->globalObject(); 821 820 822 // enter a new execution context 823 Interpreter* interpreter = switchGlobal ? exec->dynamicInterpreter()->interpreterForGlobalObject(thisObj) : exec->dynamicInterpreter(); 821 824 JSObject* thisVal = static_cast<JSObject*>(exec->context()->thisValue()); 822 Context ctx( exec->dynamicInterpreter()->globalObject(),823 exec->dynamicInterpreter(),825 Context ctx(interpreter->globalObject(), 826 interpreter, 824 827 thisVal, 825 828 progNode.get(), 826 829 EvalCode, 827 830 exec->context()); 828 ExecState newExec( exec->dynamicInterpreter(), &ctx);831 ExecState newExec(interpreter, &ctx); 829 832 if (exec->hadException()) 830 833 newExec.setException(exec->exception()); 831 834 ctx.setExecState(&newExec); 835 836 if (switchGlobal) 837 ctx.pushScope(thisObj); 832 838 833 839 // execute the code 834 840 progNode->processVarDecls(&newExec); 835 841 Completion c = progNode->execute(&newExec); 842 843 if (switchGlobal) 844 ctx.popScope(); 836 845 837 846 // if an exception occured, propogate it back to the previous execution object -
trunk/LayoutTests/ChangeLog
r25531 r25534 1 2007-09-12 Antti Koivisto <antti@apple.com> 2 3 Reviewed by Geoff, Maciej. 4 5 Test for <rdar://problem/5445058> 6 REGRESSION: Unable to upload picture to eBay auction due to domain security check 7 8 * fast/js/window-eval-context-expected.txt: Added. 9 * fast/js/window-eval-context.html: Added. 10 1 11 2007-09-12 John Seif <johneseif@gmail.com> 2 12
Note:
See TracChangeset
for help on using the changeset viewer.