sw/source/core/access/accpara.cxx |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 185cd83bf58d8c834a9690cdd6a25736787abbf7
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Tue Dec 5 14:44:45 2023 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Thu Dec 7 07:10:35 2023 +0100

    sw a11y: Only report "level", no more "heading-level" obj attr
    
    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] https://github.com/nvaccess/nvda/issues/15881
    [4] https://github.com/nvaccess/nvda/pull/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.wegh...@posteo.de>

diff --git a/sw/source/core/access/accpara.cxx 
b/sw/source/core/access/accpara.cxx
index 6f487ab46c53..f0bd0f0653d1 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -3519,9 +3519,10 @@ uno::Any SAL_CALL 
SwAccessibleParagraph::getExtendedAttributes()
     OUString strHeading;
     if (m_nHeadingLevel >= 0)
     {
-        strHeading = "heading-level:" + OUString::number(m_nHeadingLevel);
-        // tdf#84102: expose the same attribute with the name "level"
-        strHeading += ";level:" + OUString::number(m_nHeadingLevel) + ";";
+        // report heading level using the "level" object attribute as 
specified in ARIA,
+        // maps to attributes of the same name for AT-SPI, IAccessible2, UIA
+        // https://www.w3.org/TR/core-aam-1.2/#ariaLevelHeading
+        strHeading = "level:" + OUString::number(m_nHeadingLevel) + ";";
     }
 
     return uno::Any(strHeading);

Reply via email to