Bug 35107 - A hyperlink in writer document doesn't expose correct role and URL to AT-SPI.
Summary: A hyperlink in writer document doesn't expose correct role and URL to AT-SPI.
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.3.0 release
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: accessibility
Depends on:
Blocks: a11y-Linux 77679
  Show dependency treegraph
 
Reported: 2011-03-08 01:14 UTC by Dattatray Bhat
Modified: 2017-10-12 07:58 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Accerciser screen-shot: hyperlink exposes ROLE_PARAGRAPH, and no URL to AT-SPI. (184.04 KB, image/png)
2011-03-08 01:14 UTC, Dattatray Bhat
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dattatray Bhat 2011-03-08 01:14:56 UTC
Created attachment 44220 [details]
Accerciser screen-shot: hyperlink exposes ROLE_PARAGRAPH, and no URL to AT-SPI.

A hyperlink in Libre Office writer document doesn't expose the correct role and URL to AT-SPI. It exposes ROLE_PARAGRAPH and no URL. If it would expose the correct role (ROLE_LINK or some other appropriate role) and the URL, assistive tools like a screen reader can use the information to improve accessibility of the document.

Steps to reproduce:
1. Start Libre Office writer. Create a new text document. Add a hyperlink with text 'http://www.libreoffice.org/', targeted to 'http://www.libreoffice.org/'. Save the document.

2. Start Accerciser accessibility explorer.

3. Go to the accessible tree view at top left. As shown in attached
screen-shot, select the accessible object corresponding to the hyperlink just
created. The Role column shows 'paragraph'.

4. In the plug-in view at top right, select Interface Viewer. The first line
shows the role as 'paragraph'. The table under Hypertext shows the start and
end offsets for the hyperlink text, but no URI.

5. Go to the IPythonConsole at bottom.
   acc.queryText().getText(0,27) returns text 'http://www.libreoffice.org/'.
   acc.getRole() returns ROLE_PARAGRAPH.
   acc.queryHypertext().getNLinks() returns 1, indicating one link.
   acc.queryHypertext().getLink(0) returns a Hyperlink object.
   acc.queryHypertext().getLink(0).nAnchors returns 1, indicating one anchor.
   acc.queryHypertext().getLink(0).getURI(0) returns '', not the URL.
Comment 1 Björn Michaelsen 2011-12-23 11:49:15 UTC Comment hidden (obsolete)
Comment 2 Dattatray Bhat 2011-12-26 22:55:36 UTC
Today I rechecked my observation with Libre Office dev 3.5.0 beta2 and found
that the bug persists. I suggest that the bug be moved back to NEW status.
Comment 3 Florian Reisinger 2012-08-14 14:01:49 UTC Comment hidden (obsolete)
Comment 4 Florian Reisinger 2012-08-14 14:02:52 UTC Comment hidden (obsolete)
Comment 5 Florian Reisinger 2012-08-14 14:07:26 UTC Comment hidden (obsolete)
Comment 6 Florian Reisinger 2012-08-14 14:09:32 UTC Comment hidden (obsolete)
Comment 7 Joanmarie Diggs 2012-08-14 14:33:30 UTC
I don't know how I missed the bugmail, but this was never addressed.
Comment 8 Florian Reisinger 2012-08-15 11:35:16 UTC
Okay
Comment 9 Christophe Strobbe 2013-08-07 16:27:11 UTC
Corresponding Apache OpenOffice bug: https://issues.apache.org/ooo/show_bug.cgi?id=117206
Comment 10 Jacobo Aragunde Pérez 2014-02-04 14:29:59 UTC
I'm taking this, the solution can be related to bug #35105
Comment 11 Jacobo Aragunde Pérez 2014-02-04 16:50:12 UTC
Actually, links don't work like that. The paragraph should still have the ATK_PARAGRAPH role, and it has a hypertext interface through which we would be able to query the hyperlinks contained in that paragraph. It can be checked from accerciser in the interface viewer tab or with acc.queryHypertext() from the IPython console.

Anyway, there is still a bug; in 4.3 (master) there is no information about hyperlinks at all in that interface. In an older version, 4.1.4, it does, although some fields are missing (Uri fields seems to be so).
Comment 12 Jacobo Aragunde Pérez 2014-02-04 20:59:14 UTC
Some facts about hyperlinks in master after further investigation:
* It does expose the hyperlinks throught the hypertext interface correctly.
* Hyperlink objects got through that interface contain proper start and end positions and Uri.
* Hyperlink objects got through that interface do not implement get_object properly.
Comment 13 Jacobo Aragunde Pérez 2014-02-14 10:02:26 UTC
The implementation of hyper_link_get_object [1] is incorrect; it should return the associated ATK object, according to ATK docs [2], but it actually gets a string with the destination URL, tries to transform it into an accessible object, crashes in that transformation and returns nothing.

To fix the problem it looks like we should call XAccessibleHyperlink::getAccessibleActionAnchor instead of XAccessibleHyperlink::getAccessibleActionObject from hyper_link_get_object, but there is also a problem here; getAccessibleActionAnchor may also return a string according to the docs [3], which cannot be transformed into an accessible object either.

We have to think a bit how the implementation of hyper_link_get_object should be. What does 'the associated ATK object' mean? The paragraph that contains the hyperlink, the text chunk with the link...?

[1] http://opengrok.libreoffice.org/xref/core/vcl/unx/gtk/a11y/atkhypertext.cxx#73
[2] https://developer.gnome.org/atk/unstable/AtkHyperlink.html#atk-hyperlink-get-object
[3] http://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1accessibility_1_1XAccessibleHyperlink.html#a293f7cf73fb1030059aa993133726d53
Comment 14 Jacobo Aragunde Pérez 2014-02-19 08:46:29 UTC
In a conversation with the maintainer of ATK, he pointed out that we are missing one piece in this puzzle, which is AtkHyperlinkImpl [1] type. The paragraph should have a set of children of this type, one for each hyperlink, and at the same time the AtkHyperlink objects returned through the AtkHypertext interface of the paragraph should return the corresponding AtkHyperlinkImpl object in their implementation of get_object.

[1] https://developer.gnome.org/atk/unstable/atk-AtkHyperlinkImpl.html
Comment 15 Xisco Faulí 2017-10-12 07:58:37 UTC
Dear Jacobo Aragunde Pérez,
This bug has been in ASSIGNED status for more than 3 months without any activity. Resetting it to NEW.
Please assigned it back to yourself if you're still working on this.