Skip to content

Reorganize SVG attributes in the style of HTML attributes #9462

@ddbeck

Description

@ddbeck

SVG element attributes are organized in a different way from HTML element attributes. Many SVG attributes are recorded as svg.attributes.<category>.<attribute> while others are recorded as svg.elements.<element>.<attribute>. Some are recorded in both places. This is confusing and leads to duplicate or mismatched data.

Instead, I propose we adopt the somewhat more consistent pattern of HTML element attributes for SVG attribute data: svg.elements.<attribute> for attributes which apply to a single element and svg.global_attributes.<attribute> for attributes which are not element-specific.

If we were to do this, we'd probably need to

  • write up a guideline documenting the new approach
  • go through all the existing SVG attributes and determine which are duplicates or need to be relocated
  • update MDN pages with new identifiers

I don't think this is particularly high priority at the moment, but if we could agree on an approach in general, then we could leave it open as an effort that the community could pick up incrementally.

Inspired by #9402.

Metadata

Metadata

Assignees

No one assigned

    Labels

    data:svgCompat data for SVG features. https://developer.mozilla.org/docs/Web/SVGidleIssues and pull requests with no recent activityquestionIssues where a question or problem is stated and a discussion is held to gather opinions.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions