Bug 251857

Summary: Context menu shows wrong URL and preview when mousedown changes anchor href
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebKit2Assignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Normal CC: kkinnunen, thorton, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
demo none

Chris Dumez
Reported 2023-02-07 09:11:29 PST
Steps to reproduce: 1. Open the attached sample "index.html" in Safari 2. Hold down "context menu here" to open the contextual menu Expected results: It shows the URL and preview of https://www.apple.com/ Actual results: It shows the URL and preview of https://www.webkit.org/ Note that if you copy or tap the link, you'll get https://www.apple.com/ rather than https://www.webkit.org/. Here's the relevant HTML source: ``` <p><a href="https://www.webkit.org/">context menu here</a></p> <script>document.querySelector("a").addEventListener("mousedown", (event) => { event.target.href = "https://www.apple.com/"; });</script> ```
Attachments
demo (448 bytes, text/html)
2023-02-07 09:12 PST, Chris Dumez
no flags
Chris Dumez
Comment 1 2023-02-07 09:11:37 PST
Chris Dumez
Comment 2 2023-02-07 09:12:08 PST
Note You need to log in before you can comment on or make changes to this bug.