Bug 159213 - Move MathML-specific code into a separate accessibility class
Summary: Move MathML-specific code into a separate accessibility class
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Frédéric Wang (:fredw)
URL:
Keywords: InRadar
Depends on:
Blocks: 161081
  Show dependency treegraph
 
Reported: 2016-06-28 09:09 PDT by Frédéric Wang (:fredw)
Modified: 2016-08-23 07:57 PDT (History)
3 users (show)

See Also:


Attachments
WIP Patch (36.32 KB, patch)
2016-06-28 10:13 PDT, Frédéric Wang (:fredw)
no flags Details | Formatted Diff | Diff
Patch (55.76 KB, patch)
2016-06-28 23:20 PDT, Frédéric Wang (:fredw)
cfleizach: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Frédéric Wang (:fredw) 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.
Comment 1 Radar WebKit Bug Importer 2016-06-28 09:10:32 PDT
<rdar://problem/27056316>
Comment 2 Frédéric Wang (:fredw) 2016-06-28 10:13:25 PDT
Created attachment 282253 [details]
WIP Patch
Comment 3 Frédéric Wang (:fredw) 2016-06-28 23:20:36 PDT
Created attachment 282323 [details]
Patch
Comment 4 Frédéric Wang (:fredw) 2016-07-07 15:41:10 PDT
@Chris: can you please take a look at this patch?
Comment 5 chris fleizach 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
Comment 6 Frédéric Wang (:fredw) 2016-07-07 22:52:05 PDT
Committed r202961: <http://trac.webkit.org/changeset/202961>