-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Still requires patch on mCaptcha's side to provide good iframe settings & good CSS on widget HTML.
- Loading branch information
Gusted
committed
Jul 26, 2022
1 parent
08790c5
commit 0789b33
Showing
2 changed files
with
8 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0789b33
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, in my opinion that label tag is not usable because it doesn't have the for attribute nor does it contain an input, so it could affect accessibility. A stylized title would be fine but I think it is not necessary if the tag is around or for the token input in the widget. However, a hidden input type for the token would be better if there is a title for all the captcha stuff and not an orphaned label.
The widget is already in production so my suggestion here and there might break the presentation in those places, and further complicate the situation, but I think it would improve its usability.
0789b33
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, didn't thought about that. However due to the styling that's used by Gitea, an
<label>
needs to be placed there and on Mobile it looked nicer with actual "Captcha" as content.It's not a big deal if it's removed, however what would be the best way to still have that element there but not affect accessibility? An
aria-hidden=true
attribute perhaps?0789b33
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Gitea semantic is ok for the
login
andpassword
because they have theirfor
attribute pointing to their<input>
. But in this case, the interactive input (checkbox) is in the iframe, out of this form, so the label and the token input doesn't have interactive meaning in the form and it will be ok if both were hidden. But, if you add the aria-hidden attribute to that label, where the accessibility reader read the Captcha word? They only read the mutable label of the checkbox (if they can).That's what the reason to thinking in a title more than a label tag (always associated with an input). But yes, it must be a stylized title that doesn't break the whole composition. One can think in a legend tag, but this form doesn't have fieldset containers and that change would be more complicated.0789b33
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might misunderstand you here, so correct me if I'm wrong. If I read your comment correctly, when the code is like:
It will be more correct for a screen reader and be more understandable towards the user about that this is a captcha?
0789b33
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, when I wrote title I was thinking of a
<h5>
or a<span>
with a css style that provides identical behaviour to<label>
, not a title attribute. Your idea looks good but I just doubt whether the focus goes to the container div before the checkbox, which should be ideal, so I'm not entirely sure. You have to think that the reader is iterating through the elements giving focus each one at a time and playing sound the associated text, so if the focus goes first to the checkbox rather than the container div, the experience can be weird.But maybe sufficient at this stage.
On the other hand, I'm trying to find out why this html is not proposed in the mcaptcha module or in a code in the widget but in this template. I have seen that the empty tag is not needed in recaptcha or hcaptcha, can you please explain?
0789b33
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that's a bit of a problem. Gitea's current layout relies on having a
<label>
there. It should be fine if<span>
is also considered "okay" for the current layout.They are propagated by external code and they actually should have a label with captcha IMO, but not the scope of this PR. So this is the more correct version.
For the mCaptcha code we just provide a base container(and should handle dimensions, styling, accessibility etc.) and the code will just attach mCaptcha's widget into a iframe onto that container.
0789b33
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understood. Thank you.
0789b33
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fsologureng FYI, f4e417b replaced the label with span. So it's now mCaptcha's job to provide a widget which is accessible(which is easier to do).
0789b33
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good :)