WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
101226
[Qt] Open link in this window action
https://bugs.webkit.org/show_bug.cgi?id=101226
Summary
[Qt] Open link in this window action
Allan Sandfeld Jensen
Reported
2012-11-05 08:39:37 PST
When right clicking on a link that has a target specifying it should open in a new window we currently show two options that are functionally equivalent (open link (default) and open link in new window). KHTML in this case gives the user another option "open link in this window", which overrides the new window target. This is useful in several poorly designed webpages and a feature I personally miss in QtWebKit.
Attachments
Patch
(8.71 KB, patch)
2012-11-05 08:44 PST
,
Allan Sandfeld Jensen
no flags
Details
Formatted Diff
Diff
Patch
(8.73 KB, patch)
2012-11-05 08:47 PST
,
Allan Sandfeld Jensen
no flags
Details
Formatted Diff
Diff
Patch
(9.17 KB, patch)
2012-11-05 09:11 PST
,
Allan Sandfeld Jensen
no flags
Details
Formatted Diff
Diff
Patch
(9.73 KB, patch)
2012-11-06 03:43 PST
,
Allan Sandfeld Jensen
no flags
Details
Formatted Diff
Diff
Patch
(9.68 KB, patch)
2012-11-07 07:23 PST
,
Allan Sandfeld Jensen
no flags
Details
Formatted Diff
Diff
Patch
(9.89 KB, patch)
2012-11-07 08:01 PST
,
Allan Sandfeld Jensen
hausmann
: review+
Details
Formatted Diff
Diff
Show Obsolete
(5)
View All
Add attachment
proposed patch, testcase, etc.
Allan Sandfeld Jensen
Comment 1
2012-11-05 08:44:51 PST
Created
attachment 172341
[details]
Patch
Allan Sandfeld Jensen
Comment 2
2012-11-05 08:47:39 PST
Created
attachment 172343
[details]
Patch
WebKit Review Bot
Comment 3
2012-11-05 08:50:43 PST
Attachment 172343
[details]
did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1 Source/WebKit/qt/Api/qwebpage.cpp:2373: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Source/WebKit/qt/Api/qwebpage.cpp:2374: When wrapping a line, only indent 4 spaces. [whitespace/indent] [3] Total errors found: 2 in 8 files If any of these errors are false positives, please file a bug against check-webkit-style.
Build Bot
Comment 4
2012-11-05 08:55:10 PST
Comment on
attachment 172343
[details]
Patch
Attachment 172343
[details]
did not pass mac-ews (mac): Output:
http://queues.webkit.org/results/14745157
WebKit Review Bot
Comment 5
2012-11-05 09:07:23 PST
Comment on
attachment 172343
[details]
Patch
Attachment 172343
[details]
did not pass chromium-ews (chromium-xvfb): Output:
http://queues.webkit.org/results/14748054
Peter Beverloo (cr-android ews)
Comment 6
2012-11-05 09:07:25 PST
Comment on
attachment 172343
[details]
Patch
Attachment 172343
[details]
did not pass cr-android-ews (chromium-android): Output:
http://queues.webkit.org/results/14731576
Allan Sandfeld Jensen
Comment 7
2012-11-05 09:11:31 PST
Created
attachment 172351
[details]
Patch
WebKit Review Bot
Comment 8
2012-11-05 09:14:31 PST
Attachment 172351
[details]
did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1 Source/WebKit/qt/Api/qwebpage.cpp:2373: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Source/WebKit/qt/Api/qwebpage.cpp:2374: When wrapping a line, only indent 4 spaces. [whitespace/indent] [3] Total errors found: 2 in 8 files If any of these errors are false positives, please file a bug against check-webkit-style.
Jocelyn Turcotte
Comment 9
2012-11-05 09:16:21 PST
Comment on
attachment 172351
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=172351&action=review
> Source/WebCore/page/ContextMenuController.cpp:728 > + ContextMenuItem OpenLinkInThisWindowItem(ActionType, ContextMenuItemTagOpenLinkInThisWindow, > + contextMenuItemTagOpenLinkInThisWindow());
I don't think that this is something that is beneficial for every QtWebKit application. It would be better not to add it to the default context menu and let application add it by overriding QWebView::contextMenuEvent.
> Source/WebKit/qt/Api/qwebpage.h:100 > + OpenLinkInThisWindow,
Some documentation would be quite helpful given the ambiguity of the name.
Allan Sandfeld Jensen
Comment 10
2012-11-05 09:25:44 PST
(In reply to
comment #8
)
> If any of these errors are false positives, please file a bug against check-webkit-style.
The style bot discards comments, which makes it miscount the indentation. I could fix it by removing space between comments and arguments, but that does not look very nice. (In reply to
comment #9
)
> (From update of
attachment 172351
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=172351&action=review
> > > Source/WebCore/page/ContextMenuController.cpp:728 > > + ContextMenuItem OpenLinkInThisWindowItem(ActionType, ContextMenuItemTagOpenLinkInThisWindow, > > + contextMenuItemTagOpenLinkInThisWindow()); > > I don't think that this is something that is beneficial for every QtWebKit application. It would be better not to add it to the default context menu and let application add it by overriding QWebView::contextMenuEvent. >
We could do that. That would just mean keeping the code in QtWebKit? The argument for making it more universal is only that OpenLink and OpenLinkInNewWindow are duplicates in this case, though we could also remove one of them by default.
> > Source/WebKit/qt/Api/qwebpage.h:100 > > + OpenLinkInThisWindow, > > Some documentation would be quite helpful given the ambiguity of the name.
Right, I missed that.
Jocelyn Turcotte
Comment 11
2012-11-06 01:41:11 PST
(In reply to
comment #10
)
> We could do that. That would just mean keeping the code in QtWebKit? The argument for making it more universal is only that OpenLink and OpenLinkInNewWindow are duplicates in this case, though we could also remove one of them by default.
I wish we could remove it but it is needed for code out there that implement QWebView::createWindow and expect the menu item to be there already.
Allan Sandfeld Jensen
Comment 12
2012-11-06 03:43:07 PST
Created
attachment 172545
[details]
Patch Do not populate the context-menu by default with the new action, but instead just add it in QtTestBrowser for testing
WebKit Review Bot
Comment 13
2012-11-06 03:48:09 PST
Attachment 172545
[details]
did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1 Source/WebKit/qt/Api/qwebpage.cpp:2374: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Source/WebKit/qt/Api/qwebpage.cpp:2375: When wrapping a line, only indent 4 spaces. [whitespace/indent] [3] Total errors found: 2 in 10 files If any of these errors are false positives, please file a bug against check-webkit-style.
Jocelyn Turcotte
Comment 14
2012-11-06 05:36:26 PST
Comment on
attachment 172545
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=172545&action=review
I think you also need to update editorCommandWebActions in qwebpage.cpp Overall we usually have a team API review on each release to pass invidual APIs that were added through more eyes, maybe we should do this soon.
> Source/WebKit/qt/Api/qwebpage.h:100 > + OpenLinkInThisWindow,
I think this needs to go at the end of the list for binary compatibility.
Allan Sandfeld Jensen
Comment 15
2012-11-07 07:23:57 PST
Created
attachment 172795
[details]
Patch Moved new enum to stay ABI compatible
WebKit Review Bot
Comment 16
2012-11-07 07:26:08 PST
Attachment 172795
[details]
did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1 Source/WebKit/qt/Api/qwebpage.cpp:2374: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Source/WebKit/qt/Api/qwebpage.cpp:2375: When wrapping a line, only indent 4 spaces. [whitespace/indent] [3] Total errors found: 2 in 10 files If any of these errors are false positives, please file a bug against check-webkit-style.
Allan Sandfeld Jensen
Comment 17
2012-11-07 07:59:25 PST
(In reply to
comment #16
)
>
Attachment 172795
[details]
did not pass style-queue: > > Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1 > Source/WebKit/qt/Api/qwebpage.cpp:2374: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] > Source/WebKit/qt/Api/qwebpage.cpp:2375: When wrapping a line, only indent 4 spaces. [whitespace/indent] [3] > Total errors found: 2 in 10 files > > > If any of these errors are false positives, please file a bug against check-webkit-style.
Right, we will get these until the patch for
bug #101230
lands.
Allan Sandfeld Jensen
Comment 18
2012-11-07 08:01:13 PST
Created
attachment 172803
[details]
Patch Also updated editorCommentWebActions
WebKit Review Bot
Comment 19
2012-11-07 08:04:12 PST
Attachment 172803
[details]
did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1 Source/WebKit/qt/Api/qwebpage.cpp:2375: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Source/WebKit/qt/Api/qwebpage.cpp:2376: When wrapping a line, only indent 4 spaces. [whitespace/indent] [3] Total errors found: 2 in 10 files If any of these errors are false positives, please file a bug against check-webkit-style.
Simon Hausmann
Comment 20
2012-11-07 08:08:35 PST
Comment on
attachment 172803
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=172803&action=review
> Source/WebKit/qt/Api/qwebpage.cpp:1698 > + \value OpenLinkInThisWindow Open the current link without opening a new window. Used on links that would default to opening a new window. (Added in Qt 5.0)
"Used on links that would default to opening a new window" maybe that should also include frames? Like "Used on links that would default to opening in another frame or a new window" ?
Allan Sandfeld Jensen
Comment 21
2012-11-07 08:38:47 PST
Committed
r133763
: <
http://trac.webkit.org/changeset/133763
>
Csaba Osztrogonác
Comment 22
2012-11-07 10:43:59 PST
(In reply to
comment #21
)
> Committed
r133763
: <
http://trac.webkit.org/changeset/133763
>
and it broke 28 tests:
http://build.webkit.sed.hu/results/x86-32%20Linux%20Qt%20Release%20NRWT/r133763%20%2823083%29/results.html
Please fix the bug. Otherwise I suggest you should run tests before committing ...
Allan Sandfeld Jensen
Comment 23
2012-11-07 11:19:12 PST
(In reply to
comment #22
)
> (In reply to
comment #21
) > > Committed
r133763
: <
http://trac.webkit.org/changeset/133763
> > > and it broke 28 tests:
http://build.webkit.sed.hu/results/x86-32%20Linux%20Qt%20Release%20NRWT/r133763%20%2823083%29/results.html
> > Please fix the bug. Otherwise I suggest you should run tests before committing ...
Sorry, it was last minute change. The addition to editorCommandWebAction is in the wrong place, and all the tests were run before that addition.
Csaba Osztrogonác
Comment 24
2012-11-07 11:52:38 PST
Fix landed in
http://trac.webkit.org/changeset/133789
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug