Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support text links with VoiceOver #1184

Closed
wants to merge 1 commit into from

Conversation

dusek
Copy link
Contributor

@dusek dusek commented Nov 5, 2013

Now links in text (e.g. links to RFCs after installing the Hyperlink Helper
bundle) are announced as such with VoiceOver and it is possible to search for
them with VO-Cmd-L.

TODO:

  • launching links with VO-Space is not supported yet, but Enter (Fn-Return)
    does the same thing and is even more reliable.
  • link URL is not supported, so it is not possible to learn the URL
    with VO-Shift-U.

Also I noticed when testing the accessibilityHitPoint with Accessibility Inspector
that the frame reported by layout in the links construction method (line 1476) is always
wrong in the x-axis - layout->rect_for_range returns a frame with frame.size.width == -1
and frame.origin.x some small value.

The y values (frame.size.height and frame.origin.y) appear to be correct.
What is strange that then the code for AXBoundsForRange (line 1338) also calls layout->rect_for_range
again for the same range and reports the correct frame. Any thoughts on what this
might be caused by before I investigate more? Could I be catching the layout in some
inconsistent or semi-updated state?

As always, I release the patch to the public domain. Thanks for your review.

Now links in text (e.g. links to RFCs after installing the Hyperlink Helper bundle)
are announced as such with VoiceOver and it is possible to search for them with
VO-Cmd-L.

TODO:

* launching links with VO-Space is not supported yet, but Enter (Fn-Return)
  does the same thing and is even more reliable.
* link URL is not supported, so it is not possible to learn the URL
  with VO-Shift-U.
@sorbits
Copy link
Member

sorbits commented Nov 15, 2013

Thanks, merged as 5dcca09.

Removed the strong and assign property storage keywords (default with ARC).

Changed one use of the iterate macro to use C++11’s for(… : …) (I consider the iterate macro obsoleted by the new C++11 construct).

Removed spaces after for, while, and if keywords.

Let asterisk bind to type instead of value (e.g. NSArray* var instead of NSArray *var).

Changed most opening braces to be on their own line — I left the chained if-else-if… code since it would double the number of lines — normally I would do it without braces at all.

Possibly a few other minor tweaks, but everything should be limited to syntax.

@sorbits sorbits closed this Nov 15, 2013
@dusek
Copy link
Contributor Author

dusek commented Nov 16, 2013

I reviewed the changes you made, I will try to remember those things the next time :-)

I am wondering if you noticed my question about the layout returning rect of width -1. If you have no idea or hypothesis (or time), it's fine, I will look into it myself, but if you have any idea that could maybe point me into the right direction, I would of course appreciate it.

@sorbits
Copy link
Member

sorbits commented Nov 29, 2013

Sorry, I forgot about the question.

The missing X metrics are due to lazy layout. It’s easy to estimate
the height because we can just look at the font height (except for soft
wrapped lines), so that’s why y/height is set, but not x/width.

It’s possible to call layout_t::update_metrics to force a layout, but
it takes a rectangle, not a byte range, so it’s not really useful,
also, laying out the text is surprisingly expensive, so best to not do
it before we know we actually need to also render the text.

I don’t know if this poses an actual problem; once the link has
actually been displayed on the screen, the metrics should be correct.

On 16 Nov 2013, at 18:23, Boris Dušek wrote:

I reviewed the changes you made, I will try to remember those things
the next time :-)

I am wondering if you noticed my question about the layout returning
rect of width -1. If you have no idea or hypothesis (or time), it's
fine, I will look into it myself, but if you have any idea that could
maybe point me into the right direction, I would of course appreciate
it.


Reply to this email directly or view it on GitHub:
#1184 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants