border="0" on image tags by default should be removed

Bug #143207 reported by Alexander Limi
2
Affects Status Importance Assigned to Milestone
Zope 2
Fix Released
Medium
Andreas Jung

Bug Description

This is a re-opening of http://collector.zope.org/Zope/1158.

Zope emits <img border="0" /> by default, and you can "override" this by supplying it with an empty border argument.

This is wrong, and breaks validity and accessibility in a lot of sites. The border attribute should be set via CSS, and the only browser that doesn't respect this is Netscape 4. If you have Netscape 4 as a target platform, you have to do lots of workarounds anyway - no need to optimize for this case.

- I propose that Zope does not emit any border tag unless explicitly asked to do so.

Related, Zope still emits the Title variable in both the alt and title attributes. This is wrong, either there needs to be a separate alt variable in the Image object, or the alt attribute should be empty (alt=""). It still needs to be there, even if it's empty. It can be set manually, if required.

The Title should go into the title attribute on the tag, as it already does. Putting it in the alt attribute is wrong, though. Alt text is an alternative representation of the image, and is not the image title.

- My suggestion is that the Image field outputs a blank alt="" attribute by default, and uses the Title variable for the title attribute on the tag.

(If somebody wants to solve this more thoroughly, Image should have a separate alt variable that is output as alt="" if it has no content - and a longdesc variable that is only rendered if it has any content.)

Accessibility Reference for the two issues mentioned above:
http://www.w3.org/TR/WCAG10-CSS-TECHS/#style-rules
http://www.w3.org/TR/WCAG10-CSS-TECHS/#text-not-images

Tags: bug zope
Revision history for this message
Andreas Jung (ajung) wrote :

Status: Pending => Accepted

 Supporters added: ajung

Revision history for this message
Andreas Jung (ajung) wrote :

Status: Accepted => Resolved

Fixed for 2.7.4, 2.8a2.

Revision history for this message
Tres Seaver (tseaver) wrote :

Status: Resolved => Accepted

The 'alt' attribute and the corresponding '_properties' entry
got added to OFS.Image.File; however, they are shadowed by the
'_properties' of OFS.Image.Image, which leaves the user with no
way to adjust the 'alt' property for the only objects where it
matters.

Revision history for this message
Tres Seaver (tseaver) wrote :

Released w/ Zope 2.9.5 and 2.10.0.

Changed in zope2:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.