RESOLVED FIXED 159213
Move MathML-specific code into a separate accessibility class
https://bugs.webkit.org/show_bug.cgi?id=159213
Summary Move MathML-specific code into a separate accessibility class
Frédéric Wang (:fredw)
Reported 2016-06-28 09:09:58 PDT
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.
Attachments
WIP Patch (36.32 KB, patch)
2016-06-28 10:13 PDT, Frédéric Wang (:fredw)
no flags
Patch (55.76 KB, patch)
2016-06-28 23:20 PDT, Frédéric Wang (:fredw)
cfleizach: review+
Radar WebKit Bug Importer
Comment 1 2016-06-28 09:10:32 PDT
Frédéric Wang (:fredw)
Comment 2 2016-06-28 10:13:25 PDT
Created attachment 282253 [details] WIP Patch
Frédéric Wang (:fredw)
Comment 3 2016-06-28 23:20:36 PDT
Frédéric Wang (:fredw)
Comment 4 2016-07-07 15:41:10 PDT
@Chris: can you please take a look at this patch?
chris fleizach
Comment 5 2016-07-07 17:55:53 PDT
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
Frédéric Wang (:fredw)
Comment 6 2016-07-07 22:52:05 PDT
Note You need to log in before you can comment on or make changes to this bug.