Skip to content

Commit

Permalink
[ampproject/amphtml] ♿ [Story a11y] Empty img alt tags (#32880)
Browse files Browse the repository at this point in the history
* No value alt attribute on images.

* Revert setAttrubute

* Fix typo.
  • Loading branch information
processprocess committed Feb 25, 2021
1 parent 8fbb104 commit 02ca8f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion extensions/amp-story/1.0/amp-story-page.js
Expand Up @@ -1855,7 +1855,7 @@ export class AmpStoryPage extends AMP.BaseElement {
initializeImgAltTags_() {
toArray(this.element.querySelectorAll('amp-img')).forEach((ampImgNode) => {
if (!ampImgNode.getAttribute('alt')) {
ampImgNode.setAttribute('alt', ' ');
ampImgNode.setAttribute('alt', '');
// If the child img element is in the dom, propogate the attribute to it.
const childImgNode = ampImgNode.querySelector('img');
childImgNode &&
Expand Down

0 comments on commit 02ca8f4

Please sign in to comment.