mdn / mdn/browser-compat-data

Move non-global SVG attributes

Open
#25,609 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

This is the complementary task to https://github.com/mdn/browser-compat-data/issues/25608, extracted from https://github.com/mdn/browser-compat-data/issues/9462.

Check svg.global_attributes for attributes that aren't actually global:

Tasks
  • autofocus (scope not specified in SVG 2, "has no effect if the element is not already focusable", which strictly speaking doesn't exclude non-focusable elements)
  • id ("available on all SVG elements")
  • lang ("may be used on SVG elements in XML documents", i.e. not limited)
  • tabindex (scope not specified in SVG 2, i.e. no limitation mentioned)
  • xml_lang ("may be used on SVG elements in XML documents")
  • xml_space (scope not specified in SVG 2, refers to SVG 1, which mentions no limitation)
  • data_attributes ("All SVG elements support custom data attributes")
  • class (scope implicitly defined via className attribute on SVGElement)
  • style (scope not specified in SVG 2, refers to HTML spec, where it's global)
  • ⚠️ requiredExtensions ("Most elements, but not all, may have conditional processing attributes [like requiredExtensions] specified on them.", which excludes never-rendered elements like style/script)
  • (Global) alignment-baseline
  • (Global) baseline-shift
  • ⚠️ clip (SVG 2 refers to CSS Masking 1: "applies to elements which establish a new viewport, pattern and mask elements")
  • (Global) clip-path
  • (Global) clip-rule
  • (Global) color
  • (Global) color-interpolation
  • (Global) color-interpolation-filters
  • (Global) cursor
  • (Global) direction
  • (Global) display
  • (Global) dominant-baseline
  • (Global) fill-opacity
  • (Global) fill-rule
  • (Global) filter
  • (Global) flood-color
  • (Global) flood-opacity
  • (Global) font-family
  • (Global) font-size
  • (Global) font-size-adjust
  • (Global) font-stretch
  • (Global) font-style
  • (Global) font-variant
  • (Global) font-weight
  • (Global) glyph-orientation-horizontal
  • (Global) glyph-orientation-vertical
  • (Global) image-rendering
  • (Global) letter-spacing
  • (Global) lighting-color
  • (Global) marker-end
  • (Global) marker-mid
  • (Global) marker-start
  • (Global) mask
  • (Global) opacity
  • (Global) overflow
  • (Global) paint-order
  • (Global) pointer-events
  • (Global) shape-rendering
  • (Global) stop-color
  • (Global) stop-opacity
  • (Global) stroke
  • (Global) stroke-dasharray
  • (Global) stroke-dashoffset
  • (Global) stroke-linecap
  • (Global) stroke-linejoin
  • (Global) stroke-miterlimit
  • (Global) stroke-opacity
  • (Global) stroke-width
  • (Global) text-anchor
  • (Global) text-decoration
  • (Global) text-overflow
  • (Global) text-rendering
  • ⚠️ transform (SVG 2 points to CSS Transforms 1, which mentions "applies to: transformable elements")
  • (Global) transform-origin
  • (Global) unicode-bidi
  • (Global) vector-effect
  • (Global) visibility
  • (Global) white-space
  • (Global) word-spacing
  • (Global) writing-mode

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 at the svg.global_attributes data mentioned in the issue and review the linked source issues and SVG/CSS specifications for requiredExtensions, clip, and transform. Move each attribute to the appropriate SVG element scope, then validate the affected JSON data and confirm that svg.global_attributes contains only truly global attributes.

Written by the indexing model from the issue text.

Assessment

Tech stack
json
Domain
documentation, web-dev
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.