You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Something that comes up over and over again in the support forums is people adding on handler attributes for tap events but then not also adding role=button and tabindex=0 (actually, the value doesn't matter, just role and tabindex). Examples:
In #4447 I proposed to add validator support to remove the elements that lack these attributes. However, this would be somewhat jarring, especially in Reader mode where we don't yet have validation error reporting (#4480).
Therefore, I suggest a better behavior would be to introduce a new AMP_Accessibility_Sanitizer that looks for //*[ @on and contains( @on, 'tap:' ) and ( not( @tabindex ) or not( @role ) )] and then automatically supply the role=button if no role attribute is present, or tabindex=0 if no tabindex is present. Note that this should only be done for elements that are not intrinsically focusable, for example button and a would not be included. The specific elements that don't require role and tabindex attributes are indicated in the spec like for the button element:
Ideally these would be extracted from the spec to add to AMP_Allowed_Tags_Generated so that we don't have to hard-code them. This would be an ultimate prerequisite for adding support for the trigger construct in #4447, but it can/should be done up first for a minor release.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation brief
QA testing instructions
Demo
Changelog entry
The text was updated successfully, but these errors were encountered:
Feature description
Something that comes up over and over again in the support forums is people adding
on
handler attributes fortap
events but then not also addingrole=button
andtabindex=0
(actually, the value doesn't matter, justrole
andtabindex
). Examples:In #4447 I proposed to add validator support to remove the elements that lack these attributes. However, this would be somewhat jarring, especially in Reader mode where we don't yet have validation error reporting (#4480).
Therefore, I suggest a better behavior would be to introduce a new
AMP_Accessibility_Sanitizer
that looks for//*[ @on and contains( @on, 'tap:' ) and ( not( @tabindex ) or not( @role ) )]
and then automatically supply therole=button
if norole
attribute is present, ortabindex=0
if notabindex
is present. Note that this should only be done for elements that are not intrinsically focusable, for examplebutton
anda
would not be included. The specific elements that don't requirerole
andtabindex
attributes are indicated in the spec like for thebutton
element:See the
on
attribute spec:Ideally these would be extracted from the spec to add to
AMP_Allowed_Tags_Generated
so that we don't have to hard-code them. This would be an ultimate prerequisite for adding support for thetrigger
construct in #4447, but it can/should be done up first for a minor release.Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation brief
QA testing instructions
Demo
Changelog entry
The text was updated successfully, but these errors were encountered: