#ifndef MathMLElement_h
#define MathMLElement_h
#if ENABLE(MATHML)
#include "MathMLNames.h"
#include "StyledElement.h"
namespace WebCore {
class MathMLElement : public StyledElement {
public:
static Ref<MathMLElement> create(const QualifiedName& tagName, Document&);
int colSpan() const;
int rowSpan() const;
bool isMathMLToken() const
{
return hasTagName(MathMLNames::miTag) || hasTagName(MathMLNames::mnTag) || hasTagName(MathMLNames::moTag) || hasTagName(MathMLNames::msTag) || hasTagName(MathMLNames::mtextTag);
}
bool isSemanticAnnotation() const
{
return hasTagName(MathMLNames::annotationTag) || hasTagName(MathMLNames::annotation_xmlTag);
}
virtual bool isPresentationMathML() const;
bool hasTagName(const MathMLQualifiedName& name) const { return hasLocalName(name.localName()); }
protected:
MathMLElement(const QualifiedName& tagName, Document&);
virtual void parseAttribute(const QualifiedName&, const AtomicString&) override;
virtual bool childShouldCreateRenderer(const Node&) const override;
virtual void attributeChanged(const QualifiedName&, const AtomicString& oldValue, const AtomicString& newValue, AttributeModificationReason) override;
virtual bool isPresentationAttribute(const QualifiedName&) const override;
virtual void collectStyleForPresentationAttribute(const QualifiedName&, const AtomicString&, MutableStyleProperties&) override;
bool isPhrasingContent(const Node&) const;
bool isFlowContent(const Node&) const;
private:
virtual void updateSelectedChild() { }
};
inline bool Node::hasTagName(const MathMLQualifiedName& name) const
{
return isMathMLElement() && downcast<MathMLElement>(*this).hasTagName(name);
}
}
SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::MathMLElement)
static bool isType(const WebCore::Node& node) { return node.isMathMLElement(); }
SPECIALIZE_TYPE_TRAITS_END()
#include "MathMLElementTypeHelpers.h"
#endif // ENABLE(MATHML)
#endif // MathMLElement_h