MathMLRowElement.cpp [plain text]
#include "config.h"
#include "MathMLRowElement.h"
#if ENABLE(MATHML)
#include "MathMLNames.h"
#include "MathMLOperatorElement.h"
#include "RenderMathMLFenced.h"
#include "RenderMathMLMenclose.h"
#include "RenderMathMLRoot.h"
#include "RenderMathMLRow.h"
namespace WebCore {
using namespace MathMLNames;
MathMLRowElement::MathMLRowElement(const QualifiedName& tagName, Document& document)
: MathMLPresentationElement(tagName, document)
{
}
Ref<MathMLRowElement> MathMLRowElement::create(const QualifiedName& tagName, Document& document)
{
return adoptRef(*new MathMLRowElement(tagName, document));
}
void MathMLRowElement::childrenChanged(const ChildChange& change)
{
for (auto child = firstChild(); child; child = child->nextSibling()) {
if (child->hasTagName(moTag))
static_cast<MathMLOperatorElement*>(child)->setOperatorFormDirty();
}
MathMLPresentationElement::childrenChanged(change);
}
RenderPtr<RenderElement> MathMLRowElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&)
{
if (hasTagName(msqrtTag) || hasTagName(mrootTag))
return createRenderer<RenderMathMLRoot>(*this, WTFMove(style));
if (hasTagName(mfencedTag))
return createRenderer<RenderMathMLFenced>(*this, WTFMove(style));
ASSERT(hasTagName(merrorTag) || hasTagName(mphantomTag) || hasTagName(mrowTag) || hasTagName(mstyleTag));
return createRenderer<RenderMathMLRow>(*this, WTFMove(style));
}
bool MathMLRowElement::acceptsDisplayStyleAttribute()
{
return hasTagName(mstyleTag);
}
bool MathMLRowElement::acceptsMathVariantAttribute()
{
return hasTagName(mstyleTag);
}
}
#endif // ENABLE(MATHML)