Skip to content

Commit 6544a24

Browse files
SVG event handlers: optional edit (mdn#41602)
* SVG event handlers: optional edit * Update files/en-us/web/svg/reference/attribute/index.md Co-authored-by: Chris Mills <chrisdavidmills@gmail.com> * Correct autofocus event reference in SVG attributes * Remove all the attributes and write an explanation with a link to the not-to-be-used attributes instead. * add csp link --------- Co-authored-by: Chris Mills <chrisdavidmills@gmail.com>
1 parent 149256c commit 6544a24

File tree

1 file changed

+5
-64
lines changed
  • files/en-us/web/svg/reference/attribute

1 file changed

+5
-64
lines changed

files/en-us/web/svg/reference/attribute/index.md

Lines changed: 5 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -427,70 +427,11 @@ All SVG presentation attributes can be used as CSS properties.
427427

428428
### Event attributes
429429

430-
- **`onabort`**
431-
- **`onactivate`**
432-
- **`onbegin`**
433-
- **`oncancel`**
434-
- **`oncanplay`**
435-
- **`oncanplaythrough`**
436-
- **`onchange`**
437-
- **`onclick`**
438-
- **`onclose`**
439-
- **`oncuechange`**
440-
- **`ondblclick`**
441-
- **`ondrag`**
442-
- **`ondragend`**
443-
- **`ondragenter`**
444-
- **`ondragleave`**
445-
- **`ondragover`**
446-
- **`ondragstart`**
447-
- **`ondrop`**
448-
- **`ondurationchange`**
449-
- **`onemptied`**
450-
- **`onend`**
451-
- **`onended`**
452-
- **`onerror`**
453-
- **`onfocus`**
454-
- **`onfocusin`**
455-
- **`onfocusout`**
456-
- **`oninput`**
457-
- **`oninvalid`**
458-
- **`onkeydown`**
459-
- **`onkeypress`**
460-
- **`onkeyup`**
461-
- **`onload`**
462-
- **`onloadeddata`**
463-
- **`onloadedmetadata`**
464-
- **`onloadstart`**
465-
- **`onmousedown`**
466-
- **`onmouseenter`**
467-
- **`onmouseleave`**
468-
- **`onmousemove`**
469-
- **`onmouseout`**
470-
- **`onmouseover`**
471-
- **`onmouseup`**
472-
- **`onmousewheel`**
473-
- **`onpause`**
474-
- **`onplay`**
475-
- **`onplaying`**
476-
- **`onprogress`**
477-
- **`onratechange`**
478-
- **`onrepeat`**
479-
- **`onreset`**
480-
- **`onresize`**
481-
- **`onscroll`**
482-
- **`onseeked`**
483-
- **`onseeking`**
484-
- **`onselect`**
485-
- **`onshow`**
486-
- **`onstalled`**
487-
- **`onsubmit`**
488-
- **`onsuspend`**
489-
- **`ontimeupdate`**
490-
- **`ontoggle`**
491-
- **`onunload`**
492-
- **`onvolumechange`**
493-
- **`onwaiting`**
430+
All HTML and SVG elements support event handler attributes defined on the [`GlobalEventHandlers`](/en-US/docs/Web/HTML/Reference/Global_attributes#list_of_global_event_handler_attributes) mixin.
431+
432+
While event handler attributes, like {{domxref("Element/blur_event", "onblur")}} and {{domxref("Element/drag_event", "ondrag")}}, apply to all elements, they may not have any effect. For example, the {{domxref("HTMLTrackElement/cuechange_event", "oncuechange")}} attribute can be applied to any element, but it is only relevant to the {{htmlelement("track")}} element.
433+
434+
Event handler attributes are discouraged, considered unsafe, and may be blocked by [content security policies (CSP)](/en-US/docs/Web/Security/Practical_implementation_guides/CSP). Use the event name withing an {{domxref("EventTarget.addEventListener", "addEventListener()")}} method instead.
494435

495436
## See also
496437

0 commit comments

Comments
 (0)