HTML_CodeSniffer icon indicating copy to clipboard operation
HTML_CodeSniffer copied to clipboard

<noscript> false positive

Open mfairchild365 opened this issue 10 years ago • 2 comments

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.

mfairchild365 avatar Jun 15 '15 16:06 mfairchild365

Hi Michael,

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

I'd need to look into the effects of

luketw avatar Nov 04 '15 06:11 luketw

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.

ironikart avatar Aug 25 '16 23:08 ironikart