GNOME Bugzilla – Bug 732340
ev-link-accessible: Improve efficiency of methods to get start and end indices
Last modified: 2014-06-28 20:01:42 UTC
Created attachment 279392 [details] [review] proposed patch Currently ev_hyperlink_get_start_index and ev_hyperlink_get_end_index calculate the indices each and every time they are asked for by an AT. Because this is done by iterating through all the character rects on the page, we should store the value once we've figured it out. In addition, ev_hyperlink_get_end_index starts the calculation from the last character rect on the page and works backwards to the first. Odds are that the end index is significantly closer to the start index rather than it is to the end of the page. In addition, I cannot think of a reason why an AT would want the end index but not want the start index (i.e. we'll have to calculate the start index anyway). So we should begin the calculation of the end index from the character immediately after the start index. Lastly, I propose this fix be applied to both 3.12 and 3.13. (I discovered the inefficiency debugging a crash in 3.12. Fixing just the crash is trivial, so if we don't want to fix the efficiency issue for 3.12, please let me know and I'll do a separate bug and fix for that.)
Review of attachment 279392 [details] [review]: Excellent, push it to both branches.
Comment on attachment 279392 [details] [review] proposed patch Thanks! gnome-3-12: 673cfbe master: 1a6c9df