RESOLVED FIXED 46186
[Qt] window.close() doesn't work in qt
https://bugs.webkit.org/show_bug.cgi?id=46186
Summary [Qt] window.close() doesn't work in qt
qi
Reported 2010-09-21 07:24:53 PDT
QWebSettings doesn't provide attribute to trigger "setAllowScriptsToCloseWindows" in settings.h. See bug http://bugs.nokia-boston.com/bugzilla/process_bug.cgi, #4731
Attachments
patch (1.86 KB, patch)
2010-09-21 07:40 PDT, qi
tonikitoo: review-
patch2 (2.23 KB, patch)
2010-09-21 08:35 PDT, qi
vestbo: review-
commit-queue: commit-queue-
patch3 (2.62 KB, patch)
2010-10-15 08:33 PDT, qi
kling: review-
patch4 (2.64 KB, patch)
2010-10-15 08:48 PDT, qi
no flags
qi
Comment 1 2010-09-21 07:40:15 PDT
Created attachment 68240 [details] patch Introduce a new attribute in QWebSetting to let application can trigger "setAllowScriptsToCloseWindow" to make window.close() works.
Antonio Gomes
Comment 2 2010-09-21 08:08:29 PDT
Comment on attachment 68240 [details] patch I need documentation at least (and of course an API review).
qi
Comment 3 2010-09-21 08:11:43 PDT
What documentation I need to prepare, can you give me a detail instruction? This is first time I try to modify a API.
Antonio Gomes
Comment 4 2010-09-21 08:14:06 PDT
Sure. For example, for all other members of the same enum, see their respective documentation in qwebsettings.cpp
qi
Comment 5 2010-09-21 08:35:07 PDT
Created attachment 68242 [details] patch2 Update the documentation in QWebSettings to create a new patch. Thanks.
Adam Barth
Comment 6 2010-09-26 22:24:48 PDT
Comment on attachment 68242 [details] patch2 ok
WebKit Commit Bot
Comment 7 2010-09-27 06:49:54 PDT
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
Tor Arne Vestbø
Comment 8 2010-09-27 06:52:37 PDT
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
Jocelyn Turcotte
Comment 9 2010-09-28 02:03:09 PDT
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().
qi
Comment 10 2010-10-15 08:33:19 PDT
Created attachment 70868 [details] patch3 Created a new patch based on Jocelyn's comments.
Andreas Kling
Comment 11 2010-10-15 08:39:34 PDT
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.
qi
Comment 12 2010-10-15 08:48:38 PDT
Created attachment 70870 [details] patch4 new patch based on Andreas Kling's comments.
Andreas Kling
Comment 13 2010-10-15 09:13:32 PDT
Comment on attachment 70870 [details] patch4 Nice, r=me
WebKit Commit Bot
Comment 14 2010-10-15 09:27:36 PDT
Comment on attachment 70870 [details] patch4 Clearing flags on attachment: 70870 Committed r69856: <http://trac.webkit.org/changeset/69856>
WebKit Commit Bot
Comment 15 2010-10-15 09:27:45 PDT
All reviewed patches have been landed. Closing bug.
Ademar Reis
Comment 16 2010-10-15 12:55:40 PDT
Revision r69856 cherry-picked into qtwebkit-2.1 with commit 42e90ac <http://gitorious.org/webkit/qtwebkit/commit/42e90ac>
Note You need to log in before you can comment on or make changes to this bug.