Bug 56737 - [GTK] [Stable] AtkHypertext exposes wrong offsets for links placed inside <span> nodes
Summary: [GTK] [Stable] AtkHypertext exposes wrong offsets for links placed inside <sp...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk
Depends on:
Blocks: 25531
  Show dependency treegraph
 
Reported: 2011-03-21 05:12 PDT by Mario Sanchez Prada
Modified: 2011-03-21 09:32 PDT (History)
1 user (show)

See Also:


Attachments
Patch proposal + Unit test (7.87 KB, patch)
2011-03-21 06:15 PDT, Mario Sanchez Prada
mrobinson: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mario Sanchez Prada 2011-03-21 05:12:14 PDT
When showing ORCA's help in last version of Yelp, the offsets of hyperlinks are generally exposed wrong, since they always are reported to start in offset 0, no matter where in paragraphs they are. Check links in orca/help/C/introduction.page with Yelp, for instance, to see it yourself.

It seems the problem comes from the fact that Yelp always represents links (<link> tag in Yelp's markup, different from HTML's <link>) in a paragraph in HTML as follows:

  <p>Some text before the link <span><a href='...'>text for the link</a></span> and some text after the link</p>

The problems seems to come because current implementations of atk_hyperlink_get_start_index() and atk_hyperlink_get_end_index() are wrong, as they do not check the offset position of a link inside its immediate parent, no matter that parent is exposed to AT's (e.g. paragraphs or list items) or not (such as the <span> nodes).

So, in the example above, as the link is actually at the offset 0 for its inmediate parent (<span>) it will always return that wrong value, when it should be returning the offset inside the first unignored parent (<p>) instead.

Setting the "[GTK] [Stable]" prefix, as this is a very severe issue that should be shipped ideally with the next 1.4.0 stable release of wkgtk. 

Uploading a patch for it along with the updated tests soon...
Comment 1 Mario Sanchez Prada 2011-03-21 06:15:32 PDT
Created attachment 86313 [details]
Patch proposal + Unit test

Attaching patch proposal + updated an already present unit test to check hypertext/hyperlink stuff
Comment 2 Martin Robinson 2011-03-21 09:16:40 PDT
Comment on attachment 86313 [details]
Patch proposal + Unit test

Looks sane to me!
Comment 3 Mario Sanchez Prada 2011-03-21 09:32:48 PDT
Committed r81587: <http://trac.webkit.org/changeset/81587>