Intent to Implement and Ship: Autofocus support for any focusable HTML/SVG element

89 views
Skip to first unread message

TAMURA, Kent

unread,
Sep 2, 2019, 5:03:29 AM9/2/19
to blink-dev
tk...@chromium.org Specification:
None; This is a straight-forward extension of an existing feature Any focusable HTML or SVG element supports 'autofocus' attribute. 'Autofocus' has been supported for a limited number of HTML elements, and there are elements which could be focusable but don't support 'autofocus' attribute. This feature resolves this inconsistent situation.

For example, autofocus attribute doesn't work for <div contenteditable=true> for now.
Low interoperability risk.  Apple and Mozilla are positive.

Low compatibility risk.
This feature moves 'autofocus' IDL attribute from some HTMLElement sub-interfaces to HTMLOrSVGElement.  The code like
  Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'autofocus')
doesn't return a descriptor after the change.  We guess such code is used very rarely.
Firefox: Public support
Yes Yes
Tests will be merged soon; https://github.com/web-platform-tests/wpt/pull/18558 https://bugs.chromium.org/p/chromium/issues/detail?id=995679 https://chromestatus.com/feature/5654905853313024

--
TAMURA Kent
Software Engineer, Google


PhistucK

unread,
Sep 2, 2019, 5:35:41 AM9/2/19
to TAMURA, Kent, blink-dev
Also code like -
typeof element.autofocus !== "undefined"
Which might be used to detect an input, perhaps, would return different results.
But I am not worried much, but it is worth a quick search.

I see it also works with tabindex. Cool!


PhistucK


--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAGH7WqERa7Ndr94iki2iWhMkK0_TtruZ0gCikQ%2BBcBo4ZD9LAA%40mail.gmail.com.

rb...@igalia.com

unread,
Sep 2, 2019, 9:51:32 AM9/2/19
to blink-dev
Hi,


On Monday, September 2, 2019 at 11:03:29 AM UTC+2, Kent Tamura wrote:
Low compatibility risk.
This feature moves 'autofocus' IDL attribute from some HTMLElement sub-interfaces to HTMLOrSVGElement.  The code like

Note that the plan is to name it HTMLOrForeignElement instead of HTMLOrSVGElement to include things like MathML, relevant info is here:
Regards,

Rob.

Yoav Weiss

unread,
Sep 5, 2019, 1:56:06 PM9/5/19
to TAMURA, Kent, blink-dev
LGTM1

Seems like a useful change and I agree that while it's observable, it's not very likely to result in actual breakage.

On Mon, Sep 2, 2019 at 10:03 AM TAMURA, Kent <tk...@chromium.org> wrote:
tk...@chromium.org Specification:
None; This is a straight-forward extension of an existing feature Any focusable HTML or SVG element supports 'autofocus' attribute. 'Autofocus' has been supported for a limited number of HTML elements, and there are elements which could be focusable but don't support 'autofocus' attribute. This feature resolves this inconsistent situation.

For example, autofocus attribute doesn't work for <div contenteditable=true> for now.
Low interoperability risk.  Apple and Mozilla are positive.

Low compatibility risk.
This feature moves 'autofocus' IDL attribute from some HTMLElement sub-interfaces to HTMLOrSVGElement.  The code like
  Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'autofocus')
doesn't return a descriptor after the change.  We guess such code is used very rarely.
Firefox: Public support

I'm not sure this counts as "public support" since it's not on Mozilla's standard-positions repo. At the same time, it's definitely an encouraging signal.

Edge: No public signals Safari: Public support (https://github.com/whatwg/html/issues/833#issuecomment-432993680) Web developers: No signals
Yes Yes
Tests will be merged soon; https://github.com/web-platform-tests/wpt/pull/18558 https://bugs.chromium.org/p/chromium/issues/detail?id=995679 https://chromestatus.com/feature/5654905853313024

--
TAMURA Kent
Software Engineer, Google


Chris Harrelson

unread,
Sep 5, 2019, 3:09:54 PM9/5/19
to Yoav Weiss, TAMURA, Kent, blink-dev

bratell

unread,
Sep 5, 2019, 3:11:14 PM9/5/19
to blink-dev, yo...@yoav.ws, tk...@chromium.org
LGTM3

/Daniel
LGTM2

To unsubscribe from this group and stop receiving emails from it, send an email to blin...@chromium.org.

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blin...@chromium.org.
Reply all
Reply to author
Forward
0 new messages