Skip to content

Conversation

estelle
Copy link
Member

@estelle estelle commented Oct 18, 2025

added some text and links. deduped some events

Updated SVG attributes section to clarify categories and descriptions.
@estelle estelle requested a review from a team as a code owner October 18, 2025 00:26
@estelle estelle requested review from chrisdavidmills and removed request for a team October 18, 2025 00:26
@github-actions github-actions bot added Content:SVG SVG docs size/m [PR only] 51-500 LoC changed labels Oct 18, 2025
Copy link
Contributor

github-actions bot commented Oct 18, 2025

Preview URLs

Flaws (12)

Note! 2 documents with no flaws that don't need to be listed. 🎉

URL: /en-US/docs/Web/SVG/Reference/Attribute
Title: SVG Attribute reference
Flaw count: 12

  • macros:
    • Can't resolve /en-US/docs/Web/SVG/Reference/Attribute/hreflang
    • Can't resolve /en-US/docs/Web/SVG/Reference/Attribute/offset
    • Can't resolve /en-US/docs/Web/SVG/Reference/Attribute/ping
    • Can't resolve /en-US/docs/Web/SVG/Reference/Attribute/referrerPolicy
    • Can't resolve /en-US/docs/Web/SVG/Reference/Attribute/rel
    • and 7 more flaws omitted

(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:
Copy link
Member

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.

Copy link
Member Author

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

estelle and others added 3 commits October 18, 2025 13:47
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions github-actions bot added the Content:Meta Content in the meta docs label Oct 18, 2025
@estelle estelle requested a review from Josh-Cena October 18, 2025 14:31
- **`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")}}
Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member Author

@estelle estelle Oct 20, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:Meta Content in the meta docs Content:SVG SVG docs size/m [PR only] 51-500 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants