IA2: Evaluate "level" object attribute#15882
Merged
seanbudd merged 3 commits intoDec 6, 2023
Merged
Conversation
### Link to issue number: Fixes nvaccess#15881 ### Summary of the issue: The "level" object attribute for IAccessible2 to specify the level of a heading is both mentioned in the [Core Accessibility API Mappings specification](https://www.w3.org/TR/core-aam-1.2/#ariaLevelHeading) and in the [IAccessible2::groupPosition documentation](https://accessibility.linuxfoundation.org/a11yspecs/ia2/docs/html/interface_i_accessible2.html#a94d4d84e000ef2fa3f2abf1148779941). However, NVDA was not supporting/evaluating this object attribute in order to determine the heading level, resulting in the heading level no longer getting announced once LibreOffice only reports the "level" attribute as specified and no longer the custom "heading-level" attribute that NVDA's soffice app module relies on. ### Description of user facing changes Reporting heading levels also works for LibreOffice version 24.2 and greater. ### Description of development approach Add handling for the "level" IAccessible2 object attribute when determining position info for an IAccessible2 object. In the soffice app module, add a comment that the custom "heading-level" attribute is only needed for Apache OpenOffice by now, since LibreOffice has already been reporting the "level" object attribute in addition to the "heading-level" attribute since LibreOffice 5.0. ### Testing strategy: Test the scenario as described in issue nvaccess#15881 works as expected with this change in place: 1. start NVDA 2. start current development version of LibreOffice including the following change that drops reporting the non-standard "heading-level" object attribute: https://gerrit.libreoffice.org/c/core/+/160347 3. open the sample document [heading.odt](https://github.com/nvaccess/nvda/files/13560391/heading.odt) 4. use the cursor up/down key to move between the paragraphs/headings 5. When moving to a header, verify that NVDA announces the heading level, e.g. says "heading level 1 Heading 1". ### Known issues with pull request: none ### Code Review Checklist: - [x] Documentation: - Change log entry - User Documentation - Developer / Technical Documentation - Context sensitive help for GUI changes - [x] Testing: - Unit tests - System (end to end) tests - Manual testing - [x] UX of all users considered: - Speech - Braille - Low Vision - Different web browsers - Localization in other languages / culture than English - [x] API is compatible with existing add-ons. - [x] Security precautions taken.
See test results for failed build of commit 1ea286af71 |
See test results for failed build of commit 6cccd5dc10 |
See test results for failed build of commit 876e4712e3 |
cb1bc0e to
4cb2833
Compare
LeonarddeR
approved these changes
Dec 5, 2023
See test results for failed build of commit 1951d7b3f7 |
Fixes issue found by the Chrome system tests, which failed
with this in the NVDA log:
DEBUG - browseMode.BrowseModeDocumentTreeInterceptor._getInitialCaretPos (09:31:17.815) - MainThread (9604):
No saved caret position for file:///C:/tools/cygwin/tmp/tmp_7mo_xk6/test.html
ERROR - queueHandler.flushQueue (09:31:17.815) - MainThread (9604):
Error in func VirtualBuffer._loadBufferDone
Traceback (most recent call last):
File "queueHandler.py", line 64, in flushQueue
func(*args,**kwargs)
File "virtualBuffers\__init__.py", line 497, in _loadBufferDone
self.event_treeInterceptor_gainFocus()
File "browseMode.py", line 1364, in event_treeInterceptor_gainFocus
speech.speakObject(self.rootNVDAObject, reason=OutputReason.FOCUS)
File "speech\speech.py", line 672, in speakObject
sequence = getObjectSpeech(
^^^^^^^^^^^^^^^^
File "speech\speech.py", line 711, in getObjectSpeech
sequence = getObjectPropertiesSpeech(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "speech\speech.py", line 538, in getObjectPropertiesSpeech
positionInfo=obj.positionInfo
^^^^^^^^^^^^^^^^
File "baseObject.py", line 62, in __get__
return instance._getPropertyViaCache(self.fget)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "baseObject.py", line 168, in _getPropertyViaCache
val=getterMethod(self)
^^^^^^^^^^^^^^^^^^
File "NVDAObjects\IAccessible\ia2Web.py", line 124, in _get_positionInfo
info=super(Ia2Web,self).positionInfo
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "baseObject.py", line 62, in __get__
return instance._getPropertyViaCache(self.fget)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "baseObject.py", line 168, in _getPropertyViaCache
val=getterMethod(self)
^^^^^^^^^^^^^^^^^^
File "NVDAObjects\IAccessible\__init__.py", line 1489, in _get_positionInfo
info["level"] = self.IA2Attributes["level"]
~~~~~~~~~~~~~~~~~~^^^^^^^^^
KeyError: 'level'
seanbudd
approved these changes
Dec 6, 2023
tdf-gerrit
pushed a commit
to LibreOffice/core
that referenced
this pull request
Dec 7, 2023
Stop reporting the custom "heading-level" object attribute in addition to the "level" attribute. As described in the Core Accessibility API Mappings spec, the latter is specified in ARIA and maps to an attribute of the same name for all of AT-SPI2, IAccessible2 and UIA [1]. Get rid of the non-documented "heading-level" as part of the goal to align more closely to platform APIs/specifications. NVDA's LibreOffice-specific app module currently relies on the custom "heading-level" object attribute [2], but I've reported an issue and submitted a pull request for this: [3] [4] While neither the "level" nor the "heading-level" attribute are currently mentioned in the the IAccessible2 object attribute specification [5], the IAccessible2 doc for `IAccessible2::groupPosition` [6] explicitly mentions the "level" attribute for headings: > This method is meant to describe the nature of an object's containment > structure. It's exposed by trees, tree grids, nested lists, nested > menus, but not headings, which uses the level object attribute. [1] https://www.w3.org/TR/core-aam-1.2/#ariaLevelHeading [2] https://github.com/nvaccess/nvda/blob/9cf925195e0fc5ffc67dcfcc9e4d4a7d46ffb430/source/appModules/soffice.py#L225 [3] nvaccess/nvda#15881 [4] nvaccess/nvda#15882 [5] https://wiki.linuxfoundation.org/accessibility/iaccessible2/objectattributes [6] https://accessibility.linuxfoundation.org/a11yspecs/ia2/docs/html/interface_i_accessible2.html#a94d4d84e000ef2fa3f2abf1148779941 Change-Id: I8e8994cc7565f9b0f40ca8bedff951512f56b59b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160347 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to issue number:
Fixes #15881
Summary of the issue:
The "level" object attribute for IAccessible2 to specify the level of a heading is both mentioned in the Core Accessibility API Mappings specification and in the IAccessible2::groupPosition documentation. However, NVDA was not supporting/evaluating this object attribute in order to determine the heading level, resulting in the heading level no longer getting announced once LibreOffice only reports the "level" attribute as specified and no longer the custom "heading-level" attribute that NVDA's soffice app module relies on.
Description of user facing changes
Reporting heading levels also works for LibreOffice version 24.2 and greater.
Description of development approach
Add handling for the "level" IAccessible2 object attribute when determining position info for an IAccessible2 object. In the soffice app module, add a comment that the custom "heading-level" attribute is only needed for Apache OpenOffice by now, since LibreOffice has already been reporting the "level" object attribute in addition to the "heading-level" attribute since LibreOffice 5.0.
Testing strategy:
Test the scenario as described in issue #15881 works as expected with this change in place:
Known issues with pull request:
none
Code Review Checklist: