MathMLSpaceElement.cpp [plain text]
#include "config.h"
#include "MathMLSpaceElement.h"
#if ENABLE(MATHML)
#include "RenderMathMLSpace.h"
#include <wtf/IsoMallocInlines.h>
namespace WebCore {
WTF_MAKE_ISO_ALLOCATED_IMPL(MathMLSpaceElement);
using namespace MathMLNames;
MathMLSpaceElement::MathMLSpaceElement(const QualifiedName& tagName, Document& document)
: MathMLPresentationElement(tagName, document)
{
}
Ref<MathMLSpaceElement> MathMLSpaceElement::create(const QualifiedName& tagName, Document& document)
{
return adoptRef(*new MathMLSpaceElement(tagName, document));
}
const MathMLElement::Length& MathMLSpaceElement::width()
{
return cachedMathMLLength(MathMLNames::widthAttr, m_width);
}
const MathMLElement::Length& MathMLSpaceElement::height()
{
return cachedMathMLLength(MathMLNames::heightAttr, m_height);
}
const MathMLElement::Length& MathMLSpaceElement::depth()
{
return cachedMathMLLength(MathMLNames::depthAttr, m_depth);
}
void MathMLSpaceElement::parseAttribute(const QualifiedName& name, const AtomString& value)
{
if (name == widthAttr)
m_width = WTF::nullopt;
else if (name == heightAttr)
m_height = WTF::nullopt;
else if (name == depthAttr)
m_depth = WTF::nullopt;
MathMLPresentationElement::parseAttribute(name, value);
}
RenderPtr<RenderElement> MathMLSpaceElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&)
{
ASSERT(hasTagName(MathMLNames::mspaceTag));
return createRenderer<RenderMathMLSpace>(*this, WTFMove(style));
}
}
#endif // ENABLE(MATHML)