-
Notifications
You must be signed in to change notification settings - Fork 22.9k
Refactor SVG attributes page. Link events #41583
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Updated SVG attributes section to clarify categories and descriptions.
Preview URLs
Flaws (12)Note! 2 documents with no flaws that don't need to be listed. 🎉 URL:
(comment last updated: 2025-10-20 09:46:58) |
- **`onunload`** | ||
- **`onvolumechange`** | ||
- **`onwaiting`** | ||
The event handler content attributes, prefixed with the `on` are supported by all {{domxref("Document")}} and {{domxref("Window")}} objects, as event handler event types: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is in direct contradiction with this page which is about attributes on SVG elements. Perhaps you want to adopt the verbiage from https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes#list_of_global_event_handler_attributes instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The wording comes from the specs, but I agree with not including it. Would you be ok with removing all of them and linking to the page instead? The original version, without links, wasn't useful
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
- **`onwaiting`** | ||
Event handler attributes are discouraged. While the attributes listed below apply to all HTML and SVG elements, they are not useful on all elements. For example, the `oncuechange` attribute is accepted by all elements and attaches an event listener for `cuechange`, but only {{htmlelement("track")}} elements will ever receive a `cuechange` event fired by the browser. For other elements, you can only use {{domxref("EventTarget.dispatchEvent()")}} to manually dispatch one. [Some attributes](/en-US/docs/Web/HTML/Reference/Elements/body#event_attributes) can be specified on {{HTMLElement("svg")}}, but they would instead listen to events on `window`. | ||
|
||
- {{domxref("HTMLMediaElement/abort_event", "onabort")}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where does this list come from? I checked https://svgwg.org/svg2-draft/attindex.html, and they don't match (granted, the previous list don't match perfectly either). Furthermore not all of these attributes are global.
This doesn't look right:
Some attributes can be specified on {{HTMLElement("svg")}}, but they would instead listen to events on
window
.
I don't think SVG has the same window-reflecting event attribute concept like HTML. Even when the SVG is opened as a separate document, I'm not sure if this can happen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the list that was there and created links out of them, since the list was not helpful as it was, plus it had duplicates. I am all for getting rid of the whole list.
The "doesn't look right" part: the <SVG>
element, which is the HTML <svg>
element.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reverted the section, so we can merge the rest (if approved), as that was the important part. The rest was just to be hopefully helpful, but not required, so reverted. See #41602 which we can edit, merge or close.
added some text and links. deduped some events