WordPress.org

Support

Support » Plugins and Hacks » [Resolved] HTML5 Validation invalid: longdesc attribute on img element

[Resolved] HTML5 Validation invalid: longdesc attribute on img element

  • The plugin is great, but its generating the wrong html/html5 for the imageflow. I am using html5 site with wp 3.5 and wp-imageflow2 plus 1.7.2.
    The w3c validator giving following error:

    “The longdesc attribute on the img element is obsolete. Use a regular a element to link to the description.”

    The current generated wrong html is:
    <img src=”http://www.mysite.com/wp-content/plugins/wp-imageflow2/php/reflect2.php?img=http%3A%2F%2Fwww.mysite.com%2Fwp-content%2Fuploads%2F2012%2F01%2Fimage.png&bgc=%234E5162″ longdesc=”http://www.site1.com” alt=”altvalue” />

    The valid html can be like:
    <img src=”http://www.mysite.com/wp-content/plugins/wp-imageflow2/php/reflect2.php?img=http%3A%2F%2Fwww.mysite.com%2Fwp-content%2Fuploads%2F2012%2F01%2Fimage.png&bgc=%234E5162″ title=”http://www.site1.com” alt=”altvalue” />

    Means we can use title in place of longdesc to make it valid html.
    Please fix it inside the plugin.

    http://wordpress.org/extend/plugins/wp-imageflow2/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Bev

    @bstofko

    Unfortunately it is not as simple as that as the title is used elsewhere. I will look into this issue for the next major release.

    There is no ‘title’ attribute rendered inside img attributes by default, so I hv just changed some code in the plugin and replaced ‘longdesc’ with ‘title’, worked at my place.
    But as you saying may be it used for some purpose, so data-attributes, rel or some other parameter may be used…
    Lets see what u gonna include in next release.. 🙂

    Plugin Author Bev

    @bstofko

    Is your lightbox working?

    Anyways, title is important for accessibility so I would prefer another method.

    HTML5 has made longdesc obsolete and trying to replace it with title tag, is useless as the title tag does not help people with visual disabilities… and that is the purpose of a longdesc.

    To replace longdesc in html5 you should instead use the combination of explicit links, figure captions, and the attribute aria-describedby.

    Thanks for the hint and help Viraladmin, it was knowledgefull, me and plugin author both didn’t know about the best replacement for ‘longdesc’.
    But I don’t think that the author used longdesc earlier keeping the people with visual disabilities in mind. He just made it that time what he liked too, but now its the concern of w3c validation.
    I am waiting for the author to take the right step and make all right!

    —-
    Further, just for more help, could you please put some example html code how it can be done with the right attribute without much changing the current code and achieve validation without breaking functionality?

    Plugin Author Bev

    @bstofko

    The most likely candidate is the use of html5 custom data attribute:

    http://www.w3.org/html/wg/drafts/html/master/dom.html#embedding-custom-non-visible-data-with-the-data-attributes

    I am in the middle of a project right now so I won’t have a chance to try it out for a while. You could give it a shot by replacing all occurrences of “longdesc” with something like “data-wpif2”

    Plugin Author Bev

    @bstofko

    Version 1.8.0 has now been released and fixes this issue.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Resolved] HTML5 Validation invalid: longdesc attribute on img element’ is closed to new replies.