Changeset 26074 in webkit
- Timestamp:
- Oct 5, 2007 5:54:00 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r26050 r26074 1 2007-10-05 Geoffrey Garen <ggaren@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 Added JSObject::removeDirect, to support the fix for 6 <rdar://problem/5522487> REGRESSION: With JavaScript disabled, any 7 page load causes a crash in PropertyMap::put 8 9 * kjs/object.cpp: 10 (KJS::JSObject::removeDirect): 11 * kjs/object.h: 12 1 13 2007-10-04 Mark Rowe <mrowe@apple.com> 2 14 -
trunk/JavaScriptCore/JavaScriptCore.exp
r25584 r26074 1 _jscore_collector_introspection2 _jscore_fastmalloc_introspection3 1 _JSCheckScriptSyntax 4 2 _JSClassCreate … … 143 141 __ZN3KJS13SavedBuiltinsC1Ev 144 142 __ZN3KJS13SavedBuiltinsD1Ev 143 __ZN3KJS13jsOwnedStringERKNS_7UStringE 145 144 __ZN3KJS14StringInstance14deletePropertyEPNS_9ExecStateERKNS_10IdentifierE 146 145 __ZN3KJS14StringInstance16getPropertyNamesEPNS_9ExecStateERNS_17PropertyNameArrayE … … 198 197 __ZN3KJS8DebuggerD2Ev 199 198 __ZN3KJS8JSObject11hasInstanceEPNS_9ExecStateEPNS_7JSValueE 199 __ZN3KJS8JSObject12removeDirectERKNS_10IdentifierE 200 200 __ZN3KJS8JSObject14callAsFunctionEPNS_9ExecStateEPS0_RKNS_4ListE 201 201 __ZN3KJS8JSObject14deletePropertyEPNS_9ExecStateERKNS_10IdentifierE … … 214 214 __ZN3KJS8jsStringEPKc 215 215 __ZN3KJS8jsStringERKNS_7UStringE 216 __ZN3KJS13jsOwnedStringERKNS_7UStringE217 216 __ZN3KJS9Collector15numInterpretersEv 218 217 __ZN3KJS9Collector15recordExtraCostEm … … 283 282 __ZTVN3KJS19InternalFunctionImpE 284 283 __ZTVN3KJS8JSObjectE 284 _jscore_collector_introspection 285 _jscore_fastmalloc_introspection 285 286 _kJSClassDefinitionEmpty 286 287 _kjs_pcre_compile -
trunk/JavaScriptCore/kjs/object.cpp
r25161 r26074 559 559 } 560 560 561 void JSObject::removeDirect(const Identifier &propertyName) 562 { 563 _prop.remove(propertyName); 564 } 565 561 566 void JSObject::putDirectFunction(InternalFunctionImp* func, int attr) 562 567 { -
trunk/JavaScriptCore/kjs/object.h
r21736 r26074 436 436 void putDirect(const Identifier &propertyName, JSValue *value, int attr = 0); 437 437 void putDirect(const Identifier &propertyName, int value, int attr = 0); 438 438 void removeDirect(const Identifier &propertyName); 439 439 440 // convenience to add a function property under the function's own built-in name 440 441 void putDirectFunction(InternalFunctionImp*, int attr = 0); -
trunk/WebCore/ChangeLog
r26072 r26074 1 2007-10-05 Geoffrey Garen <ggaren@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 New fix for <rdar://problem/5522487> REGRESSION: With JavaScript 6 disabled, any page load causes a crash in PropertyMap::put 7 8 Explicitly remove the "document" property from the window. The old 9 solution would leave a stale "document" property around after JavaScript 10 was re-enabled. 11 12 The architecture for disabling JavaScript could use some consolidation. 13 It seems wrong that a script proxy even exists when JavaScript is 14 disabled. It also seems wrong that so many individual call sites are 15 responsible for checking whether JavaScript is enabled. I've filed a 16 bug about this: http://bugs.webkit.org/show_bug.cgi?id=15385. 17 18 * bindings/js/kjs_proxy.cpp: 19 (WebCore::KJSProxy::clearDocumentWrapper): 20 * bindings/js/kjs_proxy.h: 21 * page/Frame.cpp: 22 (WebCore::Frame::setDocument): 23 1 24 2007-10-05 Jon Honeycutt <jhoneycutt@apple.com> 2 25 -
trunk/WebCore/bindings/js/kjs_proxy.cpp
r26071 r26074 168 168 } 169 169 170 void KJSProxy:: updateDocumentWrapper()170 void KJSProxy::clearDocumentWrapper() 171 171 { 172 Settings* settings = m_frame->settings(); 173 if (!settings || !settings->isJavaScriptEnabled()) 174 return; 175 176 if (!m_script || !m_frame->document()) 172 if (!m_script) 177 173 return; 178 174 179 175 JSLock lock; 180 // this will update 'document' property to point to the current document 181 toJS(m_script->globalExec(), m_frame->document()); 176 m_script->globalObject()->removeDirect("document"); 182 177 } 183 178 -
trunk/WebCore/bindings/js/kjs_proxy.h
r25783 r26074 56 56 bool haveInterpreter() const { return m_script; } 57 57 58 void updateDocumentWrapper();58 void clearDocumentWrapper(); 59 59 60 60 private: -
trunk/WebCore/page/Frame.cpp
r25783 r26074 281 281 d->m_doc->attach(); 282 282 283 if (d->m_jscript && d->m_doc) 284 d->m_jscript->updateDocumentWrapper(); 283 // Remove the cached 'document' property, which is now stale. 284 if (d->m_jscript) 285 d->m_jscript->clearDocumentWrapper(); 285 286 } 286 287
Note: See TracChangeset
for help on using the changeset viewer.