Bug 160543 - [meta] Reorganize the MathMLElement hierarchy
Summary: [meta] Reorganize the MathMLElement hierarchy
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: MathML (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on: 160540 160542 161050 161053 161230 161232 161297 161298 161300 161377
Blocks:
  Show dependency treegraph
 
Reported: 2016-08-04 03:50 PDT by Frédéric Wang (:fredw)
Modified: 2017-12-02 01:33 PST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frédéric Wang (:fredw) 2016-08-04 03:50:43 PDT
I've opened bug 160540 and bug 160542 as two simple improvements.

MathMLInlineContainerElement also sounds a bad name for something that is now going to produce RenderMathMLBlocks. The update in MathMLInlineContainerElement::childrenChanged is also probably only necessary in mrow-like elements (mrow of element with inferred mrow like msqrt) but MathMLInlineContainerElement is used for other elements like fraction or scripts.

At the moment most of the elements are actually MathMLInlineContainerElement and I believe most of the code of MathMLElement could be moved in a derived class. Maybe the following hierarchy will be better:

MathMLElement < MathMLPresentationElement

MathMLPresentationElement < MathMLAnnotationElement, MathMLFractionElement, MathMLRowElement, MathMLScriptsElement, MathMLSelectElement, MathMLSpaceElement, MathMLTokenElement

MathMLRowElement < MathMLMencloseElement, MathMLPaddedElement, MathMLMathElement

MathMLScriptsElement < MathMLUnderOverElement

MathMLTokenElement < MathMLOperatorElement

We do like SVG and add a class MathMLUnknownElement deriving from MathMLElement that return false for rendererIsNeeded and that is used as a fallback class.
Comment 1 Frédéric Wang (:fredw) 2016-08-26 02:54:24 PDT
It turns out that MathMLSelectElement must be an mrow since it really behaves as a "selected mrow". Here is the updated proposal:

MathMLElement
  MathMLPresentationElement
    MathMLAnnotationElement
    MathMLFractionElement
    MathMLRowElement 
      MathMLMathElement
      MathMLMencloseElement
      MathMLPaddedElement
      MathMLSelectElement
    MathMLScriptsElement
      MathMLUnderOverElement
    MathMLSpaceElement
    MathMLTokenElement
      MathMLOperatorElement
  MathMLUnknownElement
Comment 2 Frédéric Wang (:fredw) 2017-12-02 01:33:58 PST
A new MathMLRootElement class is introduced in bug 161300 but I believe this bug is now essentially fixed.