Hi,
I am getting the Iaccessible tree.  I then find that I want the text attributes 
for one of my leaf nodes and find that I have to go back up the Iaccessible 
tree to find the nearest Iaccessible node that allow QI to IAccessibleText and 
then trying to figure out how to map the result back down to my Iaccessible 
leaf node.
You can see a case by just adding a <sup> tag to a web page:
2<sup>32</sup>
And view it in firefox, there is a paragraph Iaccessible with two text 
children.  The two text children correspond to 2 and 32.  Each of these leaf 
nodes does not support the IAccessibleText but the paragraph parent does.
This is a pretty trivial case but illustrates what I am talking about.
Brett

-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of James 
Teh
Sent: Monday, November 26, 2012 1:28 PM
To: IAccessible2 mailing list
Subject: Re: [Accessibility-ia2] Plea for a new function

Hi Brett,

Out of curiosity, how are you getting the text leaf nodes in the first place? 
Ideally, this should all be done using the IAccessibleText interface on the 
parent. I'm keenly aware that there are cases where this isn't practical, but I 
thought I'd ask nevertheless.

Jamie

On 27/11/2012 5:14 AM, Brett Lewis wrote:
> Hi,
> I don't have a strong preference for a given solution.  If everyone prefers 
> implementing IAccessibleHyperLink on the leaf nodes, that is fine.
> Alex said it would be hard to implement IAccessibleText on all the text leaf 
> nodes so Jamie's IAccessibleHyperLink solution or A pair of new functions to 
> retrieve child at offset and offset of descendant seem like the only options.
> As I said, the two cases of concern for me are identifying the text 
> attributes for a given text leaf node that doesn't support IaccessibleText 
> and to obtain the rectangle enclosing specific characters in a text leaf node.
> Thanks,
> Brett
>
>
> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf 
> Of Alexander Surkov
> Sent: Tuesday, November 20, 2012 8:30 PM
> To: James Teh
> Cc: IAccessible2 mailing list
> Subject: Re: [Accessibility-ia2] Plea for a new function
>
> Hi, Jamie. I think Brett meant accessible object for text node (aka text leaf 
> accessible).
>
> In general accessible objects for text nodes aren't really necessary 
> since they dupe info that is provided by IAccessibleText on the 
> container. So there's no need for them in IA2 world, they are rather 
> MSAA heritage. However I has been told that having accessible objects 
> for text nodes is still useful for AT (I'm not really aware of
> details) and that's why we keep them in Firefox btw. This is a reason why I 
> don't want text nodes to implement IAccessibleText (besides it won't be 
> trivial to implement).
>
> IAccessibleHyperlink idea might be ok, it's not backward compatible 
> though and makes nsIAccessibleHyperText nearly useless since it dupes
> IAccessbile/IAccessbile2 methods.
>
> Having a new method that returns an offset for a child (and child by
> offset?) might be ok.
>
> Thank you.
> Alex.
>
>
> On Wed, Nov 21, 2012 at 9:11 AM, James Teh <[email protected]> wrote:
>> Hi.
>>
>> There are two problems here:
>> 1. It's unclear what is considered the "text" of a descendant node 
>> which doesn't support IAccessibleText. It could be accName, accValue, 
>> accDescription, etc. or some combination thereof.
>> 2. This assumes that a descendant node's "text" actually is contained 
>> in the ancestor IAccessibleText object, which might not be the case.
>> Of course, I guess the method could just fail if this weren't the case.
>>
>> Also, why not just implement IAccessibleText on the descendant nodes?
>>
>> In any case, I don't think a new method is required for this. You can 
>> implement IAccessibleHyperlink on the descendant nodes. The 
>> startIndex and endIndex properties of IAccessibleHyperlink should give you 
>> what you need.
>>
>> Jamie
>>
>>
>> On 21/11/2012 9:30 AM, Brett Lewis wrote:
>>>
>>> All:
>>> I have recently run into a situation for which there presently 
>>> doesn't appear to be a good solution.
>>> 1.  The problem.  I wished to obtain the attributes for the text at 
>>> a particular offset.  This is straightforward using IAccessibleText 
>>> and just asking for the attributes at the offset of interest.  The 
>>> difficulty is that the node whose text attributes I wanted didn't 
>>> support IAccessibleText.  One of its ancestors did and this ancestor 
>>> did contain information about the attributes I needed.  The question 
>>> then became, how can I find out where in a given IAccessibleText 
>>> string does a descendants node text begin.  I haven't found an easy 
>>> way to answer this question.
>>> 2.  Proposed solution:  Add a new function that returns the offset 
>>> in the current IAccessibleText text string for a given IAccessible 
>>> for a descendant. So something like:
>>> DescendantOffset(IAccessible* acc,VARIANT varChild, long* offset) I 
>>> have no strong preference for exactly how this should be handled, 
>>> just the need for such a function.
>>> I know the 1.3 version of the IAccessible2 specification is nearly 
>>> ready, but I would like to see if this new function could be included.
>>> In addition to the attributes for text at a given offset, I have 
>>> also seen a case where we needed the rectangle for particular characters.
>>> Again, in this instance, we needed to locate the nearest ancestor 
>>> supporting IAccessibleText and try to determine the offset in this 
>>> ancestor of the node of interest.
>>> What does everyone think about such an addition?
>>> Any feedback would be much appreciated.
>>> Thanks,
>>> Brett Lewis
>>>
>>>
>>> _______________________________________________
>>> Accessibility-ia2 mailing list
>>> [email protected]
>>> https://lists.linuxfoundation.org/mailman/listinfo/accessibility-ia2
>>>
>>
>> --
>> James Teh
>> Director, NV Access Limited
>> Email: [email protected]
>> Web site: http://www.nvaccess.org/
>> Phone: +61 7 5667 8372
>> _______________________________________________
>> Accessibility-ia2 mailing list
>> [email protected]
>> https://lists.linuxfoundation.org/mailman/listinfo/accessibility-ia2
> _______________________________________________
> Accessibility-ia2 mailing list
> [email protected]
> https://lists.linuxfoundation.org/mailman/listinfo/accessibility-ia2
>

--
James Teh
Director, NV Access Limited
Email: [email protected]
Web site: http://www.nvaccess.org/
Phone: +61 7 5667 8372
_______________________________________________
Accessibility-ia2 mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/accessibility-ia2
_______________________________________________
Accessibility-ia2 mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/accessibility-ia2

Reply via email to