squizlabs / HTML_CodeSniffer

HTML_CodeSniffer is a client-side JavaScript application that checks a HTML document or source code, and detects violations of a defined coding standard. Comes with standards that cover the three conformance levels of the W3C's Web Content Accessibility Guidelines (WCAG) 2.0 and the U.S. Section 508 legislation.
https://squizlabs.github.io/HTML_CodeSniffer/
BSD 3-Clause "New" or "Revised" License
1.11k stars 243 forks source link

<noscript> false positive #127

Open mfairchild365 opened 9 years ago

mfairchild365 commented 9 years ago

It is possible to place other elements, such as images in a <noscript> tag, however browsers are smart enough to not process or render any child element of the <noscript> tag. Therefor an <img> tag becomes text, which is not visible to the end user, but is accessible via the DOM. In a case where the only contents of a <noscript> tag is only an <img>, HTML_CodeSniffer could flag the <img> as a contrast error because it now text (although no text would appear if javascript was turned off).

src: https://stackoverflow.com/questions/14719111/is-an-image-within-a-noscript-tag-only-downloaded-if-javascript-is-disabled/14723273#14723273

So my question is, should HTML_CodeSniffer ignore the <noscript> tag because javascript will always be enabled when running the library.

luketw commented 8 years ago

Hi Michael,

Sorry for the delay - been flat out, but should've acknowledged it earlier.

I'd need to look into the effects of

ironikart commented 7 years ago

Leaving a comment here just to acknowledge this hasn't been forgotten. It's technically achievable to read the content inside <noscript> tags and analyse it for issues but would require new features to be able to reference those errors back to their location in the analysed document. On hold for now.