Closed Bug 718690 Opened 12 years ago Closed 12 years ago

[Mac] Various form element states not communicated to VoiceOver

Categories

(Core :: Disability Access APIs, defect, P2)

x86_64
macOS
defect

Tracking

()

RESOLVED FIXED
mozilla15

People

(Reporter: MarcoZ, Unassigned)

References

()

Details

Attachments

(1 file)

In this sample form: http://www.marco-zehe.de/examples/tutorial_html5_form_validation_and_aria.html, the following states are not spoken by VoiceOver:

1. The "required" and "invalid" states on the "name" and "e-mail" fields.
2. The multiline state on the "message" field.

Safari can do this.
Must be dealt with, but not for the very first round, unless it gets fixed alongside another p1 or p2 bug.
Priority: -- → P2
Comment on attachment 616204 [details] [diff] [review]
Implement required and invalid element states. r=

Review of attachment 616204 [details] [diff] [review]:
-----------------------------------------------------------------

::: accessible/src/mac/mozTextAccessible.mm
@@ +118,5 @@
>    }
>  
> +  if ([attribute isEqualToString:@"AXRequired"])
> +    return [NSNumber numberWithBool:
> +      (mGeckoAccessible->State() & states::REQUIRED) ? YES : NO];

And yes, I need this long form as it seems that the implicit type conversion to BOOL does not do what one expect.
Attachment #616204 - Flags: review?(surkov.alexander)
> ::: accessible/src/mac/mozTextAccessible.mm
> @@ +118,5 @@
> >    }
> >  
> > +  if ([attribute isEqualToString:@"AXRequired"])
> > +    return [NSNumber numberWithBool:
> > +      (mGeckoAccessible->State() & states::REQUIRED) ? YES : NO];
> 
> And yes, I need this long form as it seems that the implicit type conversion
> to BOOL does not do what one expect.

I assume the standard !! trick doesn't help?

does mac only support these states on text accessibles? I'd think you could find cases where someone sets aria-required / invalid on stuff other than text accessibles
(In reply to Trevor Saunders (:tbsaunde) from comment #4)
> > ::: accessible/src/mac/mozTextAccessible.mm
> > @@ +118,5 @@
> > >    }
> > >  
> > > +  if ([attribute isEqualToString:@"AXRequired"])
> > > +    return [NSNumber numberWithBool:
> > > +      (mGeckoAccessible->State() & states::REQUIRED) ? YES : NO];
> > 
> > And yes, I need this long form as it seems that the implicit type conversion
> > to BOOL does not do what one expect.
> 
> I assume the standard !! trick doesn't help?

I didn't try (didn't think of it). I will.

> does mac only support these states on text accessibles? I'd think you could
> find cases where someone sets aria-required / invalid on stuff other than
> text accessibles

It is not really documented, so maybe I should actually make a test case and test in Safari to see what it going on.
Comment on attachment 616204 [details] [diff] [review]
Implement required and invalid element states. r=

What about an indication that a textfield is multiline (e. g. a textarea)? Would that be possible to implement here, too? we currently don't indicate it. So does Safari, but if we can make this better...
(In reply to Marco Zehe (:MarcoZ) from comment #6)
> Comment on attachment 616204 [details] [diff] [review]
> Implement required and invalid element states. r=
> 
> What about an indication that a textfield is multiline (e. g. a textarea)?
> Would that be possible to implement here, too? we currently don't indicate
> it. So does Safari, but if we can make this better...

Is that specific to Lion ? I don't get anything different in Snow Leopard.
Anyway there are actually other bugs with multi-line text area including line number for caret being wrong. I'll look at that again, maybe I missed something.
Comment on attachment 616204 [details] [diff] [review]
Implement required and invalid element states. r=

Review of attachment 616204 [details] [diff] [review]:
-----------------------------------------------------------------

::: accessible/src/mac/mozTextAccessible.mm
@@ +79,5 @@
>        NSAccessibilityNumberOfCharactersAttribute, // required
>        NSAccessibilityVisibleCharacterRangeAttribute, // required
>        NSAccessibilityInsertionPointLineNumberAttribute,
> +      @"AXRequired",
> +      @"AXInvalid",

technically invalid and required states applied to any element accessible but if OS X wants them on text accessibles only then ok.

@@ +122,5 @@
> +      (mGeckoAccessible->State() & states::REQUIRED) ? YES : NO];
> +
> +  if ([attribute isEqualToString:@"AXInvalid"])
> +    return [NSNumber numberWithBool:
> +      (mGeckoAccessible->State() & states::INVALID) ? YES : NO];

btw, if you like then you could wrap 'if' by { } since its single statements takes more than one line
Attachment #616204 - Flags: review?(surkov.alexander) → review+
Comment on attachment 616204 [details] [diff] [review]
Implement required and invalid element states. r=

Review of attachment 616204 [details] [diff] [review]:
-----------------------------------------------------------------

::: accessible/src/mac/mozTextAccessible.mm
@@ +122,5 @@
> +      (mGeckoAccessible->State() & states::REQUIRED) ? YES : NO];
> +
> +  if ([attribute isEqualToString:@"AXInvalid"])
> +    return [NSNumber numberWithBool:
> +      (mGeckoAccessible->State() & states::INVALID) ? YES : NO];

Actually I used the !! operator as suggested by trevor and it all fits nicely on one line. :-)
https://hg.mozilla.org/integration/mozilla-inbound/rev/e4b911e0a259
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla15
https://hg.mozilla.org/mozilla-central/rev/e4b911e0a259
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: