Skip to content
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

Add svg.global_attributes.autofocus #24574

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions svg/global_attributes.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,50 @@
{
"svg": {
"global_attributes": {
"autofocus": {
"__compat": {
"spec_url": "https://svgwg.org/svg2-draft/struct.html#autofocusattribute",
"tags": [
"web-features:autofocus"
],
"support": {
caugner marked this conversation as resolved.
Show resolved Hide resolved
"chrome": {
"version_added": "79"
},
"chrome_android": "mirror",
"edge": "mirror",
"firefox": [
{
"version_added": "110"
},
{
"version_added": "78",
"partial_implementation": true,
"notes": "Only supported on svg <code>&lt;a&gt;</code>, <code>&lt;circle&gt;</code>, <code>&lt;defs&gt;</code>, <code>&lt;ellipse&gt;</code>, <code>&lt;foreignObject&gt;</code>, <code>&lt;g&gt;</code>, <code>&lt;image&gt;</code>, <code>&lt;line&gt;</code>, <code>&lt;path&gt;</code>, <code>&lt;polygon&gt;</code>, <code>&lt;polyline&gt;</code>, <code>&lt;rect&gt;</code>, <code>&lt;svg&gt;</code>, <code>&lt;switch&gt;</code>, <code>&lt;symbol&gt;</code>, <code>&lt;text&gt;</code>, <code>&lt;use&gt;</code> elements."
caugner marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a list of focusable SVG elements that are not supported. In other words: What are the "missing" elements to complete the implementation? Is there a bug tracking this gap?

Copy link
Contributor Author

@skyclouds2001 skyclouds2001 Oct 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a list of focusable SVG elements that are not supported.

No. But per the note in SVGElement.autofocus, any svg element does not inherit from SVGGraphicsElement does not support this feature at those versions.

Is there a bug tracking this gap?

https://bugzilla.mozilla.org/show_bug.cgi?id=1640280

also refer to #18856 and #18843

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I'm unsure about listing all those elements.

Could we be keep the notes abstract, and make the implementation gap explicit:

Suggested change
"notes": "Only supported on svg <code>&lt;a&gt;</code>, <code>&lt;circle&gt;</code>, <code>&lt;defs&gt;</code>, <code>&lt;ellipse&gt;</code>, <code>&lt;foreignObject&gt;</code>, <code>&lt;g&gt;</code>, <code>&lt;image&gt;</code>, <code>&lt;line&gt;</code>, <code>&lt;path&gt;</code>, <code>&lt;polygon&gt;</code>, <code>&lt;polyline&gt;</code>, <code>&lt;rect&gt;</code>, <code>&lt;svg&gt;</code>, <code>&lt;switch&gt;</code>, <code>&lt;symbol&gt;</code>, <code>&lt;text&gt;</code>, <code>&lt;use&gt;</code> elements."
"notes": "Only supported on SVG graphics elements, and not on any other focusable SVG element."

ChatGPT gave me these elements that may be focusable, but don't extend SVGGraphicsElements:

  • <a>
  • <foreignObject>
  • <desc>, <title>
  • <svg>

Would it make sense to give one of these as an example?

Copy link
Contributor Author

@skyclouds2001 skyclouds2001 Oct 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

per InterfaceData.json and test in browser console, <a>, <foreignObject> and <svg> extends SVGGraphicsElement too, so the three are included by the case

<desc> and <title> extends SVGElement

}
],
"firefox_android": "mirror",
"ie": {
"version_added": false
},
"oculus": "mirror",
"opera": "mirror",
"opera_android": "mirror",
"safari": {
"version_added": "15.4"
},
"safari_ios": "mirror",
"samsunginternet_android": "mirror",
"webview_android": "mirror",
"webview_ios": "mirror"
},
"status": {
"experimental": false,
"standard_track": true,
"deprecated": false
}
}
},
"id": {
"__compat": {
"mdn_url": "https://developer.mozilla.org/docs/Web/SVG/Attribute/id",
Expand Down