Currently, MathML is completely handled in the generic AccessibilityRenderObject and it's sometimes not very convenient to work with. We could improve the organization a bit and move MathML-specific code into a separate AccessibilityMathMLElement class: 1) textUnderElement The case isAnonymousMathOperator() can be moved into AccessibilityMathMLElement. 2) computeAccessibilityIsIgnored (and its helper function isIgnoredElementWithinMathTree) We can easily return the boolean value for math elements. However, we also ignore anonymous RenderBlock inside MathML which are *not* mathml renderers, so some special handling must be kept in AccessibilityRenderObject. 3) determineAccessibilityRole We can move the mapping mathTag => DocumentMathRole into AccessibilityMathMLElement. 4) All the other math functions (isMathElement, mathRadicandObject etc) can directly be moved into AccessibilityMathMLElement.
<rdar://problem/27056316>
Created attachment 282253 [details] WIP Patch
Created attachment 282323 [details] Patch
@Chris: can you please take a look at this patch?
Comment on attachment 282323 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=282323&action=review > Source/WebCore/accessibility/AccessibilityMathMLElement.cpp:146 > + if (!m_renderer || !m_renderer->isRenderMathMLOperator()) this can be written in one line
Committed r202961: <http://trac.webkit.org/changeset/202961>