Introduce a MathMLRowElement class for mrow-like elements
authorfred.wang@free.fr <fred.wang@free.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Aug 2016 08:28:07 +0000 (08:28 +0000)
committerfred.wang@free.fr <fred.wang@free.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Aug 2016 08:28:07 +0000 (08:28 +0000)
commitbecd676b688a11d95d67c73f0a91b55f2dacdcee
treef455d4d3d26cbda369aa03ec333d93a832de1eb7
parent6385b38d186a0e68ba9b154cdb2ecadd5a12915a
Introduce a MathMLRowElement class for mrow-like elements
https://bugs.webkit.org/show_bug.cgi?id=161050

Reviewed by Darin Adler.

We introduce a MathMLRowElement class for elements creating RenderMathMLRow renderers.
We also force constructors of the corresponding renderer classes to accept MathMLRowElement.
It's not clear whether semantics-xml really needs to create RenderMathMLRow but for now
we make MathMLAnnotationElement inherits from MathMLRowElement to preserve that behavior.

No new tests, behavior is unchanged.

* CMakeLists.txt: Add MathMLRowElement files.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* mathml/MathMLAllInOne.cpp: Ditto.
* mathml/MathMLInlineContainerElement.cpp: Remove unused headers.
(WebCore::MathMLInlineContainerElement::createElementRenderer): Handle some mrow-like
elements in the MathMLRowElement class.
(WebCore::MathMLInlineContainerElement::acceptsDisplayStyleAttribute): Ditto.
(WebCore::MathMLInlineContainerElement::childrenChanged): Deleted. We only need to calculate
the form for operators inside a MathMLRowElement.
(WebCore::MathMLInlineContainerElement::acceptsMathVariantAttribute): Deleted. mstyle is
handled in the MathMLRowElement class.
* mathml/MathMLInlineContainerElement.h: Update function declarations.
* mathml/MathMLMathElement.cpp: Make this class inherits from MathMLRowElement.
* mathml/MathMLMathElement.h: Ditto.
* mathml/MathMLPaddedElement.cpp: Ditto.
* mathml/MathMLPaddedElement.h: Ditto.
* mathml/MathMLSelectElement.cpp: Ditto.
* mathml/MathMLSelectElement.h: Ditto.
* mathml/MathMLAnnotationElement.cpp: Ditto.
* mathml/MathMLAnnotationElement.h: Ditto.
* mathml/MathMLRowElement.cpp: New class for mrow-like element.
(WebCore::MathMLRowElement::MathMLRowElement):
(WebCore::MathMLRowElement::create):
(WebCore::MathMLRowElement::childrenChanged): Move code from MathMLInlineContainerElement.
(WebCore::MathMLRowElement::createElementRenderer): Ditto.
(WebCore::MathMLRowElement::acceptsDisplayStyleAttribute): Ditto.
(WebCore::MathMLRowElement::acceptsMathVariantAttribute): Ditto.
* mathml/MathMLRowElement.h:
* mathml/mathtags.in: Map tags creating RenderMathMLRow renderers to MathMLRowElement.
* rendering/mathml/RenderMathMLFenced.cpp: Force the constructor to take MathMLRowElement.
* rendering/mathml/RenderMathMLFenced.h: Ditto.
* rendering/mathml/RenderMathMLMath.cpp: Ditto.
* rendering/mathml/RenderMathMLMath.h: Ditto.
* rendering/mathml/RenderMathMLMenclose.cpp: Force the constructor to take MathMLMencloseElement.
* rendering/mathml/RenderMathMLMenclose.h: Ditto.
* rendering/mathml/RenderMathMLRoot.cpp: Force the constructor to take MathMLRowElement.
* rendering/mathml/RenderMathMLRoot.h: Ditto.
* rendering/mathml/RenderMathMLRow.cpp: Ditto and add an helper function element() to
retrieve the MathMLRowElement.
* rendering/mathml/RenderMathMLRow.h: Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204779 268f45cc-cd09-0410-ab3c-d52691b4dbfc
29 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/mathml/MathMLAllInOne.cpp
Source/WebCore/mathml/MathMLAnnotationElement.cpp
Source/WebCore/mathml/MathMLAnnotationElement.h
Source/WebCore/mathml/MathMLInlineContainerElement.cpp
Source/WebCore/mathml/MathMLInlineContainerElement.h
Source/WebCore/mathml/MathMLMathElement.cpp
Source/WebCore/mathml/MathMLMathElement.h
Source/WebCore/mathml/MathMLMencloseElement.cpp
Source/WebCore/mathml/MathMLMencloseElement.h
Source/WebCore/mathml/MathMLPaddedElement.cpp
Source/WebCore/mathml/MathMLPaddedElement.h
Source/WebCore/mathml/MathMLRowElement.cpp [new file with mode: 0644]
Source/WebCore/mathml/MathMLRowElement.h [new file with mode: 0644]
Source/WebCore/mathml/MathMLSelectElement.cpp
Source/WebCore/mathml/MathMLSelectElement.h
Source/WebCore/mathml/mathtags.in
Source/WebCore/rendering/mathml/RenderMathMLFenced.cpp
Source/WebCore/rendering/mathml/RenderMathMLFenced.h
Source/WebCore/rendering/mathml/RenderMathMLMath.cpp
Source/WebCore/rendering/mathml/RenderMathMLMath.h
Source/WebCore/rendering/mathml/RenderMathMLMenclose.cpp
Source/WebCore/rendering/mathml/RenderMathMLMenclose.h
Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp
Source/WebCore/rendering/mathml/RenderMathMLRoot.h
Source/WebCore/rendering/mathml/RenderMathMLRow.cpp
Source/WebCore/rendering/mathml/RenderMathMLRow.h