Working on GTK3 a11y validation tests, I get unmatched roles for some nodes *if I let the mainloop run a bit* before checking. This is however visible in a normal run under accerciser as well (although you'd have to trust me for the internal value of the node, or retrieve the info e.g. with a debugger run). For example, the menu item "Edit -> Find and Replace..." is visible as being a check menu item (why, though? but that's not the point), and it's internal LO representation indeed has role CHECK_MENU_ITEM. However, AT-SPI sees a role MENU_ITEM (no CHECK, then). There seem to be some instances where the role is not properly updated on the ATK object. Note that if I implement AtkObjectWrapper::get_role() this fixes it *but* I'm not confident there wouldn't be some role-changed events missing then. Unfortunately, I don't have a case where I can trigger a missing change manually during a run, so I can't really tell if an event happens or not.
I can reproduce with these steps: 1) apply PS 11 of https://gerrit.libreoffice.org/c/core/+/153069 on top of master (as of 6568a29fa256d143a332b424c0582b0e665b65d6) 2) drop the workaround for this bug here: diff --git a/vcl/qa/cppunit/a11y/atspi2/atspi2.cxx b/vcl/qa/cppunit/a11y/atspi2/atspi2.cxx index bbcd263fee0c..762401181bf4 100644 --- a/vcl/qa/cppunit/a11y/atspi2/atspi2.cxx +++ b/vcl/qa/cppunit/a11y/atspi2/atspi2.cxx @@ -264,9 +264,6 @@ void Atspi2TestTree::compareObjects(uno::Reference<accessibility::XAccessible> x * be represented with a round trip. */ const auto nLORole = mapToAtspiRole(xLOContext->getAccessibleRole()); auto nAtspiRole = pAtspiAccessible.getRole(); - // FIXME: workaround for https://bugs.documentfoundation.org/show_bug.cgi?id=155625 - if (nLORole == ATSPI_ROLE_CHECK_MENU_ITEM && nAtspiRole == ATSPI_ROLE_MENU_ITEM) - nAtspiRole = nLORole; CPPUNIT_ASSERT_EQUAL(nLORole, nAtspiRole); /* name (no need to worry about debugging suffixes as AccessibilityTools::nameEquals does, as * that will also be part of the name sent to ATSPI) */ 3) run the test: make CppunitTest_vcl_gtk3_a11y It fails like this: atspi2.cxx:267:Assertion Test name: Test1::TestBody equality assertion failed - Expected: ATSPI_ROLE_CHECK_MENU_ITEM - Actual : ATSPI_ROLE_MENU_ITEM
I'm working on a fix.
(In reply to Michael Weghorn from comment #2) > I'm working on a fix. -> https://gerrit.libreoffice.org/c/core/+/154947
Michael Weghorn committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/ce0a48a1eb16d6309dba175e032a52eb5ede2542 tdf#155625 a11y: Notify about menu item role change It will be available in 24.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.