Updated: Comment #7

Problem/Motivation

Noticed while working on #1898442: responsive_image.module - Convert theme_ functions to Twig

According to the specification for the picture element, there shouldn't be alt or title attributes on the picture tag.
The alt attribute belongs on the img element.

There may be further changes required to match our usage of picture with the evolving standard, which would be handled by another issue. However the alt attribute is currently causing an issue with the Twig conversion #1898442: responsive_image.module - Convert theme_ functions to Twig. Removing alt allows us to proceed with that conversion.

Reference: http://picture.responsiveimages.org

Proposed resolution

Remove the alt from picture html element.

Remaining tasks

create patch to remove alt attribute from picture tag. update the code that generates the html and the tests for picture alt.

User interface changes

No.

API changes

No.

Comments

jayeshanandani’s picture

Issue summary: View changes
jayeshanandani’s picture

Issue summary: View changes
jayeshanandani’s picture

rainbowarray’s picture

Issue summary: View changes
jayeshanandani’s picture

Issue summary: View changes
jayeshanandani’s picture

Issue summary: View changes
yesct’s picture

Issue summary: View changes

using more of the issue summary template

yesct’s picture

oops some of the tags from the cloned issue are not appropriate here.

yesct’s picture

Status: Needs work » Active

no patch yet, so active.

rainbowarray’s picture

Status: Active » Needs review

So this is actually a really simple patch. The tests for the alt attribute were added in #1898442: responsive_image.module - Convert theme_ functions to Twig, as far as I can tell, so this just removes the alt attribute from the picture element itself.

rainbowarray’s picture

StatusFileSize
new1.03 KB

Helps if I upload the patch.

joelpittet’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Twig

Not related to twig, but RTBC:)
Thanks you guys for that and the extra missing title variable documentation.

attiks’s picture

Issue tags: +Needs reroll

FYI: picture is renamed to responsive_image so this needs a reroll once #2124377-74: Rename "Picture" module to "Responsive Image" module is committed

webchick’s picture

Status: Reviewed & tested by the community » Postponed

Yeah, since that patch is a much bigger PITA to re-roll, and it looks pretty close, marking this one "postponed."

rainbowarray’s picture

Status: Postponed » Needs work
rainbowarray’s picture

Status: Needs work » Needs review
StatusFileSize
new1.12 KB

Revised patch targeting the new module name.

joelpittet’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs reroll

Back to RTBC, barring testbot fails.

webchick’s picture

Title: Removal of alt attribute from <picture> » Removal of alt attribute from [picture] tag

Sorry, that is annoying me on issue listings. ;)

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.x. Thanks!

eli-t’s picture

Component: picture.module » responsive_image.module

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.