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

Ignore rel="stylesheet" in H59 "Using the link element and navigation tools" #2297

Closed
Maxim-Mazurok opened this issue Apr 5, 2022 · 6 comments

Comments

@Maxim-Mazurok
Copy link

Maxim-Mazurok commented Apr 5, 2022

I'm trying to add <link rel="stylesheet" href="blabla.css"> in the HTML body, but rule H59 (WCAG2AAA.Principle2.Guideline2_4.2_4_8.H59.1) doesn't let me: "Link elements can only be located in the head section of the document."

In the description, it says:

Several values of rel are useful:

Start
Next
Prev
Contents
Index

So, I think there's not much sense in preventing me from putting styles in HTML, because "stylesheet" is definitely not a navigation link.

Either we can exclude "stylesheet" as the most popular type of link. Or we can include only Start, Next, etc. into checks.

Or we can go one step further and get rid of this technique completely, but I didn't do much research on this. See #1234 and #1036 by @patrickhlauke

@bruce-usab
Copy link
Contributor

It would not have occurred to me that link could be anywhere but HEAD but, sure enough, body-ok is a link attribute.

Late-loading stylesheets seems like the sort of thing that could easily trip up AT.

@patrickhlauke
Copy link
Member

patrickhlauke commented Apr 5, 2022 via email

@Maxim-Mazurok
Copy link
Author

body-ok is a link attribute.

Wow, that's a great find!

Late-loading stylesheets seems like the sort of thing that could easily trip up AT.

Yes, that's exactly why I'm putting it there, so that browser will only start loading style once it loaded preceding HTML, so it renders before applying additional cosmetic non-layout styles. Not sure who is AT...

@Maxim-Mazurok
Copy link
Author

Maxim-Mazurok commented Apr 5, 2022

Note that this error/failure you're seeing has nothing to do with H59. The error you're getting appears to be something related to squizlab's code checker and its own set of checks/rules. At a stretch, this may be a mild failure of 4.1.1 but certainly unrelated to 2.4.5

I'm not using squizlab, I'm using https://github.com/pa11y/pa11y

Nevermind, I guess that pa11y uses squizlab.

image

@Maxim-Mazurok
Copy link
Author

I think I misread the procedure on w3c website, it does say to check links related to navigation. Even though it doesn't say to check only links related to navigation, I still think that there's not much to fix here (apart from potentially removing this, which has 2 other open issues).
So I opened one here: squizlabs/HTML_CodeSniffer#306
And closing this one, cheers!

@bruce-usab
Copy link
Contributor

@Maxim-Mazurok -- My apologies: AT is assistive technology. An example is the JAWS screen reading software, used by many MS Windows users who are blind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants