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

'autofocus' attribute support #726

Closed
tkent-google opened this issue Aug 19, 2019 · 7 comments · Fixed by #728
Closed

'autofocus' attribute support #726

tkent-google opened this issue Aug 19, 2019 · 7 comments · Fixed by #728

Comments

@tkent-google
Copy link
Contributor

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.

@longsonr
Copy link

Not any SVG element, only graphics ones.

@domenic
Copy link

domenic commented Aug 21, 2019

I think it should be on the same set of elements that tabindex is specified for. I don't see any restriction to graphic elements in https://svgwg.org/svg2-draft/struct.html#tabindexattribute, personally.

@longsonr
Copy link

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.

@AmeliaBR
Copy link
Contributor

A non-rendered element should never receive focus (in HTML or SVG). But the attribute is currently defined as a global.

@css-meeting-bot
Copy link
Member

The SVG Working Group just discussed 'autofocus' attribute support, and agreed to the following:

  • RESOLUTION: Accept the change to the shared HTML/SVG mixin to add autofocus and agree to make a matching global attribute
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.

tkent-google added a commit to tkent-google/svgwg that referenced this issue Aug 27, 2019
@tkent-google
Copy link
Contributor Author

I made a PR anyway though I'm not sure if it's correct.

AmeliaBR pushed a commit that referenced this issue Aug 31, 2019
@longsonr
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants