RE: Element.getComputedRole()

From: Richard Schwerdtfeger [mailto:schwer@us.ibm.com]


it is not a platform role it is the role that the browser knows about. So, in the following example:

<section role="chapter group">

If the browser knew how to map a role of chapter it would return "chapter".
If the browser did not know how to map a role of chapter then it would look to a role of group. If it knew how to map a group role it would return "group"
If the browser did not know about a role of "group" it would return the default native ost language role value for the <section> element which should be "region"

The only exception to this would be where the host language held restrictions on the use of role. For example, if you were not allowed to put a grid on <button> you would return a role of "button"



In this example, the query method is only needed because you have specified multiple (space-separated) values of the attribute. This is allowed by the ROLE attribute specification, but I would be interested to know the status of its implementation - specifically, whether user agents will successively process each value in the ROLE attribute until one is recognized, and supply a default value if not.



Where a single role is specified and it conflicts with strong host language semantics, obviously the computed role can differ from that specified as the value of the content attribute, hence there is still a use case for the query method. However, having multiple roles specified in the attribute (if and when supported) establishes a stronger case, provided of course that Web applications need to be able to determine which role has been applied to a given element node.



________________________________

This e-mail and any files transmitted with it may contain privileged or confidential information. It is solely for use by the individual for whom it is intended, even if addressed incorrectly. If you received this e-mail in error, please notify the sender; do not disclose, copy, distribute, or take any action in reliance on the contents of this information; and delete it from your system. Any other use of this e-mail is prohibited.


Thank you for your compliance.

________________________________

Received on Friday, 17 October 2014 15:01:21 UTC