If clients call addToJavaScriptWindowObject even though JavascriptEnabled is false webkit will segfault on the assert: ASSERTION FAILED: _rootObject (../../../WebCore/bridge/runtime.cpp:52 JSC::Bindings::Instance::Instance(WTF::PassRefPtr<JSC::Bindings::RootObject>)) Fix is to ensure JavaScript is enabled when client calls addToJavaScriptWindowObject.
Created attachment 32145 [details] Patch This fixes the assert. But I don't see a ready way of adding a unit test for the root cause.
Created attachment 32147 [details] Updated to be page-specific Patch updated to be page specific, also updated inline documentation. Tested with arora. Launching with jscript both enabled and disabled. Also tested opening different pages between toggling jscript on and off.
Comment on attachment 32147 [details] Updated to be page-specific > + If QWebSettings::JavascriptEnabled is false, this function does nothing. How about, "If JavaScript is not enabled for this page, then this function does nothing." > +2009-06-30 Robert Hogan <robert@roberthogan.net> > + > + Reviewed by NOBODY. > + > + Fix Qt segfault when javascript disabled. Please put the URL in the ChangeLog. With those changes r=me.
Created attachment 32149 [details] updated patch updated changelog and inline doc
Sending WebKit/qt/Api/qwebframe.cpp Sending WebKit/qt/ChangeLog Transmitting file data .. Committed revision 45463. http://trac.webkit.org/changeset/45463
Please do not edit the "NOBODY (OOPS!)". It causes scripts to fail which go looking for that. :(