Changeset 12486 in webkit
- Timestamp:
- Jan 30, 2006 6:52:49 PM (18 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r12480 r12486 1 2006-01-30 Geoffrey Garen <ggaren@apple.com> 2 3 Reviewed by mjs. 4 5 - Speculative fix for <rdar://problem/4135845> Crash executing 6 cross-frame script on timeout in KJS::ScheduledAction::execute 7 8 If we ever get a reproducible case of 4135845, I'll add a test for it. 9 10 This is a re-working of Maciej's fix for 3157014 (circa 2003!). Since 11 you can't reliably predict what the state of the page will be when 12 a timer fires, I've made the timer responsbile for making sure that 13 everything is OK to execute. 14 15 I tested @ http://www.javascriptkit.com/script/cut3.shtml with various 16 combinations of reload, back, and regular navigations with JS enabled/ 17 disabled to ensure that the previous crash didn't return. I also ran a 18 leaks test and discovered some, but none unique to this patch. (See 19 <rdar://problem/4427420> TOT REGRESSION: Leaks seen on page with 20 JavaScript timer.) 21 22 * khtml/ecma/kjs_window.cpp: 23 (KJS::ScheduledAction::execute): Return early if there's no window 24 object. (This happens when JavaScript is disabled.) 25 (KJS::Window::retrieveWindow): Reversed a backwards ASSERT, increased 26 prettiness. (The assert fired while I was testing. Not sure why we 27 haven't seen it before.) 28 * page/Frame.cpp: 29 (Frame::didOpenURL): Returned setting of JavaScript enabled/disabled 30 preference to its rightful place. This introduces a new behavior: now, 31 the unload event does not fire after you've disabled JavaScript. That 32 seems like a good thing. (See <rdar://problem/4426506> Disabling 33 JavaScript should immediately end JavaScript execution.) 34 (Frame::begin): Ditto. 35 1 36 2006-01-30 Geoffrey Garen <ggaren@apple.com> 2 37 -
trunk/WebCore/khtml/ecma/kjs_window.cpp
r12476 r12486 331 331 } 332 332 333 Window *Window::retrieveWindow(Frame *p) 334 { 335 JSObject *obj = retrieve(p)->getObject(); 336 // obj should never be null, except when javascript has been disabled in that frame. 337 ASSERT(obj || (p && p->jScriptEnabled())); 338 if (!obj) // JS disabled 339 return 0; 340 return static_cast<Window*>(obj); 333 Window *Window::retrieveWindow(Frame *f) 334 { 335 JSObject *o = retrieve(f)->getObject(); 336 337 ASSERT(o || !f->jScriptEnabled()); 338 return static_cast<Window *>(o); 341 339 } 342 340 … … 1836 1834 void ScheduledAction::execute(Window *window) 1837 1835 { 1838 if (!window->m_frame )1836 if (!window->m_frame || !window->m_frame->jScript()) 1839 1837 return; 1840 1838 1841 ScriptInterpreter *interpreter = window-> interpreter();1839 ScriptInterpreter *interpreter = window->m_frame->jScript()->interpreter(); 1842 1840 1843 1841 interpreter->setProcessingTimerCallback(true); -
trunk/WebCore/khtml/ecma/kjs_window.h
r12474 r12486 121 121 * bindings. 122 122 */ 123 static JSValue *retrieve(Frame * p);123 static JSValue *retrieve(Frame *); 124 124 /** 125 125 * Returns the Window object for a given HTML frame 126 126 */ 127 static Window *retrieveWindow(Frame * p);127 static Window *retrieveWindow(Frame *); 128 128 /** 129 129 * returns a pointer to the Window object this javascript interpreting instance -
trunk/WebCore/page/Frame.cpp
r12480 r12486 317 317 } 318 318 319 // set the javascript flags according to the current url319 d->m_bJScriptEnabled = d->m_settings->isJavaScriptEnabled(url.host()); 320 320 d->m_bJavaEnabled = d->m_settings->isJavaEnabled(url.host()); 321 321 d->m_bPluginsEnabled = d->m_settings->isPluginsEnabled(url.host()); … … 755 755 756 756 clear(); 757 758 757 partClearedInBegin(); 759 760 // Only do this after clearing the part, so that JavaScript can761 // clean up properly if it was on for the last load.762 d->m_bJScriptEnabled = d->m_settings->isJavaScriptEnabled(url.host());763 758 764 759 d->m_bCleared = false;
Note: See TracChangeset
for help on using the changeset viewer.