WordPress.org

Ready to get started?Download WordPress

Forums

WP Flow Plus
[resolved] HTML5 Validation invalid: longdesc attribute on img element (8 posts)

  1. Shashank Shekhar
    Member
    Posted 1 year ago #

    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/

  2. Bev
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  3. Shashank Shekhar
    Member
    Posted 1 year ago #

    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.. :)

  4. Bev
    Member
    Plugin Author

    Posted 1 year ago #

    Is your lightbox working?

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

  5. viraladmin
    Member
    Posted 1 year ago #

    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.

  6. Shashank Shekhar
    Member
    Posted 1 year ago #

    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?

  7. Bev
    Member
    Plugin Author

    Posted 1 year ago #

    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"

  8. Bev
    Member
    Plugin Author

    Posted 1 year ago #

    Version 1.8.0 has now been released and fixes this issue.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic