Bug 258610 - Clicking a link inside a contenteditable=false element sets the target of the focusin event to the contenteditable
Summary: Clicking a link inside a contenteditable=false element sets the target of the...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: BrowserCompat, InRadar
Depends on:
Blocks:
 
Reported: 2023-06-27 23:58 PDT by Brian Birtles
Modified: 2023-08-21 15:44 PDT (History)
5 users (show)

See Also:


Attachments
Test case (218 bytes, text/html)
2023-06-27 23:58 PDT, Brian Birtles
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Birtles 2023-06-27 23:58:43 PDT
Created attachment 466839 [details]
Test case

The attached test case looks like the following:

```
<div id=div contenteditable=false tabindex=0>
  <a href="#yer">Yer</a>
</div>
<script>
div.addEventListener('focusin', (evt) => {
  console.log(evt.target);
});
</script>
```

Clicking the link in Firefox or Chrome triggers a `focusin` event with the target set to the <a> element.

In Safari 16.5 and TP, the `target` is set to the `<div>`.

Furthermore, without the `tabindex=0`, no focusin event is dispatched in Safari, although it is in Firefox and Chrome.
Comment 1 Karl Dubost 2023-06-29 00:37:03 PDT
Hey Brian, thanks for the report.
Confirmed on latest nightly, canary, stp versions of the browsers.
Comment 2 Radar WebKit Bug Importer 2023-07-04 23:59:16 PDT
<rdar://problem/111769393>