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
AMP requires that any element with an on event handler attribute also have a tabindex and a role=button. Currently, however, you can create AMP content in WordPress and validation errors will leak.
Consider a Custom HTML block containing:
<spanon="tap:AMP.print">Print!</span>
Two validation errors leak to the frontend:
The reason for this the AMP plugin does not yet support the trigger like the on attribute spec has:
* @todo Need to check the following items that are not yet checked by this sanitizer:
*
* - `also_requires_attr` - if one attribute is present, this requires another.
* - `ChildTagSpec` - Places restrictions on the number and type of child tags.
* - `if_value_regex` - if one attribute value matches, this places a restriction
* on another attribute/value.
The tag-and-attribute sanitizer needs to be updated to support this constraint. This will include updating the Python spec parser to extract these values. When a failure is encountered a new validation error code should be raised. (Currently it is UNKNOWN in the AMP validator but we can do something specific.)
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
AMP requires that any element with an
on
event handler attribute also have atabindex
and arole=button
. Currently, however, you can create AMP content in WordPress and validation errors will leak.Consider a Custom HTML block containing:
Two validation errors leak to the frontend:
The reason for this the AMP plugin does not yet support the
trigger
like theon
attribute spec has:There are currently 22 instances of
trigger
in the protoascii, and each one is foralso_requires_attr
. This is currently called out as a todo:amp-wp/includes/sanitizers/class-amp-tag-and-attribute-sanitizer.php
Lines 20 to 25 in 2549ca3
The tag-and-attribute sanitizer needs to be updated to support this constraint. This will include updating the Python spec parser to extract these values. When a failure is encountered a new validation error code should be raised. (Currently it is
UNKNOWN
in the AMP validator but we can do something specific.)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: