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

Make 'autofocus' a global attribute #4830

Merged
merged 2 commits into from Aug 30, 2019

Conversation

@tkent-google
Copy link
Collaborator

@tkent-google tkent-google commented Aug 9, 2019

  • Add 'autofocus' to the global attribute list
  • Move 'autofocus' IDL attribute from HTMLButtonElement, HTMLInputElement,
    HTMLSelectElement, HTMLTextAreaElement to HTMLOrSVGElement

This fixes #4563

(See WHATWG Working Mode: Changes for more details.)


/dom.html ( diff )
/form-control-infrastructure.html ( diff )
/form-elements.html ( diff )
/index.html ( diff )
/indices.html ( diff )
/input.html ( diff )
/interaction.html ( diff )
/interactive-elements.html ( diff )
/origin.html ( diff )

- Add 'autofocus' to the global attribute list
- Move 'autofocus' IDL attribute from HTMLButtonElement, HTMLInputElement,
  HTMLSelectElement, HTMLTextAreaElement to HTMLOrSVGElement

This fixes whatwg#4563
domenic
domenic approved these changes Aug 9, 2019
Copy link
Member

@domenic domenic left a comment

LGTM. I guess it is pretty simple. I will push an additional sentence or two to tweak the main autofocus section to make it clearer in the non-normative introductory prose that it works on all elements. (The processing model already seems to work on all elements, although the processing model is also being fixed in #4763.)

@tkent-google
Copy link
Collaborator Author

@tkent-google tkent-google commented Aug 14, 2019

The current PR moves the IDL attribute to HTMLOrSVGElement because it has focus(). However, it implies any SVG element can have 'autofocus' content attribute, right? Should I propose adding autofocus to SVG common attributes, or should I move the IDL attribute to HTMLElement instead of HTMLOrSVGElement?

@domenic
Copy link
Member

@domenic domenic commented Aug 14, 2019

Interesting question. In the past SVG folks have been excited about unifying where possible. In my opinion it is safe to tentatively assume they will want to do the same here, but we should open an issue and/or pull request to check. /cc @AmeliaBR

@AmeliaBR
Copy link

@AmeliaBR AmeliaBR commented Aug 17, 2019

I haven't heard any demand for autofocus in SVG, but if it's being extended in HTML to all elements that can be focusable, it would definitely be preferable (IMO) to keep SVG consistent.

Adding the IDL property to HTMLOrSVGElement handles the DOM side of things, but we do need to define the attribute separately to keep it coordinated.

@tkent-google Are you able to make a PR on the SVG spec (to the Common/core attributes section you linked to, probably add it after tabindex & link back to HTML for all technical details)? Or if you're not sure where to make the edits, at least file an issue so we can track.

@tkent-google
Copy link
Collaborator Author

@tkent-google tkent-google commented Aug 19, 2019

ok, I filed an issue for SVG; w3c/svgwg#726

@tkent-google
Copy link
Collaborator Author

@tkent-google tkent-google commented Aug 20, 2019

Copy link
Collaborator

@smaug---- smaug---- left a comment

Looks reasonable (and should be quite easy to tweak Gecko to have this behavior).

@domenic domenic merged commit f5ae47e into whatwg:master Aug 30, 2019
2 checks passed
@sideshowbarker
Copy link
Member

@sideshowbarker sideshowbarker commented Sep 2, 2019

moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Sep 9, 2019
…obal attribute, a=testonly

Automatic update from web-platform-tests
html, svg: Add a test for 'autofocus' as a global attribute (#18558)

For whatwg/html#4830

--

wpt-commits: cfb69fe84608b80823905e9f257e2ef7700362bc
wpt-pr: 18558
xeonchen pushed a commit to xeonchen/gecko that referenced this issue Sep 9, 2019
…obal attribute, a=testonly

Automatic update from web-platform-tests
html, svg: Add a test for 'autofocus' as a global attribute (#18558)

For whatwg/html#4830

--

wpt-commits: cfb69fe84608b80823905e9f257e2ef7700362bc
wpt-pr: 18558
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Oct 4, 2019
…obal attribute, a=testonly

Automatic update from web-platform-tests
html, svg: Add a test for 'autofocus' as a global attribute (#18558)

For whatwg/html#4830

--

wpt-commits: cfb69fe84608b80823905e9f257e2ef7700362bc
wpt-pr: 18558

UltraBlame original commit: 9a87b8b6492b5506c938250f4d28c72332981181
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Oct 4, 2019
…obal attribute, a=testonly

Automatic update from web-platform-tests
html, svg: Add a test for 'autofocus' as a global attribute (#18558)

For whatwg/html#4830

--

wpt-commits: cfb69fe84608b80823905e9f257e2ef7700362bc
wpt-pr: 18558

UltraBlame original commit: 9a87b8b6492b5506c938250f4d28c72332981181
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Oct 4, 2019
…obal attribute, a=testonly

Automatic update from web-platform-tests
html, svg: Add a test for 'autofocus' as a global attribute (#18558)

For whatwg/html#4830

--

wpt-commits: cfb69fe84608b80823905e9f257e2ef7700362bc
wpt-pr: 18558

UltraBlame original commit: 9a87b8b6492b5506c938250f4d28c72332981181
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked issues

Successfully merging this pull request may close these issues.

5 participants