RESOLVED FIXED Bug 56737
[GTK] [Stable] AtkHypertext exposes wrong offsets for links placed inside <span> nodes
https://bugs.webkit.org/show_bug.cgi?id=56737
Summary [GTK] [Stable] AtkHypertext exposes wrong offsets for links placed inside <sp...
Mario Sanchez Prada
Reported 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...
Attachments
Patch proposal + Unit test (7.87 KB, patch)
2011-03-21 06:15 PDT, Mario Sanchez Prada
mrobinson: review+
Mario Sanchez Prada
Comment 1 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
Martin Robinson
Comment 2 2011-03-21 09:16:40 PDT
Comment on attachment 86313 [details] Patch proposal + Unit test Looks sane to me!
Mario Sanchez Prada
Comment 3 2011-03-21 09:32:48 PDT
Note You need to log in before you can comment on or make changes to this bug.