Re: [REVIEW REQUESTED][ARIA] placeholder

On 2015-04-02 3:36 PM, Alexander Surkov wrote:
> Hey. I'm agree that placeholder has different semantics than label and 
> value but I'm still not certain about how this semantics can be used 
> by AT. The point is if there's no consumers for it then there's no 
> great benefit from having it. Iirc we started this chat before but I 
> don't recall what outcome was. SO do we have any data how AT 
> developers want to handle @placeholder? Firefox was used to map HTML 
> @placeholder into accessible name and it seems it worked fine with AT.

Given:
<input  type="text" value="" placeholder="MM-DD-YYYY">

I don't see how "MM-DD-YYYY" is a useful accessible name.  An AT 
presenting "MM-DD-YYYY" might communicate that a date is needed. But 
which date?

I suggest a "placeholder" property for accessible objects.  AX API 
already supports one.  The accessible would look something like:

{
   role: textEntry,
   name: "",
   description: ""
   value: "",
   placeholder: "MM-DD-YYYY",
   ...
}

The AT could then take this approach given the above accessible:
1. Use the accessible name if present,
2. Otherwise, use the accessible description,
3. Otherwise, use the placeholder.

In other words, the browser maps the different pieces of information to 
different accessible properties.  The AT decides how to use that 
information.

Also, in general, the AT needs to know that this text is placeholder 
text.  Since the purpose of @placeholder is to provide a clue as to the 
format of the input value, then the AT needs to communicate that as 
well.   For example, if a screen reader knows that the text is 
*placeholder* text, it can point that out.  It can say "the placeholder 
for this text entry is 'MM-DD-YYYY'".  If the placeholder text is mapped 
to the accessible name, the screen reader no longer has any idea about 
placeholders.  All it can say is, "text entry named 'MM-DD-YYYY'", and 
the whole point of having a @placeholder is lost.

> I'm not sure I agree that placeholder cannot be used instead of label.

Sure, if that's all the author provided.  But I don't think that's the 
browser's decision to make.

-- 
;;;;joseph.

'Array(16).join("wat" - 1) + " Batman!"'
            - G. Bernhardt -

Received on Thursday, 2 April 2015 20:52:36 UTC