Bug 178145

Summary: Anchor targeting does not work right with javascript: URLs
Product: WebKit Reporter: Boris Zbarsky <bzbarsky>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: annevk, cdumez
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Testcase none

Boris Zbarsky
Reported 2017-10-10 14:32:10 PDT
STEPS TO REPRODUCE: 1. Load the testcase. 2. Click the link. EXPECTED RESULTS: The alert should say "Should be about:blank: about:blank" ACTUAL RESULTS: The alert says: "Should be about:blank: XXXX" where XXXX is the actual url of the testcase page. ADDITIONAL INFORMATION: The HTML spec is pretty clear on this: the target is used to find the right browsing context before any script gets run, and then it runs in the current window in the target browsing context. Safari is running it in the wrong window. Note, in particular, that this: <a href="javascript:alert(location.href)" target="_blank">Click me</a> should open a new window and then run the JS in there, which Safari also doesn't do.
Attachments
Testcase (147 bytes, text/html)
2017-10-10 14:32 PDT, Boris Zbarsky
no flags
Boris Zbarsky
Comment 1 2017-10-10 14:32:38 PDT
Created attachment 323352 [details] Testcase
Anne van Kesteren
Comment 2 2017-10-10 22:49:33 PDT
*** This bug has been marked as a duplicate of bug 174891 ***
Note You need to log in before you can comment on or make changes to this bug.