Re: Behavior of setting AXVisibleCharacterRange
Re: Behavior of setting AXVisibleCharacterRange
- Subject: Re: Behavior of setting AXVisibleCharacterRange
- From: Josh Scotland <email@hidden>
- Date: Mon, 28 Oct 2013 21:46:11 -0700
Hey Boris,
The AXVisibleCharacterRange should return the character range of text that can be seen by a user. Rendered text in the app that isn’t visible shouldn’t be in the range returned.
Try doing your experiments in TextEdit. If you use “Wrap to Page" mode and shrink the scroll view, you can replicate the experiments and use AX inspector to verify results.
There are two caveats to AXVisibleCharacterRange (which are succinctly covered in the documentation) that I’ll describe in more detail:
- If multiple lines are visible, but text is clipped horizontally (meaning you can’t see the start or end of lines), the visible character range will still include the clipped start or end of lines
- If a line is clipped vertically (meaning you can only see the top or bottom half of a line), the visible character range will include that clipped line range
Josh
> On Oct 22, 2013, at 9:53 AM, Boris Dušek <email@hidden> wrote:
>
> Hello,
>
> AXVisibleCharacterRange is an attribute that can be settable. But it is a little bit unclear to me how it should behave for various requested range values to be set (and the documentation does not discuss this):
>
> Let’s suppose this scenario: a text view 10 characters wide embedded in a scroll view restricting the visible portion of the text view to be 10 lines high. That is, only 100 (or more precisely 110) characters can be displayed at a time. Let’s suppose the text view has enough text for our thought experiment (e.g. 500 characters).
>
> Questions about setting the visible range:
>
> 1. The range is longer that can be the visible portion of the text view (i.e. the setting request cannot be fully satisfied)
> E.g. how should be handled the case of setting the visible range to a range of length 200, e.g. {50, 200}?
>
> 2. The range is shorter than can be the visible portion of the text view. Is there a difference between different range lengths?
> E.g. is there a difference then between setting the visible range to {50, 20} and to {50, 40}? The only thing I could imagine is centering the requested range vertically in the scroll view (which would make a difference in this case).
>
> Maybe it would be reasonable to in any case simply ignore the length field of the range and only make sure the point corresponding to the range’s location field is at the top of the visible portion of the text field.
>
> Thanks,
> Boris
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Accessibility-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Accessibility-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden