Bug 250126

Summary: RELEASE_ASSERT_NOT_REACHED in AccessibilityObjectAtspi::role() with MathML scripts
Product: WebKit Reporter: Frédéric Wang (:fredw) <fred.wang>
Component: AccessibilityAssignee: Frédéric Wang (:fredw) <fred.wang>
Status: RESOLVED FIXED    
Severity: Normal CC: andresg_22, cgarcia, jdiggs, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Reduced testcase none

Description Frédéric Wang (:fredw) 2023-01-05 04:55:50 PST
Created attachment 464346 [details]
Reduced testcase

Original repro: Open https://www.mathjax.org/#samples and click the select element to change the rendering mode.

Attached is a testcase reduced with the help of lithium, which involves munder/mover/munderover elements.

We are reaching the following assert:

https://searchfox.org/wubkat/source/Source/WebCore/accessibility/atspi/AccessibilityObjectAtspi.cpp#393

Per https://w3c.github.io/mathml-aam/ AccessibilityObjectAtspi::effectiveRole() should return Atspi::Role::Section for isMathUnderOver().

Here is a simple fix:

diff --git a/Source/WebCore/accessibility/atspi/AccessibilityObjectAtspi.cpp b/Source/WebCore/accessibility/atspi/AccessibilityObjectAtspi.cpp
index 0a869b206589..afaf6b9b0fb7 100644
--- a/Source/WebCore/accessibility/atspi/AccessibilityObjectAtspi.cpp
+++ b/Source/WebCore/accessibility/atspi/AccessibilityObjectAtspi.cpp
@@ -1225,7 +1225,7 @@ std::optional<unsigned> AccessibilityObjectAtspi::effectiveRole() const
             return Atspi::Role::TableRow;
         if (m_coreObject->isMathTableCell())
             return Atspi::Role::TableCell;
-        if (m_coreObject->isMathSubscriptSuperscript() || m_coreObject->isMathMultiscript())
+        if (m_coreObject->isMathUnderOver() || m_coreObject->isMathSubscriptSuperscript() || m_coreObject->isMathMultiscript())
             return Atspi::Role::Section;
         if (m_coreObject->isMathFraction())
             return Atspi::Role::MathFraction;
Comment 1 Radar WebKit Bug Importer 2023-01-05 04:56:04 PST
<rdar://problem/103909843>
Comment 2 Frédéric Wang (:fredw) 2023-01-05 07:03:43 PST
Pull request: https://github.com/WebKit/WebKit/pull/8234
Comment 3 EWS 2023-01-16 23:28:47 PST
Committed 258971@main (c7e23e3505d3): <https://commits.webkit.org/258971@main>

Reviewed commits have been landed. Closing PR #8234 and removing active labels.