[Mac] Various form element states not communicated to VoiceOver

RESOLVED FIXED in mozilla15

Status

()

Core
Disability Access APIs
P2
normal
RESOLVED FIXED
6 years ago
5 years ago

People

(Reporter: MarcoZ, Unassigned)

Tracking

(Blocks: 1 bug)

Trunk
mozilla15
x86_64
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

6 years ago
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.
(Reporter)

Comment 1

6 years ago
Must be dealt with, but not for the very first round, unless it gets fixed alongside another p1 or p2 bug.
Priority: -- → P2
Created attachment 616204 [details] [diff] [review]
Implement required and invalid element states. r=
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.
(Reporter)

Comment 6

5 years ago
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 8

5 years ago
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
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.