MathMLSpaceElement.cpp [plain text]
#include "config.h"
#if ENABLE(MATHML)
#include "MathMLSpaceElement.h"
#include "RenderMathMLSpace.h"
namespace WebCore {
using namespace MathMLNames;
MathMLSpaceElement::MathMLSpaceElement(const QualifiedName& tagName, Document& document)
: MathMLElement(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 AtomicString& value)
{
if (name == widthAttr)
m_width.dirty = true;
else if (name == heightAttr)
m_height.dirty = true;
else if (name == depthAttr)
m_depth.dirty = true;
MathMLElement::parseAttribute(name, value);
}
RenderPtr<RenderElement> MathMLSpaceElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&)
{
ASSERT(hasTagName(MathMLNames::mspaceTag));
return createRenderer<RenderMathMLSpace>(*this, WTFMove(style));
}
}
#endif // ENABLE(MATHML)