-
Notifications
You must be signed in to change notification settings - Fork 133
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
'autofocus' attribute support #726
Comments
Not any SVG element, only graphics ones. |
I think it should be on the same set of elements that |
See https://wpt.fyi/results/svg/interact/scripted/tabindex-focus-flag.svg?label=master&label=experimental both Chrome and Firefox have the same functionality here. |
A non-rendered element should never receive focus (in HTML or SVG). But the attribute is currently defined as a global. |
The SVG Working Group just discussed
The full IRC log of that discussion<krit> topic: 'autofocus' attribute support<krit> GitHub: https://github.com//issues/726 <krit> AmeliaBR: this came up from an issue on Whatwg <krit> AmeliaBR: An HTML is currently only defined on elements that are focused by default like text area <krit> AmeliaBR: but the plan is to make autofocus valid anywhere that can be made focusable <krit> AmeliaBR: the proposal was to define it on the HTMLSVGElement mixin <krit> AmeliaBR: so that SVG elements also take tabindex and also use autofocus <krit> AmeliaBR: If this change goes in to the mixin the change is limited to IDL <krit> AmeliaBR: we should comment if we have concerns with this change to the shared mixin <krit> krit: what would happen to SVG elements like refs, mask, clipPath that are not focusable at the moment? <krit> AmeliaBR: they can have tabindex but would never receive focus since they are non-renderable elements <krit> AmeliaBR: I think the behavior of autofocus would fall out of that <krit> AmeliaBR: it triggers an algorithm <krit> AmeliaBR: we could add a comment to the HTML issue to make sure that this is cleat <krit> krit: we do have a term for non-renderable term <krit> krit: So maybe HTML could just reference this term for SVG elements <krit> AmeliaBR: we have a definition in the interaction section about focus. It defines which elements are focusable. This should match the term of a focusable area within an element of HTML. <AmeliaBR> https://svgwg.org/svg2-draft/interact.html#Focus <krit> AmeliaBR: It does reference the definition what a renderable element is. <krit> krit: seems fine if HTML is referencing focusable areas and if SVG is defining what this means for SVG. <krit> RESOLUTION: Accept the change to the shared HTML/SVG mixin to add autofocus and agree to make a matching global attribute <krit> AmeliaBR: We should try to coordinate things. Maybe with a draft PR that can be merged quickly after the HTML changes. |
This fixes w3c#726
I made a PR anyway though I'm not sure if it's correct. |
Given that tabindex only has an effect on SVGGraphicsElements it seems odd to have autofocus as something that exists on SVGElement. I've just landed an implementation on Firefox but that is restricted to SVGGraphicsElement |
Spec: https://svgwg.org/svg2-draft/struct.html#CommonAttributes
Context: whatwg/html#4830
In the HTML specification, we're about to make
autofocus
a global attribute.Because any SVG element can be focusable by tabindex,
autofocus
attribute should be supported as well.The text was updated successfully, but these errors were encountered: