mdn / mdn/browser-compat-data

Reorganize SVG attributes in the style of HTML attributes

Open
#9,462 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

data:svg idle question
Dominant language
JSON
Stars
5.8k
Forks
2.6k
Avg merge
1d 21h
Merged PRs (30d)
186

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing SVG attribute records under svg.attributes and svg.elements, then compare duplicates and element-specific versus global attributes. Document the agreed guideline, inventory the records that need relocation, and update the affected MDN identifiers; done means the SVG data follows one consistent organization.

Written by the indexing model from the issue text.

Assessment

Tech stack
json, xml
Domain
data, documentation
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.