QWebSettings doesn't provide attribute to trigger "setAllowScriptsToCloseWindows" in settings.h. See bug http://bugs.nokia-boston.com/bugzilla/process_bug.cgi, #4731
Created attachment 68240 [details] patch Introduce a new attribute in QWebSetting to let application can trigger "setAllowScriptsToCloseWindow" to make window.close() works.
Comment on attachment 68240 [details] patch I need documentation at least (and of course an API review).
What documentation I need to prepare, can you give me a detail instruction? This is first time I try to modify a API.
Sure. For example, for all other members of the same enum, see their respective documentation in qwebsettings.cpp
Created attachment 68242 [details] patch2 Update the documentation in QWebSettings to create a new patch. Thanks.
Comment on attachment 68242 [details] patch2 ok
Comment on attachment 68242 [details] patch2 Rejecting patch 68242 from commit-queue. Failed to run "['./WebKitTools/Scripts/webkit-patch', '--status-host=queues.webkit.org', 'apply-attachment', '--force-clean', '--non-interactive', '--quiet', 68242]" exit_code: 2 Cleaning working directory Updating working directory Logging in as commit-queue@webkit.org... Fetching: https://bugs.webkit.org/attachment.cgi?id=68242&action=edit Fetching: https://bugs.webkit.org/show_bug.cgi?id=46186&ctype=xml Processing 1 patch from 1 bug. Processing patch 68242 from bug 46186. Failed to run "[u'/Projects/CommitQueue/WebKitTools/Scripts/svn-apply', u'--reviewer', u'Adam Barth', u'--force']" exit_code: 1 Full output: http://queues.webkit.org/results/4070132
Comment on attachment 68242 [details] patch2 This should follow the naming of JavascriptCanOpenWindows, especiallt if the functionality is symetric with regards to user-initiated gestures, etc
Result of investigations following the API review: JavascriptCanOpenWindows affects only non-user-initiated window.open tentatives. Currently in the implementation, Settings::allowScriptsToCloseWindows() allows the window to be closed only if the window was opened by the script and if the user didn't navigate/load any other page on this window. I think that these two behaviors are related enough to use the symetrical enum name JavascriptCanCloseWindows to wrap Settings::setAllowScriptsToCloseWindows().
Created attachment 70868 [details] patch3 Created a new patch based on Jocelyn's comments.
Comment on attachment 70868 [details] patch3 View in context: https://bugs.webkit.org/attachment.cgi?id=70868&action=review > WebKit/qt/Api/qwebsettings.h:58 > + JavascriptCanCloseWindows, This will break binary compatibility. Add it after the existing enum values instead.
Created attachment 70870 [details] patch4 new patch based on Andreas Kling's comments.
Comment on attachment 70870 [details] patch4 Nice, r=me
Comment on attachment 70870 [details] patch4 Clearing flags on attachment: 70870 Committed r69856: <http://trac.webkit.org/changeset/69856>
All reviewed patches have been landed. Closing bug.
Revision r69856 cherry-picked into qtwebkit-2.1 with commit 42e90ac <http://gitorious.org/webkit/qtwebkit/commit/42e90ac>