Bug 35105 - A heading in writer document doesn't expose ROLE_HEADING to AT-SPI.
Summary: A heading in writer document doesn't expose ROLE_HEADING to AT-SPI.
Status: RESOLVED FIXED
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: Jacobo Aragunde Pérez
URL:
Whiteboard: target:4.3.0 unitTestNotes:16
Keywords:
Depends on:
Blocks: a11y-Linux
  Show dependency treegraph
 
Reported: 2011-03-08 00:40 UTC by Dattatray Bhat
Modified: 2023-10-18 15:33 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Accerciser screen-shot, a heading exposes ROLE_PARAGRAPH. (160.85 KB, image/png)
2011-03-08 00:40 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 00:40:57 UTC
Created attachment 44219 [details]
Accerciser screen-shot, a heading exposes ROLE_PARAGRAPH. 

A heading in writer document doesn't expose ROLE_HEADING to AT-SPI. It exposes ROLE_PARAGRAPH. If it exposes the correct role viz.ROLE_HEADING, 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 some text e.g. 'This is a heading'. Apply style 'Heading 1' to the text. 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 heading 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 text box shows the heading text.

5. Go to the IPythonConsole at bottom. A command acc.getRole() returns ROLE_PARAGRAPH.
Comment 1 Björn Michaelsen 2011-12-23 11:47:43 UTC
[This is an automated message.]
This bug was filed before the changes to Bugzilla on 2011-10-16. Thus it
started right out as NEW without ever being explicitly confirmed. The bug is
changed to state NEEDINFO for this reason. To move this bug from NEEDINFO back
to NEW please check if the bug still persists with the 3.5.0 beta1 or beta2 prereleases.
Details on how to test the 3.5.0 beta1 can be found at:
http://wiki.documentfoundation.org/QA/BugHunting_Session_3.5.0.-1

more detail on this bulk operation: http://nabble.documentfoundation.org/RFC-Operation-Spamzilla-tp3607474p3607474.html
Comment 2 Dattatray Bhat 2011-12-26 22:35:35 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:00:48 UTC
Dear bug submitter!

Due to the fact, that there are a lot of NEEDINFO bugs with no answer within the last six months, we close all of these bugs.

To keep this message short, more infos are available @ https://wiki.documentfoundation.org/QA/NeedinfoClosure#Statement

Thanks for understanding and hopefully updating your bug, so that everything is prepared for developers to fix your problem.

Yours!

Florian
Comment 4 Florian Reisinger 2012-08-14 14:01:55 UTC Comment hidden (obsolete)
Comment 5 Florian Reisinger 2012-08-14 14:06:37 UTC Comment hidden (obsolete)
Comment 6 Florian Reisinger 2012-08-14 14:08:39 UTC Comment hidden (obsolete)
Comment 7 Joanmarie Diggs 2012-08-14 14:32:53 UTC
I don't know how I missed the bugmail, but this was never addressed.
Comment 8 Florian Reisinger 2012-08-15 11:34:28 UTC
Okay
Comment 9 Christophe Strobbe 2013-08-07 16:23:08 UTC
Corresponding Apache OpenOffice bug: https://issues.apache.org/ooo/show_bug.cgi?id=117204
Comment 10 James Michael DuPont 2013-12-25 00:21:49 UTC
I am still researching into this, found some spot in the code that looks suspicious. If we are going to add this, we should consider adding in all the fixmes.

I suspect it has to this with this line here:
vcl/osx/a11yrolehelper.mm:        MAP( AccessibleRole::HEADING, NSAccessibilityUnknownRole ); // FIXME

See :
https://github.com/LibreOffice/core/blob/c49721950cb3d897b35f08bf871239308680b18e/vcl/osx/a11yrolehelper.mm#L69

here are other occurrences of AccessibleRole::HEADING

offapi/com/sun/star/text/AccessibleParagraphView.idl:                ::com::sun::star::accessibility::AccessibleRole::HEADING.
sw/source/core/access/accpara.cxx:        return AccessibleRole::HEADING;
vcl/unx/gtk/a11y/atkwrapper.cxx:        roleMap[accessibility::AccessibleRole::HEADING] = registerRole("heading");


vcl/osx/a11yrolehelper.mm:        MAP( AccessibleRole::HEADING, @"" );



mike
Comment 11 James Michael DuPont 2013-12-25 14:47:36 UTC
vcl/osx/a11yrolehelper.mm: this turns out to be just osx specific, so is not what I was looking for.
Comment 12 Jacobo Aragunde Pérez 2014-02-03 20:28:10 UTC
It seems to me that the cause of the bug is related to SwAccessibleParagraph::getAccessibleRole (at accpara.cxx). this method is called when the object is created, it can happen in one of these cases:

1. When you open a document
2. When you create a new document
3. When you press enter to add a paragraph

Case 1 is working properly, if you open a document that contains some heading, it will get the HEADING role.

In case 2, when the empty document is created an empty paragraph is created too, and it has the PARAGRAPH role. Even if you change its style to a heading later, getAccessibleRole is not called again and the role doesn't change.

Case 3 is like 2, when you press enter a new, empty paragraph is created and it has the same problem.
Comment 13 Jacobo Aragunde Pérez 2014-02-04 14:21:06 UTC
Patch pushed for review:

https://gerrit.libreoffice.org/7853
Comment 14 Commit Notification 2014-02-05 16:50:56 UTC
Jacobo Aragunde Perez committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=c1d69c0e9e3361f9dd340ac133407e1dbb1d08ca

fdo#35105: notify role change through a new UNO a11y event



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 15 Commit Notification 2014-02-07 16:59:59 UTC
Radu Ioan committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=396d4f1c911770895900301f453b6d8f46243252

Related: fdo#35105 initially map HEADING to ATK_ROLE_HEADING



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 16 Buovjaga 2023-10-18 15:33:46 UTC
Notes for unit test writers:

Revert has to be done manually.

See https://wiki.documentfoundation.org/Development/Accessibility_Unit_Tests