GNOME Bugzilla – Bug 509809
We should try to do a better job of guessing labels in poorly-coded forms
Last modified: 2008-07-22 19:33:24 UTC
From Mike via email: ------------------------------------------------ Hey Joanie, did you get this message from Aaron? Notice how poorly we do with this form. Mike -------- Original Message -------- Subject: Seeking feedback on per-URL screen reader scripts thread Date: Tue, 15 Jan 2008 14:22:13 -0500 From: Aaron M Leventhal <aleventh@us.ibm.com> To: Aaron M Leventhal <aleventh@us.ibm.com> Please see the mozilla.dev.accessibility newsgroup or the mailing list equivalent (its the same discussion list). Here is the mailing list signup page: https://lists.mozilla.org/listinfo/dev-accessibility - Aaron ------------------------------------------------ Observations and a patch to follow.
Happily we read that form correct by line and the braille seems to be correct. What we are not doing a spectacular job with is trying to guess the label. That's the trouble with guessing. If we're too liberal with our guessing, we'll speak all sorts of irrelevant stuff. If we're too strict, we don't guess the label. This is failing the guessing label from line test because that checks to see if the object is contained in a form. There's a form tag in there alright and it precedes the other elements in the form. But that form tag is not in the ancestry of the items we're looking at. Therefore, we suspect our candidate label is outside of the form and as a result likely not a label. Guess label from table is failing because we've apparently got a paragraph in our ancestry. This too was designed to minimize erroneous guesses, but I *suspect* (guess even) that it's safe to set our stop ancestor to the table rather than the document frame. That seems to solve the problem.
Created attachment 102959 [details] [review] revision 1 This causes the non-labeled entries to have the correct text guessed for them. I'll look at radio buttons next. BTW, pylinted; not regression tested. I need to update existing tests and write more tests -- including some for label guess.
Created attachment 102963 [details] [review] also guess radio buttons correctly Once again, our radio buttons don't technically live inside the form. <sigh> The only solution I see is to give radio buttons a free pass. We currently have a 50 pixel maximum distance requirement for guessing text that's on the right so we shouldn't guess too much junk.
Ahhhh much better. thanks much
You bet! As I observed in comment #2, I really need to focus on regression tests over the next couple of days and will be a lot happier if I do that before committing this patch (and a couple of others). Therefore, I'm going to put this in the status of [testing required] for now.
I wrote some additional regression tests. This patch does introduce any regressions (at least based upon our tests), pylints to 10.0, and should be pretty safe given the nature of the change. Therefore, I've committed this patch and am moving this bug to pending.
This one fixes a variety of sites. thanks much
Thanks Mike. Closing as FIXED.