Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Shaarli W3C compliant #64

Closed
nodiscc opened this issue Dec 1, 2014 · 7 comments
Closed

Make Shaarli W3C compliant #64

nodiscc opened this issue Dec 1, 2014 · 7 comments
Labels
cleanup code cleanup and refactoring please test
Milestone

Comments

@nodiscc
Copy link
Member

nodiscc commented Dec 1, 2014

Originally reported at sebsauvage#192

http://validator.w3.org/ reports 141 errors and 34 warnings on my Shaarli.

@nodiscc nodiscc added the cleanup code cleanup and refactoring label Dec 1, 2014
@nodiscc nodiscc added this to the 0.9beta milestone Dec 2, 2014
@virtualtam
Copy link
Member

Running the W3C validator on the public pages of a Shaarli instance containing links to various media (URLs, notes, images, videos), I spotted the following (and easily fixeable) issues:

All pages

  • the stylesheet URL is not compliant;
  • the alt attribute is mandatory for images.

Home page

  • & is not escaped in QRcode links (redundant with Move QR code as a plugin #57?);
  • the name attribute is obsolete for links;
  • paging IDs are duplicated (top and bottom), classes should be used instead;
  • specifying Javascript as the <script> language is deprecated.

Tag cloud, Picture wall

  • <center> is deprecated.

Picture wall

  • the template declares <div class="picwall_container">, which should be an ID (which is the case in the CSS).

Daily

Install page

  • the action attribute of the install form must be non-empty;
  • the valign attribute on the td element is obsolete.

ArthurHoaro added a commit to ArthurHoaro/Shaarli that referenced this issue Dec 12, 2014
ArthurHoaro added a commit to ArthurHoaro/Shaarli that referenced this issue Jan 7, 2015
ArthurHoaro added a commit to ArthurHoaro/Shaarli that referenced this issue Jan 7, 2015
  * fix duplicate IDs - #paging_older, #paging_newer become classes as the paging is displayed twice (top, bottom) in the linklist
  * fix duplicate IDs - #paging_privatelinks and #paging_linksperpage become classes
  * daily links are now valid (use &amp)
  * name attribute is not used anymore on a tag in link list
  * center tag is replaced by CSS in picwall and tag cloud
  *
  * action in form tag can't be empty, use # instead
  * fixed configure table with CSS instead of cellpadding, border, and valign
  * export links are now valid
  * remove "size" in input tag
ArthurHoaro added a commit to ArthurHoaro/Shaarli that referenced this issue Jan 8, 2015
  * fix duplicate IDs - #paging_older, #paging_newer become classes as the paging is displayed twice (top, bottom) in the linklist
  * fix duplicate IDs - #paging_privatelinks and #paging_linksperpage become classes
  * daily links are now valid (use &amp)
  * name attribute is not used anymore on a tag in link list
  * center tag is replaced by CSS in picwall and tag cloud
  * action in form tag can't be empty, use # instead
  * fixed configure table with CSS instead of cellpadding, border, and valign
  * export links are now valid
  * remove "size" in input tag
  * Fix missing alt attributes for img elements
  * tpl/daily: Use HTML entities instead of char escape codes
  * tpl/export: fix missing </span> closing tag
  * Remove obsolete language attribute on <script> elements
nodiscc added a commit that referenced this issue Jan 9, 2015
Make Shaarli's template W3C compliant #64
@nodiscc
Copy link
Member Author

nodiscc commented Jan 15, 2015

I added checkboxes to each compliance item in the list, feel free to check them if they are resolved. @ArthurHoaro did fix some of them in fe16b01 8079dfd.

@virtualtam
Copy link
Member

Thanks for your work @ArthurHoaro, I'll take some time this weekend to take a look at the latest additions :-)

@virtualtam
Copy link
Member

Hi, here are the last remaining issues ;-)

All pages

  • the stylesheet URL is not compliant;

still present when using a custom CSS: touch inc/user.css should make it appear in the validator:

Error Line 11, Column 81: Bad value inc/user.css?version=0.0.42 beta for attribute href on element link: Illegal character in query: not a URL code point.

…ink type="text/css" rel="stylesheet" href="inc/user.css?version=0.0.42 beta" />

Syntax of URL:
    Any URL. For example: /hello, #canvas, or http://example.org/. Characters should be represented in NFC and spaces should be escaped as %20.
  • the alt attribute is mandatory for images

QRcode images are missing the alt="Some alternative name" attribute; maybe alt could be used instead of title (see http://www.w3.org/wiki/HTML/Elements/img)?

Line XX, Column YY: An img element must have an alt attribute, except under certain conditions. For details, consult guidance on providing text alternatives for images.

….domain.tld/?BqqvMx"><img src="images/qrcode.png" title="QR-Code"></a></div> -

@dper
Copy link

dper commented Jan 19, 2015

The alt and title tags are not the same. The former is displayed when the image doesn't or can't load. The latter shows up on mouseovers. If you don't know what to use as an alt value, a reasonable idea is the name of the image file itself.

@virtualtam
Copy link
Member

@dper hence the link to the W3 documentation.

The point here is that QRcode images are missing an alt attribute, and may not necessarily need to have title="QR-Code" defined (it doesn't bring anything, semantically speaking).

An alternative could be to provide all QR images with meaningful values of alt and title, e.g.

<img src="images/qrcode.png" alt="QR-Code" title="QR-Code for <link timestamp>">

@dper
Copy link

dper commented Jan 19, 2015

@virtualtam Yes. That's why I offered a suggestion of something that already exists and is meaningful. :-) You can make the alt tag be the file name, if you don't have a better option, and it's informative to a certain degree.

I agree that the title tag is probably not needed. Having hover text of QR-code on a QR code is not very pointful. People looking at the image will probably notice what it is when they look at it.

pikzen pushed a commit to pikzen/Shaarli that referenced this issue Jan 21, 2015
  * fix duplicate IDs - #paging_older, #paging_newer become classes as the paging is displayed twice (top, bottom) in the linklist
  * fix duplicate IDs - #paging_privatelinks and #paging_linksperpage become classes
  * daily links are now valid (use &amp)
  * name attribute is not used anymore on a tag in link list
  * center tag is replaced by CSS in picwall and tag cloud
  * action in form tag can't be empty, use # instead
  * fixed configure table with CSS instead of cellpadding, border, and valign
  * export links are now valid
  * remove "size" in input tag
  * Fix missing alt attributes for img elements
  * tpl/daily: Use HTML entities instead of char escape codes
  * tpl/export: fix missing </span> closing tag
  * Remove obsolete language attribute on <script> elements
@virtualtam virtualtam modified the milestones: 0.9.0, 0.5.0 Jul 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup code cleanup and refactoring please test
Projects
None yet
Development

No branches or pull requests

3 participants