Make MathMLSpaceElement and MathMLTokenElement inherit from MathMLPresentationElement
https://bugs.webkit.org/show_bug.cgi?id=161232
Patch by Frederic Wang <fwang@igalia.com> on 2016-08-28
Reviewed by Darin Adler.
The mrow-like features of MathMLPresentationElement are now moved into RenderMathMLRow.
Hence we make MathMLSpaceElement and MathMLTokenElement inherit from the generic class
MathMLPresentationElement for presentation MathML elements.
No new tests, already covered by existing tests.
* mathml/MathMLSpaceElement.cpp:
(WebCore::MathMLSpaceElement::MathMLSpaceElement): Derive from MathMLPresentationElement.
(WebCore::MathMLSpaceElement::parseAttribute): Ditto.
* mathml/MathMLSpaceElement.h: Ditto. Override acceptsDisplayStyleAttribute as a small
optimization. isPresentationMathML is no longer needed.
* mathml/MathMLTokenElement.cpp:
(WebCore::MathMLTokenElement::MathMLTokenElement): Derive from MathMLPresentationElement.
(WebCore::MathMLTokenElement::didAttachRenderers): Ditto.
(WebCore::MathMLTokenElement::childrenChanged): Ditto.
(WebCore::MathMLTokenElement::parseAttribute): Deleted. No need to override this function
any more since it's already implemented in MathMLPresentationElement.
* mathml/MathMLTokenElement.h: Derive from MathMLPresentationElement. Override
acceptsDisplayStyleAttribute as a small optimization. isPresentationMathML is no longer
needed.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@205100 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/mathml/MathMLSpaceElement.cpp b/Source/WebCore/mathml/MathMLSpaceElement.cpp
index 60cfce1..f892595 100644
--- a/Source/WebCore/mathml/MathMLSpaceElement.cpp
+++ b/Source/WebCore/mathml/MathMLSpaceElement.cpp
@@ -36,7 +36,7 @@
using namespace MathMLNames;
MathMLSpaceElement::MathMLSpaceElement(const QualifiedName& tagName, Document& document)
- : MathMLElement(tagName, document)
+ : MathMLPresentationElement(tagName, document)
{
}
@@ -69,7 +69,7 @@
else if (name == depthAttr)
m_depth = Nullopt;
- MathMLElement::parseAttribute(name, value);
+ MathMLPresentationElement::parseAttribute(name, value);
}
RenderPtr<RenderElement> MathMLSpaceElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&)