RESOLVED FIXED Bug 26906
[Qt] Prevent Javascript object from being initialized when JavascriptEnabled is false
https://bugs.webkit.org/show_bug.cgi?id=26906
Summary [Qt] Prevent Javascript object from being initialized when JavascriptEnabled ...
Robert Hogan
Reported 2009-07-01 14:41:42 PDT
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.
Attachments
Patch (2.10 KB, patch)
2009-07-01 15:02 PDT, Robert Hogan
no flags
Updated to be page-specific (2.71 KB, patch)
2009-07-01 15:18 PDT, Robert Hogan
manyoso: review-
updated patch (2.77 KB, patch)
2009-07-01 15:33 PDT, Robert Hogan
manyoso: review+
Robert Hogan
Comment 1 2009-07-01 15:02:41 PDT
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.
Robert Hogan
Comment 2 2009-07-01 15:18:37 PDT
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.
Adam Treat
Comment 3 2009-07-01 15:24:56 PDT
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.
Robert Hogan
Comment 4 2009-07-01 15:33:24 PDT
Created attachment 32149 [details] updated patch updated changelog and inline doc
Eric Seidel (no email)
Comment 5 2009-07-01 19:10:00 PDT
Sending WebKit/qt/Api/qwebframe.cpp Sending WebKit/qt/ChangeLog Transmitting file data .. Committed revision 45463. http://trac.webkit.org/changeset/45463
Eric Seidel (no email)
Comment 6 2009-07-01 19:11:56 PDT
Please do not edit the "NOBODY (OOPS!)". It causes scripts to fail which go looking for that. :(
Note You need to log in before you can comment on or make changes to this bug.