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

Conversation

skyclouds2001
Copy link
Contributor

@skyclouds2001 skyclouds2001 commented Sep 30, 2024

Summary

the data is taken from SVGElement.autofocus, as they both share the same test

Test results and supporting details

Related issues

@github-actions github-actions bot added the data:svg 🖌️ Compat data for SVG features. https://developer.mozilla.org/docs/Web/SVG label Sep 30, 2024
@skyclouds2001 skyclouds2001 marked this pull request as ready for review September 30, 2024 07:59
svg/global_attributes.json Outdated Show resolved Hide resolved
svg/global_attributes.json Show resolved Hide resolved
Imran-imtiaz48

This comment was marked as off-topic.

Copy link
Contributor

@caugner caugner left a comment

Choose a reason for hiding this comment

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

Verified that the section is equal to this SVGElement.autofocus (except for the notes):

"autofocus": {
"__compat": {
"spec_url": "https://html.spec.whatwg.org/multipage/interaction.html#dom-fe-autofocus",
"tags": [
"web-features:autofocus"
],
"support": {
"chrome": {
"version_added": "79"
},
"chrome_android": "mirror",
"edge": "mirror",
"firefox": [
{
"version_added": "110"
},
{
"version_added": "78",
"partial_implementation": true,
"notes": "Only supported on <code>SVGGraphicsElement</code>."
}
],
"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
}
}
},

{
"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."
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

{
"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."
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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:svg 🖌️ Compat data for SVG features. https://developer.mozilla.org/docs/Web/SVG
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants