Bug 174891 - javascript URL link cannot use target
Summary: javascript URL link cannot use target
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Frames (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
: 178145 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-07-27 04:57 PDT by Anne van Kesteren
Modified: 2022-12-16 01:55 PST (History)
10 users (show)

See Also:


Attachments
Patch (6.73 KB, patch)
2020-07-19 13:47 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (6.22 KB, patch)
2020-12-22 01:53 PST, Rob Buis
ews-feeder: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anne van Kesteren 2017-07-27 04:57:49 PDT
While writing tests for https://github.com/whatwg/html/issues/1129 I found that the target attribute is not used for javascript URLs in links.
Comment 1 Anne van Kesteren 2017-10-10 22:49:33 PDT
*** Bug 178145 has been marked as a duplicate of this bug. ***
Comment 2 Rob Buis 2020-07-13 10:51:54 PDT
This is interesting but I guess there no tests for it?
Comment 3 Anne van Kesteren 2020-07-14 00:57:34 PDT
See https://github.com/whatwg/html/issues/1129#issuecomment-318068941. Maybe it can be done through a popup? Where you follow the link in a popup and it actually targets a frame elsewhere. And then you observe if the popup or the frame changed.
Comment 4 Rob Buis 2020-07-14 08:50:48 PDT
(In reply to Anne van Kesteren from comment #3)
> See https://github.com/whatwg/html/issues/1129#issuecomment-318068941. Maybe
> it can be done through a popup? Where you follow the link in a popup and it
> actually targets a frame elsewhere. And then you observe if the popup or the
> frame changed.

Thanks, based on that I created https://github.com/web-platform-tests/wpt/pull/24589.
Comment 5 Rob Buis 2020-07-19 13:47:51 PDT
Created attachment 404682 [details]
Patch
Comment 6 EWS Watchlist 2020-07-19 13:48:33 PDT
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
Comment 7 Rob Buis 2020-12-22 01:53:15 PST
Created attachment 416655 [details]
Patch
Comment 8 Rob Buis 2020-12-22 13:13:32 PST
The failing test is because javascript: handling is synchronous for the test. Also we do not support yet aborting of pending fetches on new navigations.
I wonder how to proceed:
- land this with the test marked as timeout, fix later.
- fix javascript: handling first (https://bugs.webkit.org/show_bug.cgi?id=200523?), possibly aborting of pending fetches, which seems like a tricky change.
- http://bugs.webkit.org/show_bug.cgi?id=16782 seems a bit related too.

So I feel this patch is correct, it just show up some existing problems/areas where we do not match the specifications.
Comment 9 Sam Sneddon [:gsnedders] 2021-02-10 05:41:43 PST
This came to my attention from EricLaw tweeting about this: https://twitter.com/ericlaw/status/1359173838257414151

It appears Chrome changed behaviour in 76, from https://bugs.chromium.org/p/chromium/issues/detail?id=944213. It sounds like they also had issues landing the change due to existing problems.

https://wpt.fyi/results/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-return-value-handling-dynamic.html?label=master&label=experimental&product=chrome&product=firefox&product=safari&aligned&q=javascript-url-return-value-handling-dynamic.html shows the current results for the test Rob wrote.