Last Comment Bug 718690 - [Mac] Various form element states not communicated to VoiceOver
: [Mac] Various form element states not communicated to VoiceOver
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Disability Access APIs (show other bugs)
: Trunk
: x86_64 Mac OS X
: P2 normal (vote)
: mozilla15
Assigned To: Nobody; OK to take it and work on it
:
: alexander :surkov
Mentors:
http://www.marco-zehe.de/examples/tut...
Depends on:
Blocks: osxa11y
  Show dependency treegraph
 
Reported: 2012-01-17 09:02 PST by Marco Zehe (:MarcoZ)
Modified: 2012-04-25 07:20 PDT (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Implement required and invalid element states. r= (2.02 KB, patch)
2012-04-18 10:47 PDT, Hubert Figuiere [:hub]
surkov.alexander: review+
Details | Diff | Splinter Review

Description Marco Zehe (:MarcoZ) 2012-01-17 09:02:59 PST
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.
Comment 1 Marco Zehe (:MarcoZ) 2012-01-18 07:00:37 PST
Must be dealt with, but not for the very first round, unless it gets fixed alongside another p1 or p2 bug.
Comment 2 Hubert Figuiere [:hub] 2012-04-18 10:47:33 PDT
Created attachment 616204 [details] [diff] [review]
Implement required and invalid element states. r=
Comment 3 Hubert Figuiere [:hub] 2012-04-18 10:49:09 PDT
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.
Comment 4 Trevor Saunders (:tbsaunde) 2012-04-18 12:19:21 PDT
> ::: 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
Comment 5 Hubert Figuiere [:hub] 2012-04-18 12:46:57 PDT
(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 6 Marco Zehe (:MarcoZ) 2012-04-19 02:21:29 PDT
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...
Comment 7 Hubert Figuiere [:hub] 2012-04-19 20:40:58 PDT
(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 alexander :surkov 2012-04-22 22:40:10 PDT
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
Comment 9 Hubert Figuiere [:hub] 2012-04-23 15:29:31 PDT
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. :-)

Note You need to log in before you can comment on or make changes to this bug.