Skip to content

Commit

Permalink
Events guideline: Single entry for event and onXXX event handler (#13595
Browse files Browse the repository at this point in the history
)

* Events guideline: Single entry for event and onXXX event handler

* Suggest note text

* Feedback

* Update docs/data-guidelines.md

Co-authored-by: Philip Jägenstedt <[email protected]>

Co-authored-by: Philip Jägenstedt <[email protected]>
  • Loading branch information
Elchi3 and foolip authored Nov 29, 2021
1 parent c1a40c8 commit f3cf16c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/data-guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,17 @@ For example, the feature for a `focus` event targeting the `Element` interface w
}
```

This rule applies to the event features themselves, not the features for the event handlers. For example, `focus_event` and `onfocus` are two separate features.
The event handler `onfocus` is represented by the `focus_event` entry. Don't create features for `on` event handler properties. If an implementation doesn't support the event handler property, use `partial_implementation` with the note `"The <code>onfocus</code> event handler property is not supported."`. If only the `on` event handler property is supported and not the event itself, use `"version_added": false`.

If a specification has two sections (the event handler property and the event name), add both specification links.

This practice emerged through several discussions:

- [#935](https://github.com/mdn/browser-compat-data/issues/935#issuecomment-464691417)
- [#3420](https://github.com/mdn/browser-compat-data/pull/3420)
- [#3469](https://github.com/mdn/browser-compat-data/pull/3469)
- [mdn/content#9098](https://github.com/mdn/content/discussions/9098)
- [#13595](https://github.com/mdn/browser-compat-data/pull/13595)

## Secure context required (`secure_context_required`)

Expand Down

0 comments on commit f3cf16c

Please sign in to comment.