If you add a heading with ARIA attributes, say <h3 role="navigation" aria-label="This is a label">Testing 123</h3> within the body of a node that is limited to Basic HTML it is converted to <p>Testing 123</p> and the attributes are stripped.

This is a conversion process. if you put in <p role="navigation" aria-label="This is a label">Testing 123</p>, there's no problem.

This is an issue for ATAG 2.0 B.1.2.1 Restructuring and Recoding Transformations (WCAG).

Basically good accessibility attributes are being removed as a result of a transition because a tag isn't allowed. The attributes just need to be brought forward.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mgifford’s picture

Version: 8.0.x-dev » 8.1.x-dev
Status: Active » Postponed
dawehner’s picture

Uh, I thought that bugs are considered as 8.0.x material, especially why they don't break APIs

mgifford’s picture

Version: 8.1.x-dev » 8.0.x-dev
Status: Postponed » Active

I'm happy dealing with it in 8.0 if we can. I've been trying to trim down the list of #a11y issues that I think we can get to before the release of D8.

Since there was no movement here I bumped it to 8.1. I'll move this back for now though. Thanks for the clarification @dawehner

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev
darvanen’s picture

This came up as the daily triage target for the bug smash initiative.

In order to reproduce this I:

  1. installed standard profile
  2. edited the basic HTML text format
  3. removed <h3> from the allowed tags
  4. added aria-* and role to the allowed attributes for the <p> tag
  5. put the two examples in the IS into a basic page body and published

The result was the removal of the <h3> tag with no replacement at all:

It looks like the disallowed tags are being stripped by the input filter, then replaced with a <p> tag later, likely by CKEditor interpreting a line break.

I'm not sure this can be solved because there is currently no such thing as tag replacement in the backend as far as I can tell, and with good reason. Replacing all disallowed tags with a <p> tag would cause chaos.

I think this one might need to be "won't fix".

longwave’s picture

To me this is works as designed, if someone enters an h3 and that is disallowed by the input format we must strip it, attributes and all. We can't really know what to do with any attributes automatically - there may be nowhere to put the attributes (as in #14), what if the attributes already exist on the next element we try to merge them into, what if there are multiple choices of where to put the attributes, etc.

Reading ATAG 2.0 B.1.2.1, to me it is not about filtering, more about transforming markup permanently in an editor tool. There is no permanent data loss here - the attributes are preserved in the source field, they just happen to be filtered from this particular output - the HTML could be output elsewhere in a different format that preserves the accessibility info.

darvanen’s picture

You're right, it still has those tags/attributes in the database. They do get stripped off the next time you go to edit the content.

"works as designed" works for me. I'll wait a little longer and see if there are other opinions before applying it.

jonathanshaw’s picture

It looks like the disallowed tags are being stripped by the input filter, then replaced with a

tag later, likely by CKEditor interpreting a line break.

I'm not sure this can be solved because there is currently no such thing as tag replacement in the backend

I agree this suggests no way of fixing.

darvanen’s picture

Status: Active » Closed (works as designed)

I'm calling it.

If you stumble across this and can think of a way to solve the currently-unsolvable, please feel free to reopen.